Gossamer Forum
Quote Reply
if parent eq 'X'
I have one category and it's subcats that I want <%Number_of_Links%> to show up on my category pages. I know I can edit them in the subcategory.html file and use a seperate template set, but so far, I have been able to get away with only 1 template set. I'm hoping to figure out how to use an if statement to get my desired results.

I am building static pages.

Here's what I am hoping to do:

<%if (parent category) eq 'classifieds'%>
<%Number_of_Links%>
<%endif%>

so that all the subcategories underneath the category "classifieds" will then show the results of <%Number_of_Links%>.

Is this possible? How would I word the if statement?
The idea is that I only want the category Classifieds and it's subcats to show the <%Number_of_Links%>.

Smile Thanks!

Last edited by:

Evoir: Aug 11, 2002, 11:11 PM
Quote Reply
Re: [Evoir] if parent eq 'X' In reply to
<%if FatherID == 23%>

where 23 is the ID of your classifieds category.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [Evoir] if parent eq 'X' In reply to
Hi,

And if you ever decide you want more categories not to show the number of links, at some point you could add an extra coloumn 'ShowNumbers', and add an if statement to your subcategory.html template:

<%if ShowNumbers eq 'Yes'%> <%Number_of_Links%> <%endif%>


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [yogi] if parent eq 'X' In reply to
Thanks. Smile

Yogi, do you mean to have two == ?

<%if FatherID == 23%>


or should it be:

<%if FatherID = 23%>
Quote Reply
Re: [Evoir] if parent eq 'X' In reply to
Yep == is for comparisons = is for assignment :)

Last edited by:

Paul: Aug 12, 2002, 9:52 AM
Quote Reply
Re: [Ian] if parent eq 'X' In reply to
Ian,

Do you mean to add a column in the category table? This is an intersting and flexible idea, if that is what you meant. Although I still may go in the other direction. All kinds of possibilities are showing up for me. Smile Thanks.
Quote Reply
Re: [Evoir] if parent eq 'X' In reply to
Yes, add ShowNumbers to your category table as ENUM 'Yes' 'No'.

I use this myself for my root (top level) categories, and test categories. It saves me remembering to alter templates. Also, the templates could get a little messy with 15 or more 'ifs'. This way you just have one if for all categories.


http://www.iuni.com/...tware/web/index.html
Links Plugins