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.

Overwrite plugin's view in theme

cannafirecannafire New
edited September 2012 in Vanilla 2.0 - 2.8

I'm coding a theme and I can't seem to find a way to change a plugin's output within the theme.

Say, you have \plugins\Foo\class.foo.plugin.php:

class FooPlugin extends Gdn_Plugin { public function Base_BeforeDiscussionTabs_Handler($Sender) { echo 'bar'; } }

Is it at all possible to have like \themes\sometheme\views\plugins\Foo\foo.php or something along those lines? And then perhaps extend the plugin's class within my theme overwriting the method in question? I'm not quite sure what gets autoloaded...

Comments

  • phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

    @Todd: Is this going to get a programming guideline anwhere soon. It would be cool to have that reliably integrated. Thanx for info.

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • @Todd said:

    In this case there'd be a view called /plugins/Foo/views/myview.php. Then in order to override the view you'd add /themes/YourTheme/views/myview.php to your theme.

    I've never been a fan of this. I have made many of my pluings themable but at first I used

    current_theme/views/lowercasepluginnname/view.php then eventually I have been moving towards current_theme/views/plugins/PluginName/view.php

    grep is your friend.

    phreakUnderDoghgtonight
Sign In or Register to comment.