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

add text between breadcrumbs and topic list

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?

Comments

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    The plugin Eventi is a great help for that

  • Options
    jackmaessenjackmaessen ✭✭✭
    edited February 2015

    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>';
            }
          }
       }
    
  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    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.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    @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

Sign In or Register to comment.