• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Navigation and Templating Question

#1
[eluser]eedfwChris[/eluser]
Hey everyone! I am trying to migrate to using the template parser for various reasons but I haven't quite gathered how to make this work how I like it...

Basically what I have is a shell (parent_view.php) which other views are called "in to" such as a login form or body for a specific element. What I am trying to duplicate is the navigation "selection" via css classes.

My assumption is that when you start using the parser that all php code be out of your views. Does anyone have any ideas on how to replicate (attractively) what I am doing with the if statements and css classes as listed below without putting the php into the view while still giving the designer some control over the style of the navigation (ie: not hard coding it into the controller)?

Code:
<!-- Sliding Login Form -->
{sliding_login_form}
<!-- End Sliding Login Form -->

<!-- Start Navigation -->
<ul>
<li &lt;?php if ($uri == 'about_us') { echo 'class="selected"'; } ?&gt;><a href="&lt;?php echo site_url('/about_us/'); ?&gt;">About Us</a></li>
<li &lt;?php if ($uri == 'scheduler') { echo 'class="selected"'; } ?&gt;><a href="&lt;?php echo site_url('/scheduler/'); ?&gt;" class="important">Schedule Appointment</a></li>
<li &lt;?php if ($uri == 'services') { echo 'class="selected"'; } ?&gt;><a href="&lt;?php echo site_url('/services/'); ?&gt;">Services</a></li>
<li &lt;?php if ($uri == 'careers') { echo 'class="selected"'; } ?&gt;><a href="&lt;?php echo site_url('/careers/'); ?&gt;">Careers</a></li>
<li &lt;?php if ($uri == 'contact_us') { echo 'class="selected"'; } ?&gt;><a href="&lt;?php echo site_url('/contact_us/'); ?&gt;">Contact Us</a></li>
</ul>
&lt;!-- End Navigation --&gt;

&lt;!-- Start Body --&gt;
{body}
&lt;!-- End Body --&gt;


Messages In This Thread
Navigation and Templating Question - by El Forum - 07-25-2007, 12:21 AM
Navigation and Templating Question - by El Forum - 07-25-2007, 09:08 AM
Navigation and Templating Question - by El Forum - 07-25-2007, 12:58 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.