add text between breadcrumbs and topic list
jackmaessen
✭✭✭
I want to add some text between the breadcrumbs and the topic list. Which public function do i need?
By the way: is there some list of all public functions so that i can see on what position the text is parsed on the forum?
0
Comments
The plugin Eventi is a great help for that
Ok. I now found what i need but i have to use the argument "content" for it otherwise the text appears also in the sidepanel. How can i do that?
This is what i made now but does not work; without the if($Text) it does work but is also visible in the sidepanel
public function DiscussionsController_BeforeRenderAsset_Handler($Sender) { $Text = $Sender->EventArguments['Comment']; if ($Text) { if (! Gdn::Session()->IsValid() ) { echo '<div class="DismissMessage">This text is only visible if you are logged out!</div>'; } } }If you want to add more content anywhere the best way is by making a module. Please try the Widgets plugin as a guide.
You can have a module contain anything. Text or images or whatever. Then you can reorganize the modules however you want.
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
@vrijvlinder is right. Look at the default.master.tpl:
<div id="Body"> <div class="Row"> <div class="BreadcrumbsWrapper">{breadcrumbs}</div> <div class="Column PanelColumn" id="Panel"> {module name="MeModule"} {asset name="Panel"} </div>In general you can only hope to find events in
{...}blocks. There is no way to insert anything between div#Body and{breadcrumbs}. So in order to achieve what you are trying you have to write a custom default.master.php i.e. a custom theme where you add your own module at the place you like it to appear.If you only want to show static text in case a user is not logged in, it is quite simple. Add the following code to your custom default.master.tpl:
{if $User.SignedIn} Content added here will only be shown to logged in users {/if}See: http://vanillawiki.homebrewforums.net/index.php/Using_Smarty_with_Vanilla