|
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 |
dyouren Smarty n00b
Joined: 21 Dec 2014 Posts: 1
|
Posted: Sun Dec 21, 2014 11:49 pm Post subject: registerFilter cached? |
|
|
Hi,
I want to know if its possible to prevent a registerFilter from caching.
I have widgets in my page e.g. {widget name="test"} which I am using registerFilter('pre' to find and the widgets control what .css and .js files are included in the page. I build up a list of required .js and .css files in registerFilter('pre' so that they are included in the site head / footer correctly.
The issue I am seeing is that when caching is enabled the registerFilter('pre' does not seem to be called? So this include js/css list is no longer dynamic.
If its not possible to stop registerFilter caching is there another solution for this: find widgets in a page, build a list of .js and .css files required by the widgets then output them dynamically in the template - without it caching.
Thanks. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Dec 23, 2014 7:36 pm Post subject: |
|
|
Prefilters run on the template source once before the template gets compiled.
So an output filter might be the better location to do the job. |
|
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
|