How to make my plugin override a template overridden by another plugin?

Hi, So I have the Bigboard plugin installed, and this overrides board/table_container. Here is the override set in the Bigboard plugin:

$this->template->setTemplateOverride(‘board/table_container’,‘bigboard:board/table_container’);

Now my own plugin needs to also override this template, but I need my plugin to be the priority, so it doesn’t use the bigboard templates. Here are my overrides:

$this->template->setTemplateOverride(‘Bigboard:board/table_container’, ‘Fixes:bigboard/table_container’);

$this->template->setTemplateOverride(‘board/table_container’,‘Fixes:board/table_container’);

But the template from bigboard is always loaded. What am I missing?

2 Likes

I think this is not supported so far

any way around this?

the answer is no. plain and simple. and even if you could choose plugin load order, only 1 template would be used, so 1 plugin will be missing its overriden template, so that accomplishes nothing.

you can however plan for the future. instead of overriding a template use hooks. if there are no hooks, and you MUST overide a template, then planning for the future, would mean adding hooks to the KB core template that you are overriding, so that you wont have to override it.

but, that does not fix the other plugin that IS overriding it, so now you need collaboration with that plugin to update it.

OR, use collaboration to account for each others plugins, and create joint templates that provide the code necessary to function, and conditionaly use that template when both plugins are present.

bottom line, no, is the answer. (in KBs current state)

3 Likes