Page 1 of 1

smarty_cms_prefilter_precompilefunc

Posted: Thu Aug 14, 2008 8:54 pm
by peter2108
Hi,

I'm  studying CMSMS to see how it works - particularly how it uses Smarty. I found a prefilter called prefilter_precompilefunc.php that Smarty loads. This has a function smarty_cms_prefilter_precompilefunc which is called before a template is compiled passing the source. The function has a case statement depending on the value of $smarty->_current_file before a ':'.  The cases are
'content' ,'globalcontent', and 'template'. I'm using 1.4.1 and tracing entry to the function it does not seem ever to call with 'template' though it does call with 'tpl_body', 'tpl_top' and 'tpl_head'.  So any module functions TemplatePreCompile don't get called. Is this a bug or is it a deliberate move?

Thanks for any help,

Peter

Re: smarty_cms_prefilter_precompilefunc

Posted: Thu Aug 14, 2008 9:02 pm
by Ted
This only gets called during a compilation of the template after it's changed.  Are you checking right after you add/edit a page template?  If it's not getting called at all, then I would have to think it's a bug.

Re: smarty_cms_prefilter_precompilefunc

Posted: Fri Aug 15, 2008 9:28 am
by peter2108
I deleted everything from templates_c so presumably it should be compiled.

Code: Select all

smarty_cms_prefilter_precompilefunc 29 in/cmsmadesimple/plugins/prefilter.precompilefunc.php
$result[0] for case is tpl_body 
$smarty->_current_file: tpl_body:17
Nothing done


Other calls with $smarty->_current_file is 'content:...' or 'globalcontent:'  are there as expected. 

-- Peter