Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Re: Template2 - Different Category Templates Mod

Quote Reply
Re: Template2 - Different Category Templates Mod In reply to
I had thought about this... basically you'd want a category to default to lowest-level custom template above it.

For instance, if you have 10 categories on the main table, for ease of thought, we'll call them 1-10, you'd want every addition to every subcategory in the tree below the #1 category for example, to use the #1 custom template, or use the default if none was defined.

If you had a category #1-#1.1-#1.1.2, you'd want #1.1.2 to first check _it's_ parent node, #1.1 for a custom template, and if it finds one, use that as the 'default'. If it doesn't, it works it's way up the tree to the #1 category, and if that has a custom template uses that, if not use default.

For instance, if you had a category Computers, and three subcategories :Mac,PC,Other, you'd want to assign a default "Computers.html" template to the category Computers. Then you'd want to assign a default template Computers_Mac.html to the Mac topic, and Computers_PC.html to the PC category. Other, would default to the default Computers.html template. If you added a category Mac/iBook, the iBook would _default_ to the Computers_Mac.html template, since that was the closest (lowest level assignment) to it.

Make sense?

This will be easier in the next release, since you'll be able to know who is the parent.

To get to your specific question, you'd want to use a pattern to grab the top level category out of the Title of the category you are entering (up the first \)(you could use split, as a dirty quick hack), then use that to do an exact match on the Category table, get the record that matches, (the top level category) and assign the Custom_Template of the new record, to be the same as the Custom_Template of the record you just searched for.

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Subject Author Views Date
Thread Template2 - Different Category Templates Mod CyberLuke 10955 Oct 2, 2000, 11:35 AM
Thread Re: Template2 - Different Category Templates Mod
pugdog 10794 Oct 2, 2000, 11:51 AM
Thread Re: Template2 - Different Category Templates Mod
CyberLuke 10782 Oct 2, 2000, 12:51 PM
Thread Re: Template2 - Different Category Templates Mod
lparry 10778 Oct 2, 2000, 10:08 PM
Thread Re: Template2 - Different Category Templates Mod
pugdog 10777 Oct 3, 2000, 9:41 AM
Thread Re: Template2 - Different Category Templates Mod
RWhite 10687 Oct 10, 2000, 8:22 PM
Thread Re: Template2 - Different Category Templates Mod
Stealth 10712 Oct 10, 2000, 8:42 PM
Thread Re: Template2 - Different Category Templates Mod
RWhite 10688 Oct 10, 2000, 9:20 PM
Thread Re: Template2 - Different Category Templates Mod
Stealth 10686 Oct 10, 2000, 9:29 PM
Thread Re: Template2 - Different Category Templates Mod
RWhite 10694 Oct 10, 2000, 9:38 PM
Post Re: Template2 - Different Category Templates Mod
Stealth 10678 Oct 10, 2000, 9:39 PM
Thread Re: Template2 - Different Category Templates Mod
RWhite 10656 Oct 11, 2000, 8:57 AM
Thread Re: Template2 - Different Category Templates Mod
pugdog 10672 Oct 11, 2000, 9:53 AM
Post Re: Template2 - Different Category Templates Mod
RWhite 10647 Oct 11, 2000, 11:46 AM
Thread Re: Template2 - Different Category Templates Mod
campos 10639 Oct 13, 2000, 9:32 AM
Thread Re: Template2 - Different Category Templates Mod
pugdog 10647 Oct 13, 2000, 9:41 AM
Thread Re: Template2 - Different Category Templates Mod
campos 10625 Oct 13, 2000, 10:28 AM
Post Re: Template2 - Different Category Templates Mod
campos 10620 Oct 13, 2000, 10:30 AM
Post Re: Template2 - Different Category Templates Mod
pugdog 10636 Oct 13, 2000, 10:42 AM