You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add-on modules can't ship templates that resolveTemplate() finds #551
w2p_Theme_Base::resolveTemplate($template) only looks in style/<theme>/ and style/_common/. An add-on module can't put files there: it ships as one folder under modules/, and installing it shouldn't write into style/.
So add-ons can't follow the manual's advice for v5 ("Put your module's HTML in templates and include them with $AppUI->getTheme()->resolveTemplate('yourmodule/view')"). They either keep their markup inline in addedit.php / view.php (what Notebook does after its 5.0 port), or include their own files directly, and a theme can't override them either way.
Suggested fix
In resolveTemplate(), after style/<theme>/<template>.php and before style/_common/<template>.php, also try modules/<first path segment>/templates/<rest>.php. A template named notebook/view would then resolve to:
style/bootstrap/notebook/view.php (a theme override)
modules/notebook/templates/view.php (shipped with the module)
style/_common/notebook/view.php
Core lookups are unchanged, because no core module has a templates/ folder. Mention the convention in the manual's "Updating Add On Modules for v5.0" section.
Found while porting the Notebook add-on to 5.0 (master 8727ad5c).
Activity