Yii Framework Forum: CMenu help - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

CMenu help active class not being applied to anchor tag Rate Topic: -----

#1 User is offline   _wk_ 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 152
  • Joined: 22-January 10

Posted 22 February 2010 - 04:53 PM

Hi All,

I have a CMenu widget set up in my layout like this...

<?php $this->widget('zii.widgets.CMenu', array(
				'items' => array(
					array('label' => 'Home', 'url' => '/'),
					array('label' => 'About', 'url' => array('/info/about')),
					array('label' => 'FAQ', 'url' => array('/info/faq')),
					array('label' => 'Records', 'url' => array('records/index'), 'visible' => !Yii::app()->user->isGuest),
					array('label' => 'Lists', 'url' => array('lists/index'), 'visible' => !Yii::app()->user->isGuest)
					),
				'id' => 'main-nav',
				'htmlOptions' => array('class' => 'nav'),
				'activeCssClass' => 'active'
				));
		?>


I have the 'About' and 'FAQ' page s set up as static pages within the site controller and have custom routes applied to them e.g. /site/page/view/about => /info/about.html.

When this renders and I navigate to the pages links, the active class doesn't get applied but does when applied to the ones where they are linking to actual controller methods.

How do I get the active class appended to the static page links?
0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,339
  • Joined: 12-October 09
  • Location:Croatia

Posted 25 February 2010 - 06:49 AM

Take a look here http://www.yiiframew...?showtopic=7444 the problem is similar, look for the active property
Find more about me.... btw. Do you know your WAN IP?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users