Announcement

  •  » Extensions
  •  » Overwrite or extend picture_content.tpl?

#1 2017-11-22 22:03:33

TheDoc
Member
Munich / Germany
2015-10-18
173

Overwrite or extend picture_content.tpl?

Hi all,

more a bit of a philosophical question :-)

While creating a new plugin to use paver.js for panoramas (based on the existing photosphere plugin) I ran into the following:

Alternative "overwrite"

The photosphere plugin "overwrites" any current picture_content.tpl from a theme by installing its own handler for 'render_element_content' with a prio higher than NEUTRAL. In it the own picture_content.tpl is used to create the output.

=> Themes with a handler with prio NEUTRAL won't get executed since the default theme checks for any previous content before executing its current picture_content.tpl.

I understand that this is done to make sure the output looks exactly like photosphere js needs it. Drawback is that anything the theme would like to add gets lost,

Alternative "extend"

I have tried a different approach with a handler with lower prio than NEUTRAL. In that I try to extend/wrap the previous content as required.

=> Themes picture_content.tpl will get executed.

Drawback: The plugin might not find what it needs to extend/wrap.


Any ideas on what might be a "better" approach and why?

Cheers,
Thomas

Offline

 
  •  » Extensions
  •  » Overwrite or extend picture_content.tpl?

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact