Changes
Title
unchanged
Using the jqueryslidemenu plugin with CMenu
Category
unchanged
How-tos
Yii version
unchanged
Tags
unchanged
Interface, Menu, Widgets
Content
changed
[...]
-----------------
We are going to use it in our main.php layout file for the sake of the example -and because it is the place where we, most of us, will use it.
First we register the required css and js files for our menu.
Put this code inside < head > section < /head > of yii/your_app/protected/views/layout/main.php
```php
// remember that you can actually point to the js files directly if[...]
//Register jQuery, JS and CSS files
Yii::app()->clientScript->registerCoreScript('jqueryssFile($jqueryslidemenupath.'/jqueryslidemenu.css');
Yii::app()->clientScript->registerC
ssFile($jqueryslidemenupath.'/jqueryslidemenu.css'); oreScript('jquery');
Yii::app()->clientScript->registerScriptFile($jqueryslidemenupath.'/jqueryslidemenu.js');
```[...]
```php
<div id="myslidemenu" class="jqueryslidemenu">
<!-- <div id="mainmenu"> -->
<?php $this->widget('zii.widgets.CMenu',array(
'items'=>array([...]
)); ?>
<br style="clear: left" />
</div><!-- m
ainyslidemenu
-->
```[...]
Just make sure that you have the runtime and assets's folders permissions to be writable and correct the index.php file Yii path's to the correct one on your computer.
Also remember that if you use assets to publish your css and js, everytime you edit css or js you must delete subfolder in assets that contains published files, and refresh the page.
[...]