[SOLVED] URGENT category links in summary and detail cgblog

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm

[SOLVED] URGENT category links in summary and detail cgblog

Post by carasmo »

I'm sorry. I have this code working on my site, it prints out a link to the category page in both the summary and detail views, however when I created a new install with the same modules and extensions and css etc., on another site, it doesn't work at all. I must be missing something...

Code: Select all

{if $entry->categories}
<ul>
{foreach from=$entry->categories item='one_category'}
   {foreach from=$categories item='one'}
      {if $one_category.name == $one.name}
         <li> <a class="tag" href="{$one.url}" title="{$one.name}">{$one.name}</a></li>
      {/if}
   {/foreach}
{/foreach}
</ul>
{/if}
carasmo
Power Poster
Power Poster
Posts: 506
Joined: Thu Feb 08, 2007 6:11 pm

Re: [SOLVED] URGENT category links in summary and detail cgb

Post by carasmo »

okay, I figured it out:

first make a browse category template named "categorynav":

Code: Select all

{capture assign="foo"}
<ul>
  <li><a href="blog.html" title="blog">all</a></li>
{foreach from=$categories item='one'}
  <li><a href="{$one.url}" title="{$one.name}">{$one.name}</a></li>
{/foreach}
</ul>
{/capture}
Then call it on your detail page where the blog summary and/or detail page shows up:

Code: Select all

{if $page_alias eq 'blogsummarypage' or $page_alias eq 'blogdetailpage'}
{CGBlog uglyurls="0" summarytemplate="default" browsecattemplate="categorynav" action="browsecat"}
{/if}
Post Reply

Return to “Modules/Add-Ons”