I was having problems in creating an accordion menu which remembered state. Setting navigation to true in options didn't help.
After some time of debugging, I realised that the default CJuiAccordion class outputs the head sections as links with href as #, which causes navigation not to work. Even if you were to put "<a href='?r=blah'>A Header</a>" as the key, it wouldn't work either as it will create ANOTHER href with #.
So I wrote a quickie custom class to enable accordion menus which remember state.
- Yii 1.1 or above
- Extract the release file under
See the following code example: ~~~ For example: '?r=site' will be used as the anchor link for the Home panel.
[php] $this->widget('StateCJuiAccordion', array(
'panels'=>array( "Home"=>array('href'=>'?r=site', 'content'=>$home_menu), "Panel 2"=>array('href'=>'?r=p2', 'content'=>$p2_menu), ), 'options'=>array( 'navigation'=>true, 'active'=>false, ),
##Change Log ###March 23, 2010 * Initial release.