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.

How to add summaries to my homepage

homepage and categories summary ???

Comments

  • Look at the example plugin. It teaches how to write Vanilla plugin and as a use case it shows how to achieve what you are looking for.

  • Thank you. but the entire summary does not appear.

  • What do you mean by the "entire summary"? The upper part of the screenshot shows a summary and the lower part shows a full post.

  • riverredriverred New
    edited January 2018

    sorry, my english is bad...

    show all posts at homepage...

  • You took the information from a well documented example, so you should be able to solve that on your own... :frown:

    Look at this row: https://github.com/vanilla/addons/blob/master/plugins/example/class.example.plugin.php#L174
    You can configure the size of the summary. You could set that config value to 100000000

    Or even better replace this part

                $discussionBody = htmlentities( // Restore HTML entities
                    sliceString(
                        html_entity_decode( // Convert HTML entities to single characters before cutting
                            strip_tags(
                                $sender->EventArguments['Discussion']->Body
                            )
                        ),
                        $trimSize
                    )
                );
    

    with something like that

                $discussionBody = Gdn_Format::to(
                    $sender->EventArguments['Discussion']->Body,
                    $sender->EventArguments['Discussion']->Format
                );
    

    It is important to use Vanillas formatter here!

  • super, thanks <3

Sign In or Register to comment.