But I’m fuzzy on why this needs to be nested inside a weblog tag- and it’s something I’d avoid doing on a multi-entry page if at all possible.
Ok Robin, I´ll try to explain:
My first thing was following code, OUTSIDE the weblog tag:
{exp:weblog:category_heading weblog="{my_weblog}"}
<h2>{category_name}</h2>
<p>{if category_description}{category_description}{/if}</p>
<p>{exp:query sql="SELECT cat_name AS sub_cat_name, cat_id AS sub_cat_id FROM exp_categories WHERE parent_id = '{category_id}' AND group_id = '1'"}<br />
(<a href="http://{path={my_template_group}/C{sub_cat_id}}">{sub_cat_name}</a>) <br />
{/exp:query}</p>
<p>{/exp:weblog:category_heading}
Then I realised, that everybody who put any category-number in the URL will see the category header (if category exists), regardless what weblog and category. So you have only try all numbers through and you´ll see all named categories. I want to avoid that.
So I moved the above code into the webglog tag and embeded it into a {if category_request AND count == 1} pair. I think, it´s not really good practice. But now, it will show only category headers who belongs to the assigned weblog.
That is the reason, why I nested it into the weblog tag. Do you have a better idea?
And how would you build up the query (quick and dirty) to sort out empty categories?
(I´m not a newbie to SQL but really not a geek)
Thanks for your reply,
Geri