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


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

dynamic set on, display entry url_title present last segment of url. working fine.

i have index page (as channel entry), url_title 'index_page'. want page appear default without last url segment having present. there way like:

{exp:channel:entries dynamic="yes" default_url_title="index_page" limit="1"}   // code {/exp:channel:entries} 

spent last hour googling no avail!

thanks.

rather using embeds (as slow expressionengine down (http://www.sidd3.com/10-tips-to-optimize-expressionengine-website-for-better-performance/), alternate approach using url segments.

for example if url_title you're using in segment_2 below:

{if segment_2 == ""}      <!-- default index page -->     {exp:channel:entries dynamic="no" url_title="index_page"}         // code     {/exp:channel:entries}  {if:else}      <!-- , other pages -->     {exp:channel:entries dynamic="yes" limit="1"}     // code     {/exp:channel:entries}  {/if} 

in else clause i'd prefer still manually parse url_title parameter url_title="{segment_2}"... that's me.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -