Hi,
currently I'm trying to develop a module replacing all external links by an internal link to a "goodbye" page.
To generate this goodbye page link, I'm calling cms_selflink, because I want the module to be sustainable.
That requires the cms_selflink smarty function to be loaded before my cms_extlink smarty function.
How can I have a bearing on the loading order of smarty functions? Or ensure that cms_selflink was loaded before?
At the moment, I'm just embedding a {cms_selflink} tag in template header, but it seems to me that this does not work in the new cmsms version (1.11).
In my cms_extlink smarty function, I check via function_exists whether cms_selflink is available. If not, I just do nothing in order to avoid a complete site crash.
Any best practice for smarty functions depending on others?
Development: Smarty function depending on cms_selflink
Re: Development: Smarty function depending on cms_selflink
Noone any idea?
Re: Development: Smarty function depending on cms_selflink
I solved the problem by checking for the existence of the depending function and - if it was not declared - including it via require_once:
function.cms_xyz.php
function.cms_xyz.php
Code: Select all
if(!function_exists('smarty_function_cms_selflink'))
{
require_once('function.cms_selflink.php');
}
function smarty_function_cms_xyz(...)
{
...
}