[pmwiki-users] Using variable in skin template

Sandy sandy at onebit.ca
Fri Oct 23 17:14:24 CDT 2009


DaveG wrote:
> 
> Sandy wrote:
>> in config.php
>> $FmtPV['$color1'] = '"#00cc00"';
>>
>>
>> then in the .tmpl file:
>> <style>
>> h1 {color:$color1;}
>> A {color:$color1;}
> Rather than this use:
> 
>    $color1 = '#00cc00';
>    $HTMLStylesFmt['my_skin'] = "h1 {color:$color1;} ";
> 
> That way, there's no need to mess with .tmpl.
> 
>   ~ ~ Dave


I'm not (yet) comfortable with $HTMLStylesFmt[]. For that matter, arrays 
in php still confuse me. Perfectly clear while I'm reading the 
tutorials,... A matter of practice.

Thinking further, can this go in skin.php?
$color1 = '#00cc00';
That keeps all the skin stuff in the skin, and avoids $HTMLStylesFmt[].


Sandy




More information about the pmwiki-users mailing list