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.
Documentation ¶
Requirements ¶
- Yii 1.1 or above
Installation ¶
- Extract the release file under
protected/components
Usage ¶
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.
Question
What is the purpose of this extension? Whatever link I put in href, the accordion does not open any page but opens only the relative panel. Maybe I have misunderstood the accordion's purpose with regards to navigation option?
question two ?
Yii::import('zii.widgets.jui.CJuiAccordion');
does not exist ?
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.