Re: [SMARTY] Dynamic color
| From: | Dennis Gearon | Date: | Tue, 11 Feb 2003 16:28:28 +0000 |
| Subject: | Re: [SMARTY] Dynamic color | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7640@lists.php.net to get a copy of this message | ||
Eric,
If you make your letter the CONTENT of your emails, and not an ATTACHMENT, they are easier
to quote :-)
In my opinion, that is application logic, not output rendering logic, which is what Smarty
is for. I will be putting that in my 'pre-Smarty' application logic in my site. That is my
suggestion.
2/11/2003 5:52:50 AM, "Erich C. Beyrent" <erich.beyrent@beyrent.net> wrote:
---------------------------------------------------------------------------
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-