Gossamer Forum
Quote Reply
A Simple Global?
Hello,



I was wondering if anyone had a similar global they could share with this forum:

1) How do display the amount of subcats in a category? In other words if a category car had 3 subcategories I could display the total of 3 next to this car category's name... Something like this:

CAR new 155 subs 3
Quote Reply
Re: [nt6] A Simple Global? In reply to
For the immediate subcats, you can use
Code:
sub {
return $DB->table('Category')->count( { FatherID => shift } );
}
from the templates, through

<%my_gobal($ID)%>

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] A Simple Global? In reply to
Thank you Yogi.
Quote Reply
Re: [yogi] A Simple Global? In reply to
Ivan,



this global <%Number_of_Links%> returns the number of links in the current and all sub categories. What would I need to do for it just to return the amount only in the current category, not including the sub categories. Thank you.
Quote Reply
Re: [nt6] A Simple Global? In reply to
<%total%>

You can always use <%GT::Template::dump%> on a template to see what tags are available.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] A Simple Global? In reply to
Crazy Oops sorry I should that by now. Blush