PDA

View Full Version : Top categories display issue.


nau
09-19-2006, 07:38 AM
Hello guys!
I use the following code in my template to display top categories:
{foreach from=$top_categories item=top_category}
<p class="top-category"><a href="{$config.base}{$config.dir}{$top_category.path}/">{$top_category.title}</a></p>
{/foreach}
Is it possible to highlight current (active) category?

Vincent Wright
09-19-2006, 07:42 AM
May I take a look at the page with top categories?

And what do you mean current/active category?

nau
09-19-2006, 08:46 AM
May I take a look at the page with top categories?

And what do you mean current/active category?
Take a look here:
http://www.phpground.com/auctions/

Is it possible to highlight "Auctions" menu item?

Vincent Wright
09-19-2006, 08:56 AM
What does it have to do with TOP CATEGORIES page?

nau
09-19-2006, 09:14 AM
What does it have to do with TOP CATEGORIES page?
With Top Categories menu from the left side, "Fast Navigation" at the page I provided. All I want to do is to change "p" class for current category and make it as a simple text (not hyper link), very similar to Top menu.

Vincent Wright
09-19-2006, 09:31 AM
Ah, I got it.

Change the code above to this one


{foreach from=$top_categories item=top_category}
{if $top_category.id eq $category.id}
<p class="top-category">{$top_category.title}</p>
{else}
<p class="top-category"><a href="{$config.base}{$config.dir}{$top_category.path}/">{$top_category.title}</a></p>
{/if}
{/foreach}


You can adjust <p> class as well.

Hope this helps.

nau
09-19-2006, 09:56 AM
Cool!!! It's exactly what I need! Thanks!

Vincent Wright
09-19-2006, 10:01 AM
You are welcome, nau ;)