Hello,
I recently installed CGBlog on one of our customer's sites. Our customer had an odd request--they want ALL categories to show in the Browse Category View Template, not just the ones that have entries. (This is something they really want, despite trying to explain why this might not be a great idea.)
I tried:
{CGBlog action="browsecat" showall="0"}
But no luck.
I also creeped the code and tried a few things based on that as well, but also no luck.
I'm not all that familiar with CMSMS, so any help anyone can provide would be really appreciated.
Thanks,
-J
CGBlog - Show Empty Categories in Browse Category Template
Re: CGBlog - Show Empty Categories in Browse Category Templa
Hi,
i think it`s written in your CGBlog-standard-browsecat-template.
There has to be an {if} condition in the for each loop which only gives you a linked entry back if count>0.
If you change that condition, you will have to convert (the then created) empty categories entries in spans without or with customized, link function.
Would be helpful to see the template code.
mfg
i think it`s written in your CGBlog-standard-browsecat-template.
There has to be an {if} condition in the for each loop which only gives you a linked entry back if count>0.
If you change that condition, you will have to convert (the then created) empty categories entries in spans without or with customized, link function.
Would be helpful to see the template code.
mfg
Re: CGBlog - Show Empty Categories in Browse Category Templa
Thanks so much for your reply!
The code (Browse Cat View Temp) is the default code:
<ul>
{foreach from=$categories item='one'}
<li><a href="{$one.url}" title="{$one.name}">{$one.name}</a> ({$one.count})</li>
{/foreach}
</ul>
No if's. :\ Which is what's making it difficult for me.
Thanks,
J
The code (Browse Cat View Temp) is the default code:
<ul>
{foreach from=$categories item='one'}
<li><a href="{$one.url}" title="{$one.name}">{$one.name}</a> ({$one.count})</li>
{/foreach}
</ul>
No if's. :\ Which is what's making it difficult for me.
Thanks,
J
Re: CGBlog - Show Empty Categories in Browse Category Templa
Hi,
In my opinion your code is correct as it is ... is the template set as default browsecat template in the CGBlog template tab? Otherwise just add {browsecattemplate="YOURTEMPLATE"} within your {cgblog} call.
If that doesn`t help, add {get_template_vars} at the end of that template. Then you will get a list of variables that can be used in place of {$one.name} as list output.
mfg
In my opinion your code is correct as it is ... is the template set as default browsecat template in the CGBlog template tab? Otherwise just add {browsecattemplate="YOURTEMPLATE"} within your {cgblog} call.
If that doesn`t help, add {get_template_vars} at the end of that template. Then you will get a list of variables that can be used in place of {$one.name} as list output.
mfg