Hi,
I’m having problems with a seemingly simple conditional on the following page - http://www.project-ability.co.uk/blog
By default I want the blog to display blog entries by month. The page also displays blog entries by Category - these should not be limited by month as we want to see all entries in a category. Also - we want to display the latest 5 blog entries on the page.
I can conditionally exclude the display_by=“month” parameter by checking URL segment_2 for the ‘category’ trigger:
{exp:weblog:entries weblog="{my_section}" disable="trackbacks" dynamic="on" {if segment_2 != "category"}display_by="month"{/if}}But - if an entry is included in the ‘Latest Posts’ list but it’s entry date wasn’t within the current month then it can’t be displayed. The obvious solution is to only include the display_by=“month” parameter if segment_2 is empty (ie. the default blog url - no URL title specified) or if segment_2 does not contain the ‘category’ trigger.
{exp:weblog:entries weblog="{my_section}" disable="trackbacks" dynamic="on" {if segment_2 == "" OR segment_2 != "category"}display_by="month"{/if}}This works in that it turns off the display_by parameter if segment_2 is ‘category’; it also turns off display_by if there is a url_title. The problem is that it is not including the ‘display_by’ for the default blog url (ie. no url title an no category)
Hope that makes sense - any advice appreciated.
Darrell