Sidebar on the left or right side of the browser. slides in on mouse over and slides out automatically when mouse leaves the sidebar.
Around a week ago i uploaded leftsidebar in yiiframework.com. That can be used to display sidebar on left side of the browser. Similarly another extension rightsidebar can be used to display sidebar on right side of the browser.
I created this extension to avoid the use of two different extentions for displaying sidebars on left and right side of browser. This extension can be configured to use either left or right side.
This sidebar can be used to display menu or some other useful things in your application.
Requirements ¶
Yii 1.1.12
Installation ¶
Copy the folder 'sidebar' to protected/extensions
Usage ¶
For Detailed Usage Please Click Here.
Usage ¶
You have to specify 'position' to be left or right. If you don't specify it will display in right side.
$this->beginWidget('application.extensions.sidebar.Sidebar', array('title' => 'Menu', 'collapsed' => true, 'position'=>'left'));
//here you display a cmenu or gridview or any other thing as per your needs.
//or you can simply display contents form variable like below
echo $var;
$this->endWidget();
Demo ¶
A demo sidebar available at this location.
Update ¶
if you need to have arrow marks as in Demo you need to modify the files as specified at this comment.
For more Details about this extension and usage click here.
Finally ¶
I am waiting for valuable comments. Drop your comments below whatever it can be.
I have created an youtube video on Yii framework view it and review it at https://www.youtube.com/watch?v=G7_2tdZRQnE
Resources ¶
leftsidebar and rightsidebar extensions from yiiframework.com.
show ajaxLink
Hello,
I think that both extensions together is better.
Only some small corrections.
Sidebar.php has lost 2 lines, 1 of each side (ajaxLink):
In left part:
echo '<div class="title">' ; echo CHtml::encode($this->title); echo CHtml::ajaxLink('>>', '', false, array('id' => 'toggle_left_menu')); echo '</div>';
in the right part.
echo '<div class="title">' ; echo CHtml::encode($this->title); echo CHtml::ajaxLink('>>', '', false, array('id' => 'toggle_right_menu')); echo '</div>';
In leftsidebar.js line 64 change Pin and Hide.
And finally in rightsidebar.css line 61 change float to right.
regards
Re:show ajaxLink
Hi, rahif if we need to have arrow marks then we can modify the code as you suggest. But my clients didn't need that option. So, i did like this. Thanks for your interest on this. This will be helpful for someone.
for more details click here.
Sidebar is not showing when 'collapsed' => true,
I tried your extension, but faced problem on 'collapsed' => true. What could be a possible solution?
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.