Categories with hierarchical structure?

Archived from the Library DB Discussion forum.

takezo — Tue Jun 12, 2007 5:30 am

I’m trying to use the great library db application for a catalog of different medias (books, dvds, links …). While looking on the demo I recognized, that there is only one hierarchy in the categories.

So I my question is: is it possible to create categories with subcategories? And if this feature is not implemented yet - is possible to create this feature?

THX for the help …


shannah — Tue Jun 12, 2007 12:30 pm

The library application currently does not support sub-categories.Ê It wouldn’t be difficult to add, however.Ê All that would be required is to add a ‘parent_id’ column to the categories table to track whether a category is a subcategory of another category - and re-jig a couple of things in the UI to make it work nicely with the multiple levels.Ê Hence it is quite possible that future versions would have this feature.

Best regards

Steve


sharonfdm — Wed Apr 07, 2010 8:44 am

hi i a not sure if there have been furture upgrades since this post was created… but i am wanting to add the sub categories.. now i have created a parent id for my main category but how and wherw exactly do i link this? and if there is an upgrade already where can i get it??

hope this makes sense. just pulling my hair here :S


shannah — Thu Apr 08, 2010 10:36 am

There is no update for subcategories at this time. It wouldn’t be tremendously difficult to add this functionality if you are comfortable with Xataface and its conventions.


sharonfdm — Fri Apr 09, 2010 6:45 am

oh ok??

so the comment above mine

All that would be required is to add a ‘parent_id’ column to the categories table to track whether a category is a subcategory of another category - and re-jig a couple of things in the UI to make it work nicely with the multiple levels
—–

is not as that simple?

i have done the parent_is column but just don’t know which file to “rejig” in order to show the link and categories [sub categories in the UI

please advise i know you are not supporting this app .. but it is truly a great application !

thanking you kindly


shannah — Fri Apr 09, 2010 6:52 am

The main changes will likely need to occur in the actions/browse_by_cat.php file. This is the action that shows the books by category.