Forums / Cotonti / Extensions / [REQ] Color Changer

GHengeveld
#28469 2011-02-22 06:39
Color codes for example. Say you have an extrafield for page background color named 'bgcolor', and you put a color code such as #FF0000 in it. Then in your TPL files you can use something like:
<body style="background-color:{PHP.usr.profile.user_bgcolor}">
This will make the background color for page body red (#FF0000).

Best is to check if the user has actually set an alternative value, like this:


<body<!-- IF {PHP.usr.profile.user_bgcolor} --> style="background-color:{PHP.usr.profile.user_bgcolor}"<!-- ENDIF -->>