0

I can't get it work. Ik use structure, low events and freebie in a ee website.

My code looks like this:

{exp:switchee variable="{segment_3}" parse="inward"}
{!-- --------------------------------- All agenda items ----------------------------------------------  --}
{case value="''"}

{exp:low_events:calendar channel="ch_agenda" date="{freebie_3}"}

{if '{prev_month format="%Y%m"}' >= '{current_time format="%Y%m"}'}
<a href="{path="actueel/agenda/{prev_month_url}"}" title="{prev_month format='%F %Y'}">
{exp:low_events:prev_date date="{freebie_3}" unit="month" format="%F %Y"}</a>{/if}


<a href="{path="actueel/agenda/{next_month_url}"}" title="{next_month format='%F %Y'}">
{next_month format="%F %Y"}</a>

<div class="maand">
{this_month format="%F %Y"}
</div>

{/exp:low_events:calendar}

{exp:low_events:entries channel="ch_agenda" date="{freebie_3}" unit="month" show_passed="no" no_results="yes"}

<h1><a href="{url_title_path='actueel/agenda'}">{title}</a></h1>
{agenda_datum:start_date format="%j %F %Y"}
{if '{agenda_datum:end_date format="%j %F %Y"}' > "{agenda_datum:start_date format='%j %F %Y'}"} tot {agenda_datum:end_date format="%j %F %Y"}{/if} {agenda_plaatst}
<br />

<a href="{page_url}">read more...</a>



{/exp:low_events:entries}

{/case}

{!-- --------------------------------- 1 detail item  ----------------------------------------------  --}
{case default="Yes"}

{exp:channel:entries channel="ch_agenda" limit="1" dynamic="yes"}

{if agenda_image != ""}<img src="{agenda_image:agendaopmaat}" width="500" alt="{title}">{/if}
<h1 class="agenda-titel">{title}</h1>
{agenda_datum:start_date format="%j %F %Y"}
{if '{agenda_datum:end_date format="%j %F %Y"}' > "{agenda_datum:start_date format='%j %F %Y'}"}
 tot {agenda_datum:end_date format="%j %F %Y"}{/if} {agenda_plaatst}
{agenda_tekst}

{/exp:channel:entries}

{/case}

{/exp:switchee}

When I go to agenda I get this URL and what I see is what I want. http://site.nl/actueel/agenda/

In the Freebie settings I have as Breaking Segments: agenda

I did this to be able to use this link: <a href="{path="actueel/agenda/{next_month_url}"}" title="{next_month format='%F %Y'}"> without problem with structure. I get then this URL: http://site.nl/actueel/agenda/2014-11

But I have a problem with my read more… link: <a href="{page_url}">read more...</a> I know it's because of my Freebie settings but how can I get de detail page to work.

2
  • Are you saying the {page_url} doesn't render correctly inside a low_events:entries tag?
    – Low
    Oct 9, 2014 at 15:50
  • No this not the problem.
    – worfoual
    Oct 9, 2014 at 16:58

2 Answers 2

0

I think you can only append segments to the end, so the details may not work if you're telling Freebie/Structure to ignore everything after agenda.

1
  • I agree with you but I can not find a way to get what I want. I have try with switchee, also no succes. It must be possible to use Structure with LowEvents and get a page detail. When I have something like that: .../agenda it is working perfect but if I have something like that ../agenda/2014-11 I got probleem with structure, I get a 404 page. That's why I try with Freebie and use agenda as breaking point but then I Can't get something like that: ...agenda/url_title
    – worfoual
    Oct 9, 2014 at 17:04
0

Assuming you need an url like this: site.nl/actueel/agenda/2014-11-1/url-title

  • freebie_1: actueel
  • freebie_2: agenda
  • freebie_3: date
  • freebie_4: url title

You could try to test the freebie segments with a nested switchee:

{exp:switchee variable="{freebie_4}" parse="inward"}
    {!-- start by checking the last possible segment --}
      {case value=''}
        {!-- ok, so freebie_4 is empty, now let's test the other segments
        {switchee variable="{freebie_3}"}
          {case value=''}
          {!-- Ok, freebie_3 is empty. this should be the agenda overview page--}
          {/case}
          {case default="Yes"}
            {!-- Ok, freebie_3 is not empty. this should be the month view --}
          {/case}
        {/switchee}
      {/case}
      {case default="Yes"}
      {!-- show the item --}
        {exp:channel:entries channel="ch_agenda" limit="1" dynamic="no" url_title="{freebie_4}"}
          {title}
        {/exp:channel:entries}
      {/case}
    {/exp:switchee}

Since you are taking this all out of EE/Structure hierarchy, your page_url variable will not work properly anymore. Guess you will have to build the links manually like {site_url}actueel/agenda/date-segment/{url_title}/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.