cdropdownmenu CDropDownMenu is a extension to CMenu that allows Drop-Downs via superfish

  1. Documentation
  2. Change Log

CDropDownMenu is a extension to CMenu that allows Drop-Downs via the superfish jquery plugin.

Documentation

Requirements
  • Yii
Installation
  • Extract the release file under protected/extensions
Usage

See the following code example:

$this->widget('ext.CDropDownMenu.CDropDownMenu',array(
			'style' => 'vertical', // or default or navbar
      'items'=>array(
				array(
					'label'=>Yii::t('Login'),
					'url'=>array('//user/user/login'),
					'visible'=>Yii::app()->user->isGuest,
					), 
				array(
					'label'=>Yii::t('Register'),
					'url'=>array('//registration/registration/registration'),
					'visible'=>Yii::app()->user->isGuest,
					), 
				array(
					'label'=>Yii::t('Demo'),
					'url'=>array('//demo/index'),
					'visible'=>Yii::app()->user->isGuest,
					), 
				array(
					'label'=>Yii::t('Demo'),
					'visible'=>!Yii::app()->user->isGuest,
					'items' => array(
						array(
							'label'=>Yii::t('Browse demos'),
							'url'=>array('//demo/index'),
							), 
						array(
							'label'=>Yii::t('Create new Demo'),
							'url'=>array('//demo/create'),
							), 
						array(
							'label'=>Yii::t('Demos'),
							'url'=>array('//demo/index', 'owner' => true),
							), 
	),
				array('label'=>'Logout ('.Yii::app()->user->name.')',
						'url'=>array('/site/logout'),
						'visible'=>!Yii::app()->user->isGuest)
					)
    ) 
)
);

Attention: please be sure to not use this Widget inside the div id="mainmenu" of standard-generated webapps because there seems to be some css inconsistency between yii's default css and superfish's default css.

Also be sure to read the API Documentation of CMenu to fully understand how this Menu works.

Options passed to superfish need to be inserted into the js/superfish.js file.

Change Log

June 2, 2011
  • added style = 'navbar' and style = 'vertical'
  • Codecleanup
January 25, 2010
  • Version 0.2 released
  • possible to pass 'cssFile' option
  • bugfix: added div clear:both after menu
  • possibility to move extension anywhere in file system path
  • added shadow.png and arrows.png from default
  • made the default css-file a lot more beautiful
January 20, 2010
  • Initial release.
15 5
18 followers
8 801 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: User Interface
Developed by: thyseus
Created on: Jan 20, 2010
Last updated: 12 years ago

Downloads

show all

Related Extensions