One little trick I find useful is to assign all module vars for a module to each template. A useful feature of the assign method is that if you don't specify a template variable name and the variable is an associative array each element will be assign as a template var based on the key name.
e.g. The following code will result in the template vars $key1, $key2 etc...
$myarray =
array('key1' =>
$val1,
'key2' =>
$val2, ....
);
$pnRender->
assign($myarray);
If you don't provide a module variable name to pnModGetVar it will return an associative array of all module vars.
e.g. the following code will return array('itemsperpage' => 10, 'bold' = true, ......) etc.
$modvars = pnModGetVar('Example');
So if we combine these as follows we automatically have all module vars available in each template
$pnRender->assign(pnModGetVar('Example'));
You can use
PHP functions directly as you've done with count but there are,
IIRC, restrictions with this should the host be running in safe mode. I believe it's also possible to use modifiers (and most
PHP functions can be used as modifiers) in comparisions.
e.g.
<!--
[if count($var) gt
0]-->
can be re-written as
<!--[if $var|count gt 0]-->
This last technique i've not tried so I offer no guarentee it'll work.....
-Mark
--
Visit
My homepage and
Zikula themes.