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 Make it Work with Comments Embed?

This discussion is related to the Wysihtml5 addon.
edited March 2013 in Vanilla 2.0 - 2.8

I've been using Wysihtml5 for a while. It works perfectly on the normal discussion pages, but I recently set up a Vanilla comments embed on a website and Wysihtml5 does not show up on the embed. What do I modify in the code to get it to show up on the embed? Does the embed page use a different handler than Gdn_Form_BeforeBodyBox_Handler in 2.1?

Add Pages to Vanilla with the Basic Pages app

Comments

  • Not sure if this will affect the embed but likely, you can back version the plugin here to work with 2.0 thanks to peregrine

    http://vanillaforums.org/discussion/22650/what-makes-it-incompatible-with-vanilla-2-0#latest

  • edited March 2013

    Thanks. That did not solve the problem, but it got me closer to finding out what is causing it.

    For 2.0 with @peregrine's changes:
    In ./applications/vanilla/views/discussion/embed.php, there is no BeforeBodyField event, so we can add it above WriteEmbedCommentForm(), but it won't look good because the design is coded into the function.

    For 2.1, we only need to change one line of code because Wysihtml5 uses Gdn_Form_BeforeBodyBox_Handler. In ./applications/vanilla/views/discussion/helper_functions.php find this line in WriteEmbedCommentForm():

    echo Wrap($Controller->Form->TextBox('Body', array('MultiLine' => TRUE)), 'div', array('class' => 'TextBoxWrapper'));

    Modify to:

    echo Wrap($Controller->Form->BodyBox('Body', array('MultiLine' => TRUE)), 'div', array('class' => 'TextBoxWrapper'));

    In the end, it may be better to use WriteCommentForm() in embed.php instead of WriteEmbedCommentForm() and have an argument to detect if it is being used in an embed to display the extra embed features, such as the sign in link. This would keep the comment form design more consistent. For example, right now, the embed comment form does not have the user's avatar on the side like the main comment form.

    Add Pages to Vanilla with the Basic Pages app

    vrijvlinder
This discussion has been closed.