Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Hidding a catagory

Hey, how do I fully hide all discussions from one catagory from the All Discussions page?

Answers

  • 422422 Developer MVP

    If you know the id, eg #bob

    In css you could do #bob {display:none;}

    There was an error rendering this rich post.

  • are you hiding it because you only want certain viewers to see it.
    if so you can set custom permission for the category in the dashboard for example and only let moderators view it.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • No, I would still like everyone to see it, but the discussions made in that catagory can only be seen by clicking on the catagory on the sidebar.

  • Did you try the css? Do you feel comfortable modifying helper_functions.php? Do you know how to create a new theme? Do you know nopresnik?

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited April 2012

    if you feel comfortable creating theme or modifying

    vanilla/views/discussions/helper_functions.php

    you could add the line below replacing "my-category" in lowercase to the category you want to exclude - it should hide the discussions in that category on "All discussions page", but still allow you to view those discussions when you click on the category.
    make sure it is all lower case and separate words with hyphens.

    if ((!$Sender->Category) && ($Discussion->CategoryUrlCode == "my-category")) return;

    in vanilla 2.0.18.4 it a snippet will look like this below, with added line if the category to remove is called "banned appeals"

    <?php if (!defined('APPLICATION')) exit();
    
    function WriteDiscussion($Discussion, &$Sender, &$Session, $Alt2) {
     if ((!$Sender->Category) && ($Discussion->CategoryUrlCode == "banned-appeals")) return;
       static $Alt = FALSE;
       $CssClass = 'Item';
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited April 2012

    Oh my there isnow a plugin for it!
    http://vanillaforums.org/addon/hidecategory-plugin

    no need to change the helper functions.

    @x00 it would be cool if you incorporated this in to your categories plugin, i'm sure you could make it more elegant.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.