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?
nashira
New
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.
Tagged:
0
Best Answer
-
luc ✭✭
You will need to add functions similar to those ones for the categories (in the plugin):
/** * Add prefix to discussion name in single discussion view (vanilla/controllers/class.discussioncontroller.php) */ public function DiscussionController_BeforeDiscussionRender_Handler(&$Sender) { if($Sender->Discussion->Prefixed == 1) $Sender->Discussion->Name = C('Plugins.DiscussionPrefix.Prefix').' '.$Sender->Discussion->Name; } /** * Add prefix to each discussion name in list view */ public function DiscussionsController_BeforeDiscussionName_Handler(&$Sender) { if($Sender->EventArguments['Discussion']->Prefixed == 1) $Sender->EventArguments['Discussion']->Name = ('Plugins.DiscussionPrefix.Prefix').' '.$Sender->EventArguments['Discussion']->Name; }
5
Answers
Can you explain the latter further then? As much details and examples as you can, please :-)
There was an error rendering this rich post.
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?
You will need to add functions similar to those ones for the categories (in the plugin):
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!
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
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.