HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[3.0.2] how to text below discussion title

Hi, how do i show a preview text of the discussion below the topic title in the category list?

Comments

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    Take a look at the source of the DiscussionGrid plugin

  • And what should i look at specifically from that plugin?

  • rbrahmsonrbrahmson "You may say I'm a dreamer / But I'm not the only one" NY ✭✭✭

    I assumed you know how to code Vanilla Plugins. If not you have ways to go...

    You will have to write a plugin and hook into discussion controller as shown in this very simple code (which I haven't tested). I'd improve upon that code, but this gives you the basic...

    public function discussionsController_afterDiscussionTitle_handler($Sender, $Args) {
       $Discussion = $Sender->EventArguments['Discussion'];
       echo '<br>' . substr($Discussion->Body, 0, 80);   //Display 80 chracters from the disussion body
    }
    
  • I'm not that handy with that stuff, is there a way to request this as a plugin?

  • R_JR_J Ex-Fanboy Munich Admin

    What you are asking for has been the example plugin: https://github.com/vanilla/addons/blob/release/2.8/plugins/example/class.example.plugin.php

    Using that example unaltered might help or not, but at least it would make a great start.

    How do you imagine "requesting a plugin" would work?

  • thanks, the example plugin does what i want. Weird name for a plugin but ill take it.

Sign In or Register to comment.