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

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Vanilla 2.2.1 is now available.
Please upgrade to 2.2 here. The 2.0 and 2.1 branches are no longer being updated.

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;}

    422 Real Estate Australia , now open Check it out

  • 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.

    422
Sign In or Register to comment.