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.
Options

Tagging Plugin

edited August 2009 in Vanilla 2.0 - 2.8
I and a couple cohorts wanted the ability to Tag all threads during the initial creation of a Discussion. We're roughly basing it after Spode's TagThis http://vanillaforums.org/addon/415/TagThis After a day or so we've run into some unknown's to which we'd like some feedback and suggestions.

So below is what we've done so far—

We've created the database and tried appending our Form and Logic to:

• Hooking into PostController class in .../vanilla/controllers/post.php—We can insert logic and XHTML content with very minimal control using the magic events PostController_Render_Before(). We were successful in adding hidden inputs, but all visible inputs would be displayed above the rest of the page. We got the same result hooking in our own $Sender->FireEvent('EventName') and PostController_EventName_Handler(). What did work for us was prefixing an x to Discussion() and overriding that with PostController_Discussion_Override() . In the latter two of the 3 we are editing the Vanilla application. You can see the downside as we'd like to update to the stable version of Vanilla 2 when it's released.

• Modifying the form's view in .../vanilla/views/post/discussion.php—This displayed exactly how we wanted it, however we had no difficulty hooking in the logic.

→ As I sit here thinking about these conundrums I find myself with even more questions. Our Tagging plugin has its own Table in the Database. Is there a way for the DiscussionModel in .../vanilla/controllers/post.php to take the information from our Input('Tag') and send that information to a different database from the rest of the form? Can you nest forms? At the moment we had planned to write the plugin to be its own form (similar to how Vimeo and WordPress handle tagging in admin).

Comments

  • Options
    For the html form parts you should consider rendering an asset (module) where you can write a module to be displayed to that asset. You could extend/overwrite functions in the model and allow for the extra fields. Or add an event in the model for adding more logic too. However having tags as its own form with its own model wouldn't be a bad thing, i think you can extend your model from the discussionmodel aswell.

    All events or assets can be requested, i made a request for some hooks that are now in the master.
  • Options
    Thanks for the information @Immersion. It seems complicated but it's good to know that one can extend specific models. Is there a particular way I should make a request for events/assets? Start a conversation with @Mark or @Todd?
  • Options
    Yeah starting a thread about it, adding it to the garden github issues thing or a direct conversation would work. I'd go for the conversation with @Mark. Or if your handy with git you could add the events yourself and they could merge your branch.
  • Options
    MarkMark Vanilla Staff
    Yes, if you have event requests you can add them to github or start a conversation with myself/todd. You could also make a branch on github, add the events you need, and do a pull request to us.
Sign In or Register to comment.