Templates overwriting protection (future request) #724

Open
opened 2026-10-05 00:13:57 +02:00 by adam · 1 comment
Owner

Regarding what flop25 said http://piwigo.org/forum/viewtopic.php?pid=168920#p168920, I want to detail that Menalto Gallery2 also used smarty with tpl had some kind of template overwriting protection.
You can make a subfolder called "local" in the folder where templates are, and you could put a copy of the template you want to modify, then modify it. If "local" subfolder was detected they loaded tpl from it instead the original one.

In this way a user that make a modification to a template didn't lose his modification when making software updates.

I don't know how Piwigo extensions are loading templates, but if the extensions use a piwigo core function to load templates maybe is possible to implement this future also in Piwigo.

Regarding what flop25 said http://piwigo.org/forum/viewtopic.php?pid=168920#p168920, I want to detail that Menalto Gallery2 also used smarty with tpl had some kind of template overwriting protection. You can make a subfolder called "local" in the folder where templates are, and you could put a copy of the template you want to modify, then modify it. If "local" subfolder was detected they loaded tpl from it instead the original one. In this way a user that make a modification to a template didn't lose his modification when making software updates. I don't know how Piwigo extensions are loading templates, but if the extensions use a piwigo core function to load templates maybe is possible to implement this future also in Piwigo. <!-- github-sync-id:266782165 -->
Author
Owner

That's exactly what the template-extensions/ folder and Admin -> Configuration -> Templates is for, not?

That's exactly what the template-extensions/ folder and Admin -> Configuration -> Templates is for, not? <!-- github-comment-id:337879903 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#724