[Solved] 'undefined function smarty_cms_function_anchor' when printing
Posted: Sat Sep 04, 2010 3:51 pm
I have created a user defined tag {gototop} to embed multiple links to the top of a page.
This has worked fine with older versions (1.6.xx) but has problems when printing after upgrading recently to 1.8.2.
You can see the result at this page (as you can see I pretty much use only default templates and modules).
When you press the Print button the page is empty and the Apache log shows:
When I comment out the line with smarty_cms_function_anchor printing works fine (but without the links of course).
Why is smarty_cms_function_anchor not defined when printing?
(Come to think of it: actually the links are unnecessary when printing, how do I implement an 'if (not printing)' clause?)
Code: Select all
echo '<span style="float:right; margin-top:0.5em;">';
echo smarty_cms_function_anchor(array('anchor' => 'main','text' => '^ Top'), $this);
echo '</span>';
You can see the result at this page (as you can see I pretty much use only default templates and modules).
When you press the Print button the page is empty and the Apache log shows:
Code: Select all
PHP Fatal error: Call to undefined function smarty_cms_function_anchor() in /sites/furix.com/www/lib/content.functions.php(976) : eval()'d code on line 2
Why is smarty_cms_function_anchor not defined when printing?
(Come to think of it: actually the links are unnecessary when printing, how do I implement an 'if (not printing)' clause?)