Dynamic color

From: Date: Tue, 11 Feb 2003 13:52:50 +0000
Subject: Dynamic color
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-7638@lists.php.net to get a copy of this message
Hi everyone, I am new to PHP and Smarty, but here is what I want to do. Basically, I have a bunch of pages which all contain the same navigation menu (tables and links, nothing really fancy). I want to migrate this to a template, so that I only have to modify it once. No problem, that all works fine. However, what I really want to do is make the background color of the <td> for the the current visible page be a different color than the rest of the cells on the menu. I am guessing I can do this with <td bgcolor={$bgcolor}><a href=#>Link 1</a></td> What I don't know is where the logic should go to figure out which page is currently visible. Should this come from the PHP script, passing a variable to the smarty template $smarty->assign($bgcolor) or should this logic be right in the template? Has anyone done something like this, and can you point me in the right direction? Thanks! -Erich-

« previous php.smarty.general (#7638) next »