CGBlog - Show Empty Categories in Browse Category Template

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
jirvin
New Member
New Member
Posts: 2
Joined: Thu Sep 08, 2016 5:29 pm

CGBlog - Show Empty Categories in Browse Category Template

Post by jirvin »

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
pWorker
Forum Members
Forum Members
Posts: 48
Joined: Wed Aug 31, 2016 1:30 pm

Re: CGBlog - Show Empty Categories in Browse Category Templa

Post by pWorker »

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
jirvin
New Member
New Member
Posts: 2
Joined: Thu Sep 08, 2016 5:29 pm

Re: CGBlog - Show Empty Categories in Browse Category Templa

Post by jirvin »

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>&nbsp;({$one.count})</li>
{/foreach}
</ul>

No if's. :\ Which is what's making it difficult for me.

Thanks,

J
pWorker
Forum Members
Forum Members
Posts: 48
Joined: Wed Aug 31, 2016 1:30 pm

Re: CGBlog - Show Empty Categories in Browse Category Templa

Post by pWorker »

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
Post Reply

Return to “Modules/Add-Ons”