Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [Category:pop-up] Show Category clean in drop down

Quote Reply
Re: [Category:pop-up] Show Category clean in drop down In reply to
rajani,

I'm not quite sure I've properly understood you requirements, but you could write a sub-routine that would query your category table and get the sub-categories of the category you are currently in using a statement along these lines:

SELECT ID FROM Category WHERE Name LIKE '$value%'

You could pass the current category name to $value and it should bring back a list of ID's that are sub-categories of the category you are in. Once you've got the sub-cat ID's you can get the name and/or description and 'chop' out the current category name, e.g.;

/World
/World/Europe
/World/Europe/France
/World/Europe/Germany
/World/Europe/United Kingdom

If you select the sub-cat's of "/World/Europe" you would get:

/World/Europe/France
/World/Europe/Germany
/World/Europe/United Kingdom

... then just chop out the current category part "/World/Europe/" to end up with:

France
Germany
United Kingdom

... same with 'World':

Europe
Europe/France
Europe/Germany
Europe/United Kingdom

... if you want the results formatting before putting them in a select list use the existing sub, or create a new one. You might also want to pass the sub-cat's ID or Path into your select list to make sure Links knows which sub-cat it's dealing with, e.g.;

Code:
<SELECT>
<OPTION VALUE="$sub-catid">France
<OPTION VALUE="$sub-catpath">Germany
etc ...
</SELECT>
Hope this helps.


All the best
Shaun

Subject Author Views Date
Thread [Category:pop-up] Show Category clean in drop down dearnet 1726 Feb 21, 2001, 11:46 PM
Thread Re: [Category:pop-up] Show Category clean in drop down
Stealth 1642 Feb 22, 2001, 6:45 PM
Thread Re: [Category:pop-up] Show Category clean in drop down
dearnet 1639 Feb 23, 2001, 12:07 AM
Thread Re: [Category:pop-up] Show Category clean in drop down
qango 1663 Feb 23, 2001, 2:15 AM
Post Re: [Category:pop-up] Show Category clean in drop down
dearnet 1635 Feb 23, 2001, 5:22 AM