Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

registerFilter cached?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
dyouren
Smarty n00b


Joined: 21 Dec 2014
Posts: 1

PostPosted: Sun Dec 21, 2014 11:49 pm    Post subject: registerFilter cached? Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Dec 23, 2014 7:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP