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

Theme view for a plugin

judgejjudgej
edited September 2010 in Vanilla 2.0 - 2.8
I've searched and cannot find any clues how to do this. I have a number of plugins - as we all do - and I would like to place views for some of those plugins into the current theme. What I cannot work out is where to put those views.

All the documentation and examples I have found just show how to override the views of the core controllers. The views in the plugins - I just cannot work out how override them in the theme and cannot find any examples in any of the downloadable themes.

Comments

  • Options
    judgejjudgej
    edited September 2010
    Looking through the code, modules seem to either specify the full plugin path to their views, or use Gdn_Plugin->GetResource() which also only seems to look in the plugins for the resources (i.e. a view in this case).

    Does this mean that a theme is not able to modify the view outputs of plugins? Is the only option to hack the plugins to change their views? Or am I missing something?

    I used to work a lot with the Xaraya CMS, and any template within any module (Xaraya's plugins) could be over-ridden in the theme (HTML was only generated by the templates) giving ultimate control of absolutely any part of the page rendering. Have I been spoilt?
  • Options
    judgejjudgej
    edited September 2010
    Here is a similar one: can a plugin override an application view in the same way that a theme can?

    I have created a plugin that changes some of the titles that are displayed. Some of the titles can be changed in the code through the plugin registering events. Some of the titles I want the plugin to change are actually in core views. So far as I know, those views can only be overridden by the theme. If that is so, is there a good way to distribute such a plugin, since it contains its own classes and also some PHP views that need to be moved to the theme. Unless, of course, the plugins form part of the hierachy in the search path for view overrides?

    According to the documentation it looks like plugins cannot override core application views.
Sign In or Register to comment.