Sub-categories - a must
- ccondrup
- Joomla! Enthusiast
- Posts: 219
- Joined: Tue Aug 23, 2005 9:54 am
- Location: Oslo
Re: Sub-categories - a must
I know, just expressing my view on it, and hopefully repeat some valid points as to why it is important.
What I think was not so clear: Yes, it's on the roadmap, no it will not be soon. Ok, but I want a quick and dirty hack in the meantime! Is it really that hard to put in one or two extra subcategories? Hardcoded if need to, just more than the two limiting levels
What I think was not so clear: Yes, it's on the roadmap, no it will not be soon. Ok, but I want a quick and dirty hack in the meantime! Is it really that hard to put in one or two extra subcategories? Hardcoded if need to, just more than the two limiting levels
Did you know there's a Joomla irc channel? Chat to Joomla people live 24/7 - Join #joomla on the Freenode network ( irc.freenode.net )
-
- Joomla! Fledgling
- Posts: 3
- Joined: Tue Dec 13, 2005 9:03 pm
Re: Sub-categories - a must
I'm sure thet in Joomla 2 will be released simple categorization system.
To start to change it is necessary already from version 1.x As these changes are very necessary all and are expected. (Respect to ccondrup)
Up to version 2 will be time and an opportunity diagnostic.
Otherwise Joomla will be remains CSM for one-page-sites!
To start to change it is necessary already from version 1.x As these changes are very necessary all and are expected. (Respect to ccondrup)
Up to version 2 will be time and an opportunity diagnostic.
Otherwise Joomla will be remains CSM for one-page-sites!
- louis.landry
- Joomla! Ace
- Posts: 1380
- Joined: Wed Aug 17, 2005 11:03 pm
- Location: San Jose, California
- Contact:
Re: Sub-categories - a must
It is coming guys, just not this round.
Louis
Louis
Joomla Platform Maintainer
A hacker does for love what others would not do for money.
A hacker does for love what others would not do for money.
-
- Joomla! Fledgling
- Posts: 2
- Joined: Fri Dec 16, 2005 3:44 pm
Re: Sub-categories - a must
While waiting of categories of catergories, what do you think of the following workaround :
- create a section of all "parent" categories and another one of containing all sub-categories
- link by name a sub-category to its parent category via a parameter (for example : by entering PARENT_CATEGORY=the parent categroy name in the params column of the category table)
- write a php program to generate whatever you need by exploring the category table
This strategy can be applied endlessly.
Could someone experienced in Jommla comment this workaround ?
Thank you.
- create a section of all "parent" categories and another one of containing all sub-categories
- link by name a sub-category to its parent category via a parameter (for example : by entering PARENT_CATEGORY=the parent categroy name in the params column of the category table)
- write a php program to generate whatever you need by exploring the category table
This strategy can be applied endlessly.
Could someone experienced in Jommla comment this workaround ?
Thank you.
- louis.landry
- Joomla! Ace
- Posts: 1380
- Joined: Wed Aug 17, 2005 11:03 pm
- Location: San Jose, California
- Contact:
Re: Sub-categories - a must
I think it is concievable for someone to write a custom content component to achieve whatever functionality they wanted. That being said, here are some of my views on it. The core content component needs to be completely reworked... But what i think everyone needs to understand is that the overall application needed to be reworked and cleaned up. If the team had completely reworked the content component before now, they would have been reworking it towards and API that was certainly going to change. Now that the groundwork has been laid down for a new, more object-oriented, efficient application framework the reworking of the content component can be redone without doubling the work.
Good things are coming...
Louis
Good things are coming...
Louis
Joomla Platform Maintainer
A hacker does for love what others would not do for money.
A hacker does for love what others would not do for money.
-
- Joomla! Enthusiast
- Posts: 143
- Joined: Thu Aug 25, 2005 8:20 pm
Re: Sub-categories - a must
Hi all,
Since i could not wait for this major improvement to be made at a core level, i've decided to take a chance on a very neat hack called MultiCategories:
http://mamboforge.net/frs/?group_id=344&release_id=3609
It forced me to fallback to MOS 4.5.1, but so far it is behaving excellently in a brand new portal featuring dozens of Subcategories.
Before taking on this hack, i have tried several approaches to content organization. However, none suited the classical 2 levels depth Joomla/mambo provides by default.
I have also tried to reach the developer in order to ask for a possible upgrade to his code (i am not a PHP programmer). Until now he did not answer.
if anyone wants to make this transitional solution Joomla-compatible, we all would benefit from such effort.
hope someone finds this post handy.
Cheers,
Ljv.
Since i could not wait for this major improvement to be made at a core level, i've decided to take a chance on a very neat hack called MultiCategories:
http://mamboforge.net/frs/?group_id=344&release_id=3609
It forced me to fallback to MOS 4.5.1, but so far it is behaving excellently in a brand new portal featuring dozens of Subcategories.
Before taking on this hack, i have tried several approaches to content organization. However, none suited the classical 2 levels depth Joomla/mambo provides by default.
I have also tried to reach the developer in order to ask for a possible upgrade to his code (i am not a PHP programmer). Until now he did not answer.
if anyone wants to make this transitional solution Joomla-compatible, we all would benefit from such effort.
hope someone finds this post handy.
Cheers,
Ljv.
-
- Joomla! Enthusiast
- Posts: 149
- Joined: Sun Nov 27, 2005 11:27 am
- Contact:
Re: Sub-categories - a must
Sounds very interesting... :P
Having it J compatible would be great while waiting for this feature to be core implemented (I think maybe in one year or more).
Having it J compatible would be great while waiting for this feature to be core implemented (I think maybe in one year or more).
-
- Joomla! Apprentice
- Posts: 23
- Joined: Mon Oct 17, 2005 2:07 pm
Re: Sub-categories - a must
I'm desperatly needing this function so I'll give it a shot to port it to joomla. It appears to not touch the datamodel, so it shouldn't be too hard. No promises, but I'll keep you posted
-
- Joomla! Apprentice
- Posts: 23
- Joined: Mon Oct 17, 2005 2:07 pm
Re: Sub-categories - a must
Hm it does modify the datamodel in a rather nasty way; DROP TABLE IF EXISTS `#__content` and some more table drops. So if I get it working it'll not be for the light hearted.
- louis.landry
- Joomla! Ace
- Posts: 1380
- Joined: Wed Aug 17, 2005 11:03 pm
- Location: San Jose, California
- Contact:
Re: Sub-categories - a must
you shouldn't have to... the current category table has a field for parentid ... thats all that should really be necessary. If it requires more fields then do a table ALTER command instead of dropping and re-creating.
Louis
Louis
Joomla Platform Maintainer
A hacker does for love what others would not do for money.
A hacker does for love what others would not do for money.
-
- Joomla! Enthusiast
- Posts: 143
- Joined: Thu Aug 25, 2005 8:20 pm
Re: Sub-categories - a must
Could you please elaborate a bit more on this topic?webImagery wrote: you shouldn't have to... the current category table has a field for parentid ... thats all that should really be necessary. If it requires more fields then do a table ALTER command instead of dropping and re-creating.
Louis
If such field is already present in the table structure, how can i possibly enable it? Does it require any deep hacking, like the one behind MultiCategories?
Ljv.
- Hackwar
- Joomla! Virtuoso
- Posts: 3788
- Joined: Fri Sep 16, 2005 8:41 pm
- Location: NRW - Germany
- Contact:
Re: Sub-categories - a must
He means that there is allready a field, but nothing else. Using that field, having any logic that enables multicategorie systems, is not implemented. You would have to create everything more or less from scratch.
god doesn't play dice with the universe. not after that drunken night with the devil where he lost classical mechanics in a game of craps.
Since the creation of the Internet, the Earth's rotation has been fueled, primarily, by the collective spinning of English teachers in their graves.
Since the creation of the Internet, the Earth's rotation has been fueled, primarily, by the collective spinning of English teachers in their graves.
- louis.landry
- Joomla! Ace
- Posts: 1380
- Joined: Wed Aug 17, 2005 11:03 pm
- Location: San Jose, California
- Contact:
Re: Sub-categories - a must
You would still have to rework the content component, all i meant was that if you are going to create a tree structure (unlimited categories) in the database, you really shouldn't need to change the database to achieve this since a field already exists (that isn't being used yet) for a parent category id. And more importantly... if you wanted to make changes in a core table, i would suggest using an ALTER table query rather than a drop and create sequence. (though i must say altering core tables is probably not a good idea).
Louis
Louis
Joomla Platform Maintainer
A hacker does for love what others would not do for money.
A hacker does for love what others would not do for money.
-
- Joomla! Apprentice
- Posts: 23
- Joined: Mon Oct 17, 2005 2:07 pm
Re: Sub-categories - a must
I'm very much aware that altering core table isn't a good idea, but like I said I am rather desperate . It's good to know that in principle it can be done without altering core tables, so I'll try. The multicategory hacks com_content, com_category the administrator versions of them and includes/mambo.php
A question out of curiousity; it is said that it is hard to implement multicategory in joomla and that it probably will be postponed until after 1.1. But what is the real hard part? (so I know what I'm up against) I've obviously an easier task then the joomla hackers since I have a limited set of functionality that has to work with multi-category.
A question out of curiousity; it is said that it is hard to implement multicategory in joomla and that it probably will be postponed until after 1.1. But what is the real hard part? (so I know what I'm up against) I've obviously an easier task then the joomla hackers since I have a limited set of functionality that has to work with multi-category.
- Tonie
- Joomla! Master
- Posts: 16553
- Joined: Thu Aug 18, 2005 7:13 am
Re: Sub-categories - a must
As far as I can tell, backwards compatibility is the biggest problem. Changing to a node based system will probably break the currently used structure.
- Hackwar
- Joomla! Virtuoso
- Posts: 3788
- Joined: Fri Sep 16, 2005 8:41 pm
- Location: NRW - Germany
- Contact:
Re: Sub-categories - a must
The goal would also be to have a sturcture that works for all. Something where you can fit every content into. My idea of this is a node or tree structure that allows to sort the frontpage as a content item into the structure as you would be able to put a gallery into it. To have this overall structure instead of every component doing its own thing is the hard work.
My 0.02 $
My 0.02 $
god doesn't play dice with the universe. not after that drunken night with the devil where he lost classical mechanics in a game of craps.
Since the creation of the Internet, the Earth's rotation has been fueled, primarily, by the collective spinning of English teachers in their graves.
Since the creation of the Internet, the Earth's rotation has been fueled, primarily, by the collective spinning of English teachers in their graves.
-
- Joomla! Apprentice
- Posts: 23
- Joined: Mon Oct 17, 2005 2:07 pm
Re: Sub-categories - a must
Very well, no need to alter any table indeed. I did a diff on mambo 4.5.1 and it turns out that there are only 7 files modified. I dropped those in a fresh 4.5.1 install and it worked without a problem.
Now I've dropped those in a fresh joomla 1.0.5 install and it looks promissing, some new functions of joomla are not working (hidemainmenu being one) but it does seem to have multi category now. Working to straight out the big bugs and then I'll release a first alpha on the hack.
Now I've dropped those in a fresh joomla 1.0.5 install and it looks promissing, some new functions of joomla are not working (hidemainmenu being one) but it does seem to have multi category now. Working to straight out the big bugs and then I'll release a first alpha on the hack.
Re: Sub-categories - a must
stvn, yes, please do keep us updated, this sounds promising!
Does your solution also allow items to be placed at any levels of the section/category structure?
Does your solution also allow items to be associated to more than one category?
[me=vavroom]very interested[/me]
Does your solution also allow items to be placed at any levels of the section/category structure?
Does your solution also allow items to be associated to more than one category?
[me=vavroom]very interested[/me]
-
- Joomla! Apprentice
- Posts: 23
- Joined: Mon Oct 17, 2005 2:07 pm
Re: Sub-categories - a must
jay it is working
The original version made a tree overview of the category structure in a drop down list, which makes a poor overview button So I've moved it to a column left to the list of content items.
It however does not supported multiple categories per content item, nor does it show the sub categories in the main admin menu.
A screen shot of the current version:
The original version made a tree overview of the category structure in a drop down list, which makes a poor overview button So I've moved it to a column left to the list of content items.
It however does not supported multiple categories per content item, nor does it show the sub categories in the main admin menu.
A screen shot of the current version:
Last edited by stvn on Fri Jan 06, 2006 8:56 am, edited 1 time in total.
Re: Sub-categories - a must
Ahh. Too bad. THat's really the functionality I need. I can generally happily work and setup site structure in the section/category/item constraint, but mirroring content in several categories would be cool.stvn wrote: It however does not supported multiple categories per content item
Thanks for the work on this.
-
- Joomla! Enthusiast
- Posts: 143
- Joined: Thu Aug 25, 2005 8:20 pm
Re: Sub-categories - a must
stvn, if you succeed in porting that multicategories hack to joomla, please publish the modified files together with installation notes.
what you have done so far already adresses some of my concerns
thanks for your work on this subject.
Ljv.
what you have done so far already adresses some of my concerns
thanks for your work on this subject.
Ljv.
-
- Joomla! Apprentice
- Posts: 23
- Joined: Mon Oct 17, 2005 2:07 pm
Re: Sub-categories - a must
First release.
I've put version 0.01 online here http://jana.geodan.nl/steveno/SubcatJoomla.zip be aware that this is an alpha release and it comes with no garanties. I've got it succesfully running on a fresh and empty joomla 1.0.5 setup. It is probably full of bugs and might break your site, although I believe as long as you have a decent backup of your site nothing really evil can happen.
I'm away for the weekend so don't expect any answers from me for the next couple of days. I've left my contact info in the readme included in the archive. Have fun with it.
I've put version 0.01 online here http://jana.geodan.nl/steveno/SubcatJoomla.zip be aware that this is an alpha release and it comes with no garanties. I've got it succesfully running on a fresh and empty joomla 1.0.5 setup. It is probably full of bugs and might break your site, although I believe as long as you have a decent backup of your site nothing really evil can happen.
I'm away for the weekend so don't expect any answers from me for the next couple of days. I've left my contact info in the readme included in the archive. Have fun with it.
-
- Joomla! Intern
- Posts: 65
- Joined: Mon Aug 22, 2005 10:02 pm
Re: Sub-categories - a must
sorry if this question sounds really stupid but i've only had a quick skim through the topic so:
Can this above component allow you to add one news story to multiple categories?
Can this above component allow you to add one news story to multiple categories?
-
- Joomla! Enthusiast
- Posts: 143
- Joined: Thu Aug 25, 2005 8:20 pm
Re: Sub-categories - a must
No way.w1x wrote: sorry if this question sounds really stupid but i've only had a quick skim through the topic so:
Can this above component allow you to add one news story to multiple categories?
This is not even a component but a provisional workaround.
I have also to report that i have tested the new J!1.0.5 port on a fresh install and it doesn't seem to work at all.
The category creation page does not display the extra field which would allow to put it in a hierarchy tree.
Ljv.
-
- Joomla! Apprentice
- Posts: 23
- Joined: Mon Oct 17, 2005 2:07 pm
Re: Sub-categories - a must
New version at the same place, there were indeed some issues about the last release. I tested it on both a clean 1.0.4 and 1.0.5 by just copying the files to the joomla directory. It works for me.
To create a hierarchy tree you need to use the Parent Category field in category creation
Question for the moderaters: should I take this discussion somewhere else, and if so where?
To create a hierarchy tree you need to use the Parent Category field in category creation
Question for the moderaters: should I take this discussion somewhere else, and if so where?
-
- Joomla! Enthusiast
- Posts: 143
- Joined: Thu Aug 25, 2005 8:20 pm
Re: Sub-categories - a must
Your 1st ultra-early alpha had a misnamed folder, that is why i couldn't see any changestvn wrote: New version at the same place, there were indeed some issues about the last release. I tested it on both a clean 1.0.4 and 1.0.5 by just copying the files to the joomla directory. It works for me.
Thanks a lot for porting this goodie to J!, btw.
I definitely think this thread should be given more visibility, due to the massive request of sub/multicategories. This small fix already adress some issues many folks out there are desperatly seeking for.
LJv.
PS: I finally got rid of mambo 451 thanks to this enhancement
-
- Joomla! Apprentice
- Posts: 23
- Joined: Mon Oct 17, 2005 2:07 pm
Re: Sub-categories - a must
I found out that I want to allow items to be associated to more than one category as well. This does require a change in the datamodel I think, but looking at it made me think that it is a very minor one:
If I would use the catid field in a content item as a key to a link table which links the content item to categories I would be done right? I need to change a lot of SQL select statements to allow for the new join and I probably need to modify the interface as well. But it sounds doable.
Am I right in assuming that this is all that needs to be done, or am I forgetting something.
note that I don't need any backwards compatibility, nor should non core joomla modules and components work. It is of course desirable if that would be the case though.
If I would use the catid field in a content item as a key to a link table which links the content item to categories I would be done right? I need to change a lot of SQL select statements to allow for the new join and I probably need to modify the interface as well. But it sounds doable.
Am I right in assuming that this is all that needs to be done, or am I forgetting something.
note that I don't need any backwards compatibility, nor should non core joomla modules and components work. It is of course desirable if that would be the case though.
-
- Joomla! Apprentice
- Posts: 23
- Joined: Mon Oct 17, 2005 2:07 pm
multple categories per item
I've got the first phase of multiple categories per item working
I've added a new table #__content_categories which is a table that has the fields categoryid and contentid. There I can map the many-to-many relations.
I modified the SQL statement in showBlogCategory to include: cc.id AS catid and
. "\n LEFT JOIN #__content_categories AS jcc ON a.id = jcc.contentid"
. "\n LEFT JOIN jos_categories AS cc ON cc.id = jcc.categoryid"
Finally I modifed the function _where so that it becomes: $where[] = "cc.id IN ( $id ) ";
This modifications are only in /components/com_content/content.php
The result of this is that index.php?option=com_content&task=blogcategory&id=16&Itemid=29
and index.php?option=com_content&task=blogcategory&id=17&Itemid=29 both show the item that is in category 16 and 17, but the one that is only in 17 shows up only in 17
I've added a new table #__content_categories which is a table that has the fields categoryid and contentid. There I can map the many-to-many relations.
I modified the SQL statement in showBlogCategory to include: cc.id AS catid and
. "\n LEFT JOIN #__content_categories AS jcc ON a.id = jcc.contentid"
. "\n LEFT JOIN jos_categories AS cc ON cc.id = jcc.categoryid"
Finally I modifed the function _where so that it becomes: $where[] = "cc.id IN ( $id ) ";
This modifications are only in /components/com_content/content.php
The result of this is that index.php?option=com_content&task=blogcategory&id=16&Itemid=29
and index.php?option=com_content&task=blogcategory&id=17&Itemid=29 both show the item that is in category 16 and 17, but the one that is only in 17 shows up only in 17
-
- Joomla! Enthusiast
- Posts: 143
- Joined: Thu Aug 25, 2005 8:20 pm
Re: Sub-categories - a must
stvn,
Congratulations!
i have a PROFOUND interest in your research work. If you can publish a min howto on your latest discoveries, it'd be more than welcome.
the COMMUNITY shall definitely focus more on this CORE functionality.
cheers and keep on the excellent job.
Ljv.
Congratulations!
i have a PROFOUND interest in your research work. If you can publish a min howto on your latest discoveries, it'd be more than welcome.
the COMMUNITY shall definitely focus more on this CORE functionality.
cheers and keep on the excellent job.
Ljv.
-
- Joomla! Apprentice
- Posts: 23
- Joined: Mon Oct 17, 2005 2:07 pm
Re: Sub-categories - a must
Right now it involves quite some handwork, I've yet to think of a nice backend/administration interface and an SQL statement to install the new table and fill it with the current information on content/category linking.
But like I said the following steps have to be done to get it working on the frontpage:
Create a new table in the database #__content_categories (#_ being your prefix, usually jos):
CREATE TABLE `jos_content_categories` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
`contentid` INT UNSIGNED NOT NULL ,
`categoryid` INT UNSIGNED NOT NULL ,
PRIMARY KEY ( `id` )
) TYPE = MYISAM ;
Fill the table by hand to get your content items and categories combined, i know need to get that in the admin tool
And apply the attached patch on my modified /components/com_content/content.php
This patch is solely meant for people who want to help develop this functionality, it's not nearly finished and totally unfit for production or even development environments where anything other than this functionality is being developed. It probably breaks about everything that I have not yet tested (which is a lot) and it is not nearly finished. Once I have the backend and administration issues sorted out I'll post an official alpha release.
But like I said the following steps have to be done to get it working on the frontpage:
Create a new table in the database #__content_categories (#_ being your prefix, usually jos):
CREATE TABLE `jos_content_categories` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
`contentid` INT UNSIGNED NOT NULL ,
`categoryid` INT UNSIGNED NOT NULL ,
PRIMARY KEY ( `id` )
) TYPE = MYISAM ;
Fill the table by hand to get your content items and categories combined, i know need to get that in the admin tool
And apply the attached patch on my modified /components/com_content/content.php
This patch is solely meant for people who want to help develop this functionality, it's not nearly finished and totally unfit for production or even development environments where anything other than this functionality is being developed. It probably breaks about everything that I have not yet tested (which is a lot) and it is not nearly finished. Once I have the backend and administration issues sorted out I'll post an official alpha release.
You do not have the required permissions to view the files attached to this post.
Last edited by stvn on Wed Jan 11, 2006 1:47 pm, edited 1 time in total.