 |
Smarty
The discussions here are for Smarty, a template engine for the PHP programming language. Dedicated server web hosting provided by Guru-host.eu. |
| View previous topic :: View next topic |
| Author |
Message |
karlo.dude Smarty n00b
Joined: 25 Mar 2012 Posts: 1
|
Posted: Sun Mar 25, 2012 7:47 am Post subject: Active Navigation Help |
|
|
This certainly is my problem. Lets say that my index.tbl (Because I'm using smartyphp) is:
So this is my Home.
| Code: |
{include file='header.tpl'}
<div id="content">
<center>
<img src="/images/construction.png">
</center>
</div>
{include file='footer.tpl'}
| And lets say I'll go to my account that the codes are:
| Code: |
{include file='header.tpl'}
<div id="content">
<fieldset style="margin: 0 auto; width: 400px;"><legend>Profile</legend>
<div style="text-align: left;">
<label style="margin-left: 70px;">Username :</label>
<span>{$user_name}</span>
<hr style="width: 75%;" />
<label style="margin-left: 70px;">Fullname :</label>
<span>{$full_name}</span>
<hr style="width: 75%;" />
<label style="margin-left: 70px;">Email :</label>
<span>{$user_email}</span>
<hr style="width: 75%;" />
<label style="margin-left: 70px;">Premium Status :</label>
<span>{if $duration > 0}<span style="color: green; font-weight: bolder;">Active</span>{else}Trial{/if}</span>
<hr style="width: 75%;" />
<label style="margin-left: 70px;">Duration :</label>
<span>{$dur}</span>
<div style="margin-left: 70px;">Updates every 30 mins</div>
</div>
</fieldset>
</div>
{include file='footer.tpl'}
| So what's inside my header.tpl is this:
| Code: |
<ul id="navigation">
<li class="active"><a href="/">Home</a></li>
<li><a href="/myaccount">My Account</a></li>
<li><a href="/editaccount">Edit Account</a></li>
<li><a href="/logout">Logout</a></li>
</ul>
| So now my problem is, how do I move/ rename the li class if I only use this: {include file='header.tpl'} for my navigation? |
|
| Back to top |
|
dough boy Smarty Rookie
Joined: 31 Mar 2006 Posts: 32
|
Posted: Fri Mar 30, 2012 12:50 am Post subject: |
|
|
| Set a "tab" variable in PHP and then do an if to set the active tab. |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|