Welcome Guest, Not a member yet? Register   Sign In
Keeping parent menu items active in child pages
#7

A very simple solution and works fast. Instead of using a controller you can do it directly in the views page where your navigation (menu) file is written.

<?php $segment = $this->uri->segment(1); ?>

Then in your Dropdown menu:

<li class="sub-menu">
<a href="javascript:void(0);" <?php echo ($segment == 'settings-seo' || $segment == 'settings-email') ? 'class="active"' : 'class=""'?>>
<i class="fa fa-cogs"></i>
<span>Settings</span>
</a>
<ul class="sub">
<li><a href="settings-seo">Search Engines</a></li>
<li><a href="settings-email">Email Template</a></li>
</ul>
</li>

Is there a way we can paste code snippet properly in this forum?
Proprietor and Developer:

http://app-arsenal.com
http://senhosting.com
Reply


Messages In This Thread
RE: Keeping parent menu items active in child pages - by apparasenal - 12-18-2014, 11:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB