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.

More than one prefix, and category view doesn't work?

This discussion is related to the DiscussionPrefix addon.
nashiranashira New
edited March 2012 in Vanilla 2.0 - 2.8

Hi, I was wondering if it was possible to have more than one prefix for members to choose from, and also if there was some way to make the prefixes work when you click through from a category. Though the latter is more pressing than the former.

Best Answer

Answers

  • nashira said:
    and also if there was some way to make the prefixes work when you click through from a category

    Can you explain the latter further then? As much details and examples as you can, please :-)

  • This is what I mean, the prefix will show up just fine on the /discussions page, like so:

    But if you look at the topics in their individual categories, there is no prefix

    It doesn't matter which theme I use, it just doesn't work that way for some reason?

  • Thanks, I'll have a look at that, I guess.

  • Hi luc, would like an update on this, please, as nashira, has stated, as it would be nice to see it fully displaying the prefix on the category!

    Thanks for your time, luc!

  • hgtonighthgtonight ∞ · New Moderator

    It is best if you learn why the code below does what you want, rather than blindly trusting a stranger on the internet by copying and pasting code. Read this page of the documentation: http://vanillaforums.org/docs/plugins

    /**
    * Add prefix to each discussion name in category view
    */
    public function CategoriesController_BeforeDiscussionName_Handler($Sender) {
      if($Sender->EventArguments['Discussion']->Prefixed == 1) {
        $Sender->EventArguments['Discussion']->Name = C('Plugins.DiscussionPrefix.Prefix').' '.$Sender->EventArguments['Discussion']->Name;
      }
    }
    

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.