Jump to content

add active state to nav


bonmane

Recommended Posts

I added

 

<?php $_menu = ''?>
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php $_menu .= $this->drawItem($_category) ?>
<?php endforeach ?>
<?php if ($_menu): ?>
<div class="nav-container">
<ul id="nav">
<li class="level0 first nav-home"><a href="<?php echo $this->getUrl() ?>"><span><?php echo $this->__('Home') ?></span></a></li>
<?php echo $_menu; ?>
<li class="level0 nav-1 parent"><a href="<?php echo $this->getUrl('contacts')?>"><span><?php echo $this->__('Contact') ?></span></a></li>
<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('menu')->toHtml() ?>
</ul>
</div>
<?php endif; ?>

 

to

 

top.phtml

 

and it works as expected, I now have CMS links in my nav

 

but how can I make them have active state like the category links do??

 

here is the site:

 

http://pro-tools-training.com/new-magento/index.php/video-1.html

Link to comment
Share on other sites

the nav has 3 links

 

1. home 

2. Documentaries & Courses

3. Contact

 

 

click on Documentaries & Courses > once the page loads the link holds an active state as expected

 

click on either home or contact > once the page loads the link does not hold an active state

 

 

home and contact were added by me and therefore do not have the built in behavior that Documentaries & Courses has - because Documentaries & Courses is part of the default system navigation.

'

I added the new links and now want to add the active state behavior.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.