Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

Multilpe Categories for a discussion

Hi I need ti link multiple categories with a discussion. I know this can be achieved by tags but i don't want to use tags for this purpose. Howe= we can achieve this?

Comments

  • well you are mixing two different concept.

    Categorises are strictly hierarchical and and discussion has one category.

    Tags are exactly what you looking for. It is a question of how you present.

    grep is your friend.

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    From the UX side this is ridiculous. Users do not expect identical content in multiple categories. No forum that I know is doing that. And I do not mean no forum software, but I really mean: no forum.

    So all over the net you will not find such a behavior. Therefore I bet your users wouldn't be happy, but only confused.

    Rethink your plans. If it is a customer who insists on this, make him rethink his plans. Tell him it will make the costs explode since you basically have to rewrite much of the permission functions, and I would bet that performance would suffer, too.

  • sparrowhawk66sparrowhawk66 Kraków New

    @sainiajayDaffodil 's idea probably derives from a WordPress background. It is possible to attribute a post to several categories. It may be justifiable in some rare cases, but the practical results are very poor. I am administering a WordPress site and one of my worst chores is correcting and removing redundant category attributions. Even professional IT people think they will make their post more important when attributed to multiple categories. It's a very bad mistake which renders the idea of categories useless. Another bad mistake is attributing your posts to the uncategorized category — the end result is the same: your site becomes another Facebook. All in all it is therefore very fortunate that Vanilla allows to put a post only under one category.

  • Thanks @R_J @sparrowhawk66 for your feedback, but that's the part of our requirements, So we will use tag for that purpose.

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    I don't know the rationale for the requirements but working with vanilla in our intranet I have been exposed to some unusual requirements myself. More to your request - there's a move discussion functionality that has the option of leaving a link to the moved discussion in the new category. In theory one could use that to code a similar (but not the same) functionality that creates links in every category (except the original) that a discussion also "exists" while ensuring that only one actual discussion exists. It would require serious plugin work as well as admin discipline in managing the permissions across the set of categories.

    I'm not recommending doing it, just doing a thought experiment about how I'd do it if I had to.

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    @rbrahmson Thinking about problems that I'm lucky I never have is something I like to do, too =)

    In order to be able to do that, this information needs to be stored somewhere. What about a MyBossMadeMeDoIt table with columns DiscussionID and CategoryID?

    Every discussion with more than one category must have additional entries for the 2., 3. etc. discussion in that MBMMDI table.

    The DiscussionModels BeforeGet event can be used for adding those information. Lots of pseudo code following here...

    public function discussionModel_beforeGet_handler($sender, $args) {
        // Those are the categories that will be used to fetch discussions.
        $currentCategoryIDs = $args['Wheres']['d.CategoryID'];
    
        // Although this is a security nightmare, we can at least try to make it better
        $perms = $sender->categoryPermissions();
    
        // Get that discussio ids
        $mostProbablyProblemCausingDiscussions = "SELECT DISTINCT DiscussionID FROM MBMMDI WHERE Category IN $currentCategoryIDs AND CategoryID IN $perms";
    
        // Modify the SQL to show not only discussions from previously looked up categories, but also from the discussions with the given IDs.
        // If another plugin added a SQL "AND" to that query, we are seriously fucking up the query with this "OR" condition, though.
        $sender->SQL->orWhereIn('DiscussionID', $mostProbablyProblemCausingDiscussions);
    }
    

    But it's nearly guaranteed to show lots of funny side effects :mrgreen:

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    My approach was a bit different -- let the original discussion be saved where it is being created and use the posting/saving hook to create the shortcuts in the other categories. There is of course delete-cleanup to do, permissions, search impact, archive considerations, etc. As you say, lots of side effects. Enough said;-)

Sign In or Register to comment.