Hello,
I’ve used this code posted at http://fortysevenmedia.com/tuts/ee_cat_url.txt as a basis for one of my channels:
<!--The Categories Page ///////////////////////////////////////////////////////////////-->
{if segment_2=="" AND segment_3==""}
{exp:weblog:categories weblog="yours" style="linear"}
<a href="http://{path=">{category_name}</a>
{/exp:weblog:categories}
<!--The Category Entries Page ///////////////////////////////////////////////////////////////-->
{if:elseif segment_2!="" AND segment_3==""}
{exp:query sql="SELECT cat_id FROM exp_categories WHERE cat_url_title = '{segment_2}'"}
{exp:weblog:entries weblog="yours" category="{cat_id}"}
<a href="http://{title_permalink={segment_1}/{segment_2}}">{title}</a>
{/exp:weblog:entries}
{/exp:query}
<!--The Single Entry ///////////////////////////////////////////////////////////////-->
{if:elseif segment_3!=""}
{exp:weblog:entries weblog="yours" limit="1" url_title="{segment_3}"}
Call whatever custom fields you have here
{/exp:weblog:entries}
{/if}
The problem I’ve come across is that I’d like to extend the functionality to segment_4 but can’t accomplish this nomatter what I try.
My structure is the following:
<!--The Category Entries Page ///////////////////////////////////////////////////////////////-->
{if segment_2!="" AND segment_3==""}
showing my entries per category:
<a href="http://www.mysite.com/channel/category/">http://www.mysite.com/channel/category/</a>
FINE
<!--The Category Entries Page PER YEAR ///////////////////////////////////////////////////////////////-->
{if:elseif segment_3!=""}
showing my entries per category AND filtered by year:
<a href="http://www.mysite.com/channel/category/year">http://www.mysite.com/channel/category/year</a>
FINE
<!--The Single Entry ///////////////////////////////////////////////////////////////-->
{if:elseif segment_3!=""}
required to show the single entry:
<a href="http://www.mysite.com/channel/category/year/url_title">http://www.mysite.com/channel/category/year/url_title</a> or
<a href="http://www.mysite.com/channel/category/url_title">http://www.mysite.com/channel/category/url_title</a>
PROBLEMI’ve tried to shift the entry to segment_4 but it doesn’t work.
So far I’ve been spending 3 days on solving this problem and am quite discouraged. Any help would be highly apreciated!
Kind regards,
E.