0

I have the following code:

{if segment_1  == 'special-offers'}
        {exp:channel:entries channel="products" dynamic="no" url_title="{last_segment}"}
        <link rel="canonical" href="{site_url}{categories limit="1"}{category_url_title}{/categories}/product/{last_segment}" />
        {/exp:channel:entries}
        {/if}

This is returning no entries. If I remove the url_title="{last_segment}" part, I get all the entries in that channel, which Is not what I want. Can anybody see why I can't limit the results by the last segment? Is there another way to do it?

  • 1
    Are you sure that your last segment matches the url_title of an entry in the products channel? Also: is your last segment just the second segment? – Derek Hogue Dec 1 '14 at 15:54
  • 1
    Hi Derek, thanks for you help. For some reason it's decided to start working. Very odd, I haven't changed anything since yesterday, but it's decided to start working now. – Mark Dec 1 '14 at 16:00
  • 1
    just guessing, but could possibly caused by the entry having a future date, which in turn could be caused by your server timezone being set incorrectly. – James Smith Dec 2 '14 at 9:26
3

Check the date on the entry. Perhaps it has accidentally been set to the future at some point and so only just started working now. Just a thought.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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