I’m having trouble using an if statement with a weblog entry category_id as a the conditional. This page doesn’t have category in its URL segments - its a ‘full post’, permalink style page. Because of that I thought it might be messing up the category_id, however it’s working without the if statement earlier in the code:
<body class="bodyBlogs" id="blogs{exp:weblog:entries weblog="law-blogs" limit="1" disable="trackbacks|comments|member_data|pagination"}{categories}{category_id}{/categories}{/exp:weblog:entries}">prints as this:
<body class="bodyBlogs" id="blogs6">So, using the same idea, I’m using an if, if:else statement to print different headings, depending on the category:
<h2 id="title">{exp:weblog:entries weblog="law-blogs" limit="1" disable="trackbacks|comments|member_data|pagination"}{if category_id == '5'}Labor and Employment Law Blog{if:elseif category_id == '6'}Mississippi Alcohol and Liquor{/if}{/exp:weblog:entries}</h2>But that is currently printing nothing. I don’t know if I’m screwing up some syntax, or if I’m misunderstanding the concept of what I’m trying to do.
Here is a live example page:
http://www2.watkinsludlam.com/law-blogs/post/and-speaking-of-sunday-sales/
Thanks in advance, guys!