As you will guess i’m new to php. Thanks for your help.
I have this piece of code in a header tpl:
<div class="menu">
<ul>
<li class="selected"><a href="#">home</a></li>
<li><a href="#">carta</a></li>
<li><a href="#">delicias artesanas</a></li>
<li><a href="#">contacto</a></li>
<li><a href="#">dónde estamos</a></li>
</ul>
</div>
which I’d like to call with PHP function include.
The thing is, I want to call this tpl, indicating which one of the li’s will have the “selected” class applied, how can I do that?
As I told you, easy peasy for anyone with basic PHP experience.
THANK YOU.
You can base it off of a variable that is set in your calling (non-template) logic. For instance, in smarty you could do this in the PHP:
Then in your template you can just check that variable:
The keeps HTML out of your biz logic (PHP) and in your display logic (tpl).