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.

Creating a output formatter plug-in

theallantheallan New
edited November 2011 in Vanilla 2.0 - 2.8
Is there a way to create an output formatter? I know that we can create plug-ins for the input formatter using something like

Gdn::FactoryInstall('DtFormatter', 'DtKeywordsPlugin', __FILE__, Gdn::FactorySingleton);

but if I understand correctly, that's the only formatter that is then used (I want to keep the current one) and it will only apply to new posts.

Basically want I want to do is look through posts for keywords and convert them into links. Is that possible?

Thank,
Allan

Best Answer

  • x00x00 MVP
    edited November 2011 Answer ✓
    Yes this is possible. You don't need a formatter. Have a look at the quotes plugin for clues.

    Personally however you could do it with javascript if you pass the keywords. Less overhead. However I'm not giving programming lessons. Basic knowledge of jQuery, would do it.

    grep is your friend.

Answers

  • x00x00 MVP
    edited November 2011 Answer ✓
    Yes this is possible. You don't need a formatter. Have a look at the quotes plugin for clues.

    Personally however you could do it with javascript if you pass the keywords. Less overhead. However I'm not giving programming lessons. Basic knowledge of jQuery, would do it.

    grep is your friend.

  • Nice one thanks. I ended up with a function which looks for the "AfterCommentFormat" event being fired and manipulating the content as required then. Thanks for the pointer.

    I did think about using jQuery, but figured that that would probably be more overhead (certainly for the client) and would likely result in a flicker from the unrendered state to the rendered state, which can be a but frustrating at times.

    All sorted now - thanks again!
    Allan
  • The problem with javascript is that search engines will not index the formatted text.
  • Mosts link are no follow anyway. if you already have a tag cloud it is not necessary.

    grep is your friend.

Sign In or Register to comment.