Can anybody tell me why this doesn’t work? The idea is that if the viewer selects a story to “read more” or to comment on, the page they are taken to has a side bar that has a non-changing description of the category that the story belongs to. Thus, if the category is racing the side bar will have a little intro on racing at our Club. These side bar stories are just normal weblog entries, one for each category, that are referred to by entry_id.
{exp:weblog:category_heading weblog="{my_weblog}"}
<h1 class="first">{category_name}</h1>
{if category_name == "Scholarship"}{exp:weblog:entries weblog="{my_weblog}" entry_id="9"}
{if:elseif category_name == "Racing"}{exp:weblog:entries weblog="{my_weblog}" entry_id="10"}
{/if}
{body}
{if allow_comments}
<dl class="nav3-nobullet">
<dt><a href="http://{url_title_path="> Comments</a> ({comment_total})</dt>
</dl>
{/if}
{/exp:weblog:entries}
{/exp:weblog:category_heading}Using the above code, if the category of the story is Scholarship it works but if the category is Racing nothing happens. If I swap Racing and Scholarship (and their entry_id numbers) then Racing works and Scholarship doesn’t. So it seems that the code stops working at the first “if”.
Maybe I should use PHP to create a variable to contain the entry_id number?