Gossamer Forum
Home : Products : Gossamer Links : Discussions :

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

Quote Reply
[Category:pop-up] Show Category clean in drop down
Hello!

Would this be a possibility to achieve as follows:

If the Category tree is as follows:

In the popdown menu-----------------
Europe
Europe/Germany
Europe/Germany/Berlin

This will show three categories in the drop down as above. What I am looking for the possibilitiy is as follow:

Europe on the main page and then on every page

Germany

and then on each page

Europe:Germany

In the popdown menu-----------------
............Berlin
............Munich
............Hamburg


This means one could show only the sub_category in the pop up menu and not the entire branch to which it belongs. This one could show on the webpage.

Would a tweak possible on this?

Thanks




Quote Reply
Re: [Category:pop-up] Show Category clean in drop down In reply to
You could use split codes to split the slashes.

Regards,

Eliot Lee
Quote Reply
Re: [Category:pop-up] Show Category clean in drop down In reply to
Hello Eliot!

Oh, thanks.

I will have to dig out where are the split codes since I am now a novice to version 2.0.2 and its a total new programming world of sub_routines.

But even if the split codes are used, I think what you mean is that it will be able to seperate the slashes and display with a seperator like

Europe : Germany : Berlin

in the earlier versions.

What I want is the lowest sub category LISTING ONLY to appear in the popup for the add or modify.cgi

A big dis-advantage is Links SQL is that all the Categories/SubCategories are being captured at once. That is everywhere many sub_routines capture all the categories at the same time and there is nothing in the inner core of the programming anywhere that allows the add.cgi, modify.cgi or build.cgi to go through a loop of alphabetical selection or any kind.

If there was, then one could take steps one, two or three in their submissions throu add.cgi so that a GIANT Category listing is not displayed. The Links SQL has still a nightmare in built. If you have 5000 categories with their sub_categories that the pup-up listing in the user/admin will be a GIANT CATEGORY LISTING. I have been complaining this from the begining and am not aware of anything now with the new version if this would be possible through some tweaks. Hence the question and I hope I made myself clear to what I am seraching for. This would ofcourse all the users who have more than a Hundred categories that their popup menu will get smaller.

That also means a Category pre-selection. If you have a Fifty Main Category with a Hundred Sub_Category in each of them then the total would be Five_Thousand Categories in the Listings. By selection of the Main Categories FIRST, one gets only a Hundred categories in the pop-up everywhere.

Would this be possible?

Thanks in advance.

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

Quote Reply
Re: [Category:pop-up] Show Category clean in drop down In reply to
Hello Shaun!

You not only PERFECTLY understaood what I was searching for but went beyond as to if this then how could it be done better and where!!!

Unfortunately I am not a programmer and cannot write sub_routines. That means my knowledge has only chmod 666 permission that does not incllude write by the owner self but read only permissions. I can read perl scripts not not write them!!! Joking.

What I fail is that why NO ONE is thinking on it to develop this sub_routines. Alex or someone else may want this as a really smart plugin as a top priority as this would affect entire users community using Links SQL because this will help everyone to reduce and cut down the category pop-ups by the division of the number of their Main Categories.