Webmastersite.net
Register Log In

Adding content to specific categories

Comments on Adding content to specific categories

tfbpa
Beginner

Usergroup: Customer
Joined: Aug 20, 2004

Total Topics: 2
Total Comments: 9
tfbpa
Posted Mar 16, 2005 - 3:16 PM:

What I would like is to add the same content to a group of categories.

I know you can use templates to do this and this works fine, but I would like to use the same content for all underlying categories as well. And use different content for another top category and its underlying categories etc. etc.

Is there an easy way to do this, or do you have to edit each single category and specify the template.

Thanks for any help.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 17, 2005 - 6:16 PM:

Use conditionals, <IF {CATISBENETH[x]}>content</IF> where x is the category id number.
tfbpa
Beginner

Usergroup: Customer
Joined: Aug 20, 2004

Total Topics: 2
Total Comments: 9
tfbpa
Posted Mar 19, 2005 - 6:34 AM:

Thanks for that Paul, however it does not yet seem to work properly for me.

I am using the conditionals in the Wrapper and did as follows.

<IF {CATISBENETH[1]}>content 1</IF>
<IF {CATISBENETH[2]}>content 2</IF>
<IF {CATISBENETH[3]}>content 3</IF>

Now the categories beneath category 1 is showing content 1 + 2 +3.
Now the categories beneath category 2 is showing content 2 + 3.
Now the categories beneath category 3 is showing content 2 + 3.

Already tried adding <OTHERWISE> before </IF>, but this did't seem to help.

Must have done something wrong, just don't know what...
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 19, 2005 - 10:56 AM:

You haven't specified a version number. Also tell me what putting {CATISBENETH[1]} alone in a template shows (should be 1 or 0).

Edit: Just see scripts.webmastersite.net/w...inks/wsnmanual/articles/11 in the future, it appears I made a spelling error in this thread.
tfbpa
Beginner

Usergroup: Customer
Joined: Aug 20, 2004

Total Topics: 2
Total Comments: 9
tfbpa
Posted Mar 19, 2005 - 1:38 PM:

Sorry, version nr. is 3.12RC

Have tried the correct spelling, no changes, works the same.

If I only use <IF {CATISBENEATH[1]}>content</IF> it works like a charm. The specific content is only shown in that category and all of them below in the directory structure.
tfbpa
Beginner

Usergroup: Customer
Joined: Aug 20, 2004

Total Topics: 2
Total Comments: 9
tfbpa
Posted Mar 19, 2005 - 2:45 PM:

Just upgraded to 3.14 and all is working great with no changes being made!

Thanks for all the help!
tfbpa
Beginner

Usergroup: Customer
Joined: Aug 20, 2004

Total Topics: 2
Total Comments: 9
tfbpa
Posted Mar 19, 2005 - 3:06 PM:

Got another question..

Is it possible to exlude certain categories, so one of the categories beneath the one specified by <IF {CATISBENEATH[1]} is excluded.

Thanks.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted Mar 20, 2005 - 7:49 AM:

Just nest the conditionals:
<IF {CATISBENEATH[1]}>
<IF {CATID} is not 5>
stuff
</IF>
</IF>

(Might work with <IF {CATISBENEATH[1]} and {CATID} is not 5> too but long conditionals tend to be buggy.)
tfbpa
Beginner

Usergroup: Customer
Joined: Aug 20, 2004

Total Topics: 2
Total Comments: 9
tfbpa
Posted Mar 20, 2005 - 1:02 PM:

Again, works like a charm!
Hate to bother you again, but there is one last thing that is not quit working as it should...

It seems that the content, as specified by <IF {CATISBENEATH[1]}>, is also shown on the main page. I have tried to exclude it by using <IF {CATID} is not 0>, but that didn't help. Any ideas?
tfbpa
Beginner

Usergroup: Customer
Joined: Aug 20, 2004

Total Topics: 2
Total Comments: 9
tfbpa
#10 - Quote - Permalink
Posted Mar 20, 2005 - 1:30 PM:

Never mind my last post, messed something up myself....
All is working great!
capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
#11 - Quote - Permalink
Posted Aug 26, 2006 - 8:13 AM:

Paul is it possible to include in a future version another variable: CATISNOTBENEATH[x]??

Because I need to do the inverse... I don't want certain HTML to show up if its below a certain category....

Thanks
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#12 - Quote - Permalink
Posted Aug 26, 2006 - 3:54 PM:

Read the template conditionals article in the manual and you'll see that you can use "not" in order to show things where a variable is not true.
capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
#13 - Quote - Permalink
Posted Aug 26, 2006 - 5:58 PM:

as in <IF not {CATISBENEATH[1]}>show stuff</IF>?
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
#14 - Quote - Permalink
Posted Aug 27, 2006 - 5:00 PM:

Yes.
capitaine
Forum Regular

Usergroup: Customer
Joined: Aug 05, 2005

Total Topics: 94
Total Comments: 272
#15 - Quote - Permalink
Posted Aug 27, 2006 - 6:01 PM:

OK. one more Q: can I combine several categories into that statement:

<IF not {CATISBENEATH[1,10,27]}>show stuff</IF>

or something like that? Reason being that there is more than one category where the scenario I have applies....
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.