Summary: | Move widely used TT plugins to LOAD_PLUGINS | ||
---|---|---|---|
Product: | Koha | Reporter: | Martin Renvoize (ashimema) <martin.renvoize> |
Component: | Templates | Assignee: | Martin Renvoize (ashimema) <martin.renvoize> |
Status: | NEW --- | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | baptiste.wojtkowski, david, dcook, fridolin.somers, jonathan.druart, julian.maurice, katrin.fischer, kyle, m.de.rooy, martin.renvoize, nick, oleonard, phil, testopia, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 37634 | ||
Bug Blocks: | |||
Attachments: |
Bug 38723: Add LOAD_PLUGINS to Template tooling
Bug 38723: Remove [% USE Koha|Asset|raw %] from all templates Bug 38723: POC LOAD_FILTERS for raw Bug 38723: POC LOAD_FILTERS for raw Bug 38723: WIP Fix valid-templates.t |
Description
Martin Renvoize (ashimema)
2024-12-17 09:10:26 UTC
Created attachment 175601 [details] [review] Bug 38723: Add LOAD_PLUGINS to Template tooling This patch adds the Koha, Asset, and raw TT plugins that are used throughout templates to the LOAD_PLUGINS directive on Template load.. this way we shouldn't need to keep adding them to the top of every TT file and include. Created attachment 175602 [details] [review] Bug 38723: Remove [% USE Koha|Asset|raw %] from all templates We now load this plugin by default using LOAD_PLUGINS so we no longer need to reference it in a USE statement in every template file. This doesn't work.. LOAD_PLUGINS doesn't work as I thought at all.. but I'm a bit confused as to how to resolve it right now. Have you tried NAMESPACE (https://template-toolkit.org/docs/manual/Config.html#section_NAMESPACE) ? It is for constants but maybe a subroutine can be used as the value of a constant ? Created attachment 175604 [details] [review] Bug 38723: POC LOAD_FILTERS for raw Created attachment 175605 [details] [review] Bug 38723: POC LOAD_FILTERS for raw Created attachment 175606 [details] [review] Bug 38723: WIP Fix valid-templates.t I'm not sure why/how this works.. and it doesn't resolve all issues and will need applying to the Template calls in proper Koha and not just the tests too I believe Looks great. Does this impact notices with TT syntax ? |