Friday, 23 August 2013

Expression Engine- show default entry if url_title not present in url

Expression Engine- show default entry if url_title not present in url

{exp:channel:entries dynamic="yes" limit="1"}
// some code
{/exp:channel:entries}
Dynamic is set to on, so that it will display the entry whose url_title is
present as the last segment of the url. All working fine.
I also have an index page (as a channel entry), whose url_title is
'index_page'. But I want this page to appear by default without this last
url segment having to be present. Is there a way to do something like:
{exp:channel:entries dynamic="yes" default_url_title="index_page" limit="1"}
// some code
{/exp:channel:entries}
Spent the last hour googling this to no avail!
Thanks.

No comments:

Post a Comment