Keyword

K2 item in Multiple Categories

More
13 years 8 months ago #79119 by Oceanwatcher
Replied by Oceanwatcher on topic K2 item in Multiple Categories
FidelGonzales:

As I am not a programmer, it is a little bit difficult for me to look at things deeper down, but I did a little experiment.

I have a couple of sites that run on WordPress, and in WP, you can easily add an article to as many categories as you want. So I checked the database.

In the wp_posts table, there is something about category, but it is not used. Instead, there are three tables

wp_terms
wp_term_relationships
wp_term_taxonomy

Checking these makes it clear that the terms are merely a form of tags that are grouped into different functions according to the taxonomy table (forgive me for describing this in laymans terms - non-programmer, remember? :-D ).

So depending on the taxonomy, a term can be either a "category", a "link_category" or a "post_tag".

I have no idea how big hit the database in WP takes by doing it this way, but it can not be too bad as WP runs with a lot of big sites...

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #79120 by krmr
Replied by krmr on topic K2 item in Multiple Categories
@Svein Wisnaes
Using tags to organise content is for sure lot more flexible, but there comes the tags view in k2, that is so much more limited than the catview. No author is displayed in tags view (the generic.php template) for example? And that is simply not acceptable in certain site formats. like a publication

Please Log in or Create an account to join the conversation.

  • kiril Hristov Yovev
  • kiril Hristov Yovev's Avatar
  • Offline
  • Junior Member
More
13 years 7 months ago #79121 by kiril Hristov Yovev
Replied by kiril Hristov Yovev on topic K2 item in Multiple Categories
with the component "Zoo" you can add item un multiple categories. I think that the k2 developers should do something about this... this is a must have feature... it is really really important. When few months ago i've opened new thread about this you've said to me that this problem is solved with the tags-but it's not the same. There are huge diferenses between tags and multiple categories... DOn't understand me wrong-i love k2.....but i really miss this great feature...

(SOrry for my bad english)

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #79122 by FidelGonzales
Replied by FidelGonzales on topic K2 item in Multiple Categories
You're English is good. And we understand your frustration. Zoo has its advantages but, after my limited testing, as a whole, it does not compare to the complete package K2 offers. Though, as you stated, perhaps one of the most intuitive and necessary functionality, multi-category publishing of a single item, does not exist in K2 but does in Zoo. I have much time and effort into K2, but I actually have tested Zoo to consider migrating to it due to this limitation in K2. I'm not hopping the fence anytime soon but am keeping an open mind. Thanks for your comments.

kiril Hristov Yovev said:with the component "Zoo" you can add item un multiple categories. I think that the k2 developers should do something about this... this is a must have feature... it is really really important. When few months ago i've opened new thread about this you've said to me that this problem is solved with the tags-but it's not the same. There are huge diferenses between tags and multiple categories... DOn't understand me wrong-i love k2.....but i really miss this great feature...
(SOrry for my bad english)

Please Log in or Create an account to join the conversation.

More
13 years 5 months ago #79123 by HankBrown
Replied by HankBrown on topic K2 item in Multiple Categories
Hello everyone ... I am currently keeping myself busy with K2 too and just as all the other here I am looking for multi-category publishing of a single item! However, during my research for a solution I came across a thread in people.joomla.org ... check it out: people.joomla.org/groups/viewdiscussion/112-Multiple+Categories+for+Items.html?groupid=47

Apparently this guy, named Jason Hart, did some work on an own MultiCat-solution for K2 already. Sure, it is only an Aplha-Version and only in combination with K2 v.2.2 but it might be a good start for a complete solution to our all problem ... don't you think so too? I am unfortunately not a professional progammer myself but maybe you guys or the people of the K2-development team can give this guy Jason Hart a hand in what he already has started ...

Here is his website with the current Alpha-Version of K2 MultiCat as download: www.developmii.com/downloads/k2-multicat.html

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #79124 by Tafadzwa Makura
Replied by Tafadzwa Makura on topic K2 item in Multiple Categories
I use tags! By giving tags similar names to categories and locking them so that the user cannot add their own custom tags I then allow users to add their article to one "primary" category in the category list and choose as many "category-tags" as they want in the tag list! This means that if a user/publisher publishes their article entitled "Major Health Issues Sportsman and Artists Face" and they want it to appear in the Health, Sports and Arts categories they will have to choose the primary category in the category list which in this case could be the Health category, this is where the article will be stored and linked to. If the user however adds the Sports, and Arts tags to their article the article will also appear in these categories as related items in the item layout of the Sports and Arts categories!

I haven't tried this though but i'm sure by adding the (Related Items by Tag) code block in the category list view i can also make all items that share one of their tags with the current Category appear in that Category's list! The major drawback is that users won't be able to user their own custom tags.

 

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #79125 by Tafadzwa Makura
Replied by Tafadzwa Makura on topic K2 item in Multiple Categories
In future K2 versions I think this can be easily achieved by employing the Primary and Secondary Category model as I mentioned in my previous post! What this will mean is that each item on creation will have a primary Category this is the "Host/Primary category" where the item will be stored and linked to! In addition an article could have a number of Secondary Categories much like a tag  but they will have similar names to existing categories since they will get their names from the k2 cartegories table this way they become dynamic. If a Primary Category is created then a Secondary Category is automatically created as well, when a Primary Category is deleted then the corresponding  Secondary Category is deleted as well. Users/Editor/Admin etc won't be allowed to add/edit/delete Secondary Category names directly this can only be done by adding/editing/deleting a Primary category.

 

After a user has created their item they choose the primary category they want their item to belong to, this is where the reference article can be stored. Just like tags a user can then add as many multiple Secondary Categories as they need. Secondary Categories only pull the refrence item directly  from it's primary Category without copying or moving it! If the Item is deleted from it's primary category then the Secondary categories will automatically stop linking to it because it disappears with its stored secondary Category (just like tags). 

 

In the category list  a php script will fetch the value of the current primary category title lets call it ($currentPrimCatTitle) and then pull any other items whose secondary category title ($item->secCatTitle ) matches ($currentPrimCatTitle). These articles will then be displayed in the cartegory list with all the other articles that share that Category. This system already works with tags I'm sure it will be much easier to intergrate. 

 

Advantages. 

1.) Only one copy of an item will be used to create multiple instances of it in different cartegories. 

2.) The creation/deletion and edition of Secondary Categories will happen dynamically making sure they remain synced with their Primary Category Counterparts and reducing the workload on the users part.

3.) No additional Data is written to the Database outside the item's database row when an item is added! 

4.) The system is intuitive, meaning a user/editor/admin can easily add and remove  Secondary Categories from their current item.

5.) Changing an item's Primary Category will not break it's connection with it's current Secondary  Categories (Just like Tags)

6.) Parameters and ACL can also be used to block specific Secondary Categories from being attached to a none Admin User's Item i.e (FAQ and Admin Secondary Categories will not be added to to a None Admin Item)  

 

If used please credit this idea/concept to me! 


Tafadzwa Makura said:

I use tags! By giving tags similar names to categories and locking them so that the user cannot add their own custom tags I then allow users to add their article to one "primary" category in the category list and choose as many "category-tags" as they want in the tag list! This means that if a user/publisher publishes their article entitled "Major Health Issues Sportsman and Artists Face" and they want it to appear in the Health, Sports and Arts categories they will have to choose the primary category in the category list which in this case could be the Health category, this is where the article will be stored and linked to. If the user however adds the Sports, and Arts tags to their article the article will also appear in these categories as related items in the item layout of the Sports and Arts categories!
I haven't tried this though but i'm sure by adding the (Related Items by Tag) code block in the category list view i can also make all items that share one of their tags with the current Category appear in that Category's list! The major drawback is that users won't be able to user their own custom tags.

 

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #79126 by Tafadzwa Makura
Replied by Tafadzwa Makura on topic K2 item in Multiple Categories
You can achieve category images, descriptions, etc. by calling the relevant tags in the category view instead of viewing them in the tag list. What this means is that your related by tag articles will appear below the actual articles in the category view including category images, descriptions, etc. Since all changes are made in the custom template folder there is no hacking involved!

Please Log in or Create an account to join the conversation.

More
13 years 1 month ago #79127 by Nick
Replied by Nick on topic K2 item in Multiple Categories
use an xref table. Easy. That way you can link multiple categories to 1 item id. Or you can go the cheap way and store all the categories inside a new row and have php then parse out the id's. This can be done with explode() and implode()

As for the back end you can have a new drop down appear after you select a category. I have over 200 categories so a tag based system or a simple list system wouldn't work for me (unless the list is inside a frame)

It's really not hard to do guys.. I could code it in several days.. i'm just working on college stuff right now.

Please Log in or Create an account to join the conversation.

More
13 years 2 weeks ago #79128 by juju
Replied by juju on topic K2 item in Multiple Categories
Nick : If you could do that, it will be really great, and I think it should be integrated to the next version of K2....

 

Thanks ;)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum