Closed (fixed)
Project:
Drigg
Version:
5.x-1.5
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Jan 2009 at 09:29 UTC
Updated:
21 Feb 2009 at 02:20 UTC
Hello,
I'm using subcategories this way (example)
- Engines
- Renault
- Ferrari
- Wheels
- Renault
- Ferrari
The problem is that Drigg creates the url to subcategories this way:
http://myhomepage.com/Renault
So, the url are the same if I use the same names for the subcategories, and it dosen't work.
Is there any way to set the paths to something like:
http://myhomepage.com/Engines/Renault
http://myhomepage.com/Wheels/Renault
Thank you in advance!
Comments
Comment #1
Javier López commentedUps, spaces were removed and I don't know how to edit the previous entry. Here it is the tree:
* Engines
- Renault
- Ferrari
* Wheels
- Renault
- Ferrari
Comment #2
mercmobily commentedHi,
There is no way for Drigg to have subcategories with the same name. This is pretty much a structural issue -- the category cache only stores the category name, plus too many other things would have to change and become 4x more complicated.
Sorry...
Merc.
Comment #3
mercmobily commentedComment #4
Javier López commented:(
Thanks for answer.
Any other way I can get this done? Maybe something similiar? It would be enough for me if I can make categories with different "safe name" and showing in the menu category names.
I mean, It would be enough If I can do this:
http://myhomepage.com/Engines/RenaultEngines
http://myhomepage.com/Wheels/RenaultWheels
And in then drawing in the menu something like:
* Engines
- Renault
* Wheels
- Renault
Is that possible? How can I achive that without having to make a big (and horrible) big "switch ()" from scratch.
Please, let me close this thread by my own, because I really had trouble to find it after you put it like "won't fix".
Comment #5
mercmobily commentedHi,
It's _impossible_ to have subcategories with the same name by design, unless you want to rewrite substantial and tricky parts of Drigg.
That's the hard truth... probably not what you want to hear, but that's how it is :-/
Merc.
Comment #6
Javier López commentedHehe, imposible is nothing :)
I "solved" it doing a trick.
For each term, I wrote the name I want to print on the webpage in the Description and letting the term name for the links different.
For example:
http://myhomepage.com/RenaultEngines (Term = RenaultEngines, Description = Renault)
http://myhomepage.com/RenaultWheels (Term = RenaultWheels , Description = Renault)
Then, when printing my menu, I just print not the term names, but the "Description", et voila:
* Engines
- Renault
* Wheels
- Renault
I wasn't able to have the proper urls, but I really needn't them.
Thank you very much!
Comment #7
mercmobily commentedHi,
I suggest you have an underscore in the category name, so that it becomes Renault_Wheels...
Are you sure there are no side effects..?
Merc.
Comment #8
Javier López commentedHi,
Telepaty! I have just added the "_" (for Seo) before reading your comment :)
About the side effects, there are some:
1) On node, when showing the category name for each entry, it was showing the one with underscore. I dind't achive to get the proper "description" term, because I didn't know how to get if from the node. So I just made another trick, this time I replace the underscores by spaces, and isolated the first word for knowing the section and the subscection:
Having the string "Renault_Engines", I created:
Section = Renault (http://myhomepage.com/Renault)
Subsection= RenaultEngines (http://myhomepage.com/RenaultEngines)
2) And another detail, when submitting the scoop, there is a "Please, select the category" list, that currently showes the category names with the underscores.
I'm currently working in:
a) Only allow the user to select subcategories, no categories.
b) Show the list without the underscores and with a tab for the subsection (currently they have "-", and is not enough in order to see them well)
I'm a bit lost on that points, because I don't know where, in the sourcecode, that list receives the "-" for the subsections.
Can you point in the right direction in order to accomplish points a) and b)? Thanks.
Comment #9
mercmobily commentedHi,
SOrry, I am really not sure about a) and b)...
Merc.
Comment #10
Javier López commentedDon't worry, I have already managed to have a) and b), I just hacked a bit into "taxonomy.module" and "form.inc". I used optgroups on the select, one for each category, so the user can only selects subcategories. It is shown with a tabulation too.
Everything about categores and subcategories with the same name works fine now :)
Comment #11
mercmobily commentedHi,
OK. WIll leave this issue here as "fixed" for future reference to others.
Merc