Difference between #3 and #6 of
Using the jqueryslidemenu plugin with CMenu

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->registerC
oreScript('jqueryssFile($jqueryslidemenupath.'/jqueryslidemenu.css');
 
Yii::app()->clientScript->registerCssFile($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><!-- mainyslidemenu -->
```
[...]
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.
 
 
[...]
18 1
8 followers
Viewed: 41 813 times
Version: 1.1
Category: How-tos
Written by: Antonio Ramirez
Last updated by: pc131
Created on: Oct 28, 2010
Last updated: 13 years ago
Update Article

Revisions

View all history