|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
ImpossibleProject Smarty n00b
Joined: 17 Oct 2013 Posts: 1
|
Posted: Thu Oct 17, 2013 8:06 am Post subject: Extending templates with relative paths - wrong template! |
|
|
I have a strange issue that started occurring over the last days - possibly, this isn't even a bug but something I'm misunderstanding about the way Smarty extends works with relative paths.
In our setup, we have a number of directories with a layout.tpl File and subdirectories with specific templates that extend the layout.
For example:
Code: |
invoices/layout.tpl
invoices/gmbh/directsale.tpl <= extends the invoices/layout.tpl
emails/layout.tpl
emails/loyalty/bonus.tpl <= extends the emails/layout.tpl
|
All these extends are handled using
Code: | {extend file="../layout.tpl"} |
in the respective template.
Now, we are starting to see the strange situation where the pre-compiled bonus.tpl has a dependency on the invoices/layout.tpl, and vice versa.
Clearing the templates_c Folder generally solves the problem for a while, but then another "bad" compile happens and creates a messed up template again.
The result of this is not pretty: sometimes, invoices suddenly miss the body, in other cases, emails sent to customers show a broken invoice body with no content. This is a really serious issue, and any help on this would be much appreciated.
What could be causing Smarty to sometimes load a template to extend from the wrong path (i.e. not the path where the extends is used)?
Is there a good alternative to using relative include paths for extending templates to circumnavigate this issue?
Any help would be much appreciated. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|