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.

[Solved] any way to write html into discussion title?

jeongweejeongwee Vanilla version 2.6 ✭✭
edited September 2013 in Vanilla 2.0 - 2.8

i wanna use a category as a custom page,insert html span tag/img tag and use css to modify it .

any way to write html into discussion title? or any plugin can do it?

anyway i can do it?

image

Comments

  • ShadowdareShadowdare r_j MVP
    edited September 2013

    If anyone else who's reading this wants to add thumbnails to discussions for blogging purposes, please check out the articles and blogging application proposal for Vanilla.

    Here are the functions you can use to hook into events around the discussion title in Vanilla 2.1+. To use them, put the functions you would like to use in a proper plugin or theme hooks file.

    If you want custom HTML code to show up on every discussion, the functions below will let you do it.

    If you want to output custom HTML depending on individual discussions, you can check for discussion properties such as DiscussionID from $Sender object using one of the functions below to hook into events around the discussion title.

    If there are many discussions that you want to have different code show up on, you can create a plugin that adds a new field to the discussion form and use one of the functions above to output your custom code in the right place.

        // Functions to hook into events around each discussion in Vanilla 2.1+.
        //
        // Change "CategoriesController" to "DiscussionsController"
        // if you want your code to run in the discussions index.
    
        public function CategoriesController_BeforeDiscussionName_Handler($Sender) {
            // Before discussion title.
            echo '<span class="YourCSSClass">Example.</span>';
        }
    
        public function CategoriesController_BetweenDiscussion_Handler($Sender) {
            // Between each discussion.
            echo 'Example.';
        }
    
        public function CategoriesController_BeforeDiscussionContent_Handler($Sender) {
            // Before discussion content.
            echo 'Example.';
        }
    
        public function CategoriesController_AfterDiscussionTitle_Handler($Sender) {
            // After discussion title.
            echo 'Example.';
        }
    
        public function CategoriesController_AfterCountMeta_Handler($Sender) {
            // After discussion count meta.
            echo 'Example.';
        }
    
        public function CategoriesController_DiscussionMeta_Handler($Sender) {
            // Within discussion meta.
            echo 'Example.';
        }
    
        public function CategoriesController_AfterDiscussionContent_Handler($Sender) {
            // After discussion content.
            echo 'Example.';
        }
    

    Add Pages to Vanilla with the Basic Pages app

  • jeongweejeongwee Vanilla version 2.6 ✭✭

    kk thx its solved

Sign In or Register to comment.