Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

subcategory.html template - how to split it up for each subcat

Quote Reply
subcategory.html template - how to split it up for each subcat
From what I understand, the template subcategory.html is responsible for the display of subcategory pages...Can this file be switched on for various toplevels or can there only be one in the system?

e.g

<%if CategoryName="ABC"%>

<%include subcat_abc.html%>

<%endif%>

where ABC is the name of any category in the database tree (top-level or any level)...
Quote Reply
Re: [scorpioncapital] subcategory.html template - how to split it up for each subcat In reply to
Could use the category_loop;

Code:
<%if ID == 5%>

<%loop category_loop%>
.. all you variables are here...
<%endloop%>

<%else%>

<%include subcategory.html%>


<%endif%>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] subcategory.html template - how to split it up for each subcat In reply to
I think what is really confusing is that in category.html there is NO explicit call to subcategory.html. I assume that when you include the tag <%categories%> this does an automatic reference to subcategory.html to get the format of the section...
Quote Reply
Re: [scorpioncapital] subcategory.html template - how to split it up for each subcat In reply to
You assumed right :)

It uses subcategory.html, and also formats the categories into the appropriate number of columns that they need to be listed in.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] subcategory.html template - how to split it up for each subcat In reply to
Here's another way to do it, not sure if there are any disadvantages:



in subcategory.html put this line:

<%if FatherID == 27%>

formatting for all cats under 27

<%elseif FatherID == 26%>

..

This is assuming you want to format the subcategory page based on differences in your toplevels
Quote Reply
Re: [scorpioncapital] subcategory.html template - how to split it up for each subcat In reply to
Sorry, you are correct. FatherID is the option you would need to use. ID would be the category in question, and not the category you are trying to compare. You code should work fine.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!