eZ Community » Forums » Developer » eZDemo + bootstrap + javascript
expandshrink

eZDemo + bootstrap + javascript

eZDemo + bootstrap + javascript

Tuesday 17 July 2012 12:54:46 pm - 2 replies

hi all,

I yesterday tried to add a drop-down menu to the ezdemo design using javascript from bootstrap as seen on 

http://twitter.github.com/bootstrap/javascript.html#dropdowns

I added an include to page_header.tpl via

 {include uri='design:page_header_teamroom.tpl'}

and added to the template

 <ul class="nav nav-pills">
 
 
  <li class="active"><a href="#">Regular link</a></li>
 
  <li class="dropdown" id="menu1">
 
    <a class="dropdown-toggle" data-toggle="dropdown" href="#menu1">
 
      Dropdown
 
      <b class="caret"></b>
 
    </a>
 
    <ul class="dropdown-menu">
 
      <li><a href="#">Action</a></li>
 
      <li><a href="#">Another action</a></li>
 
      <li><a href="#">Something else here</a></li>
 
      <li class="divider"></li>
 
      <li><a href="#">Separated link</a></li>
 
    </ul>
 
  </li>
 
</ul>
 
 
 
<!--{ezscript_require( 'jquery-1.7.2.min.js' )}-->
 
{ezscript_require(array( 'ezjsc::jquery' ) )}
 
{ezscript_require( 'bootstrap-dropdown.js' )}
 
 
 
<script type="text/javascript">
 
{literal}
 
    $(document).ready(function () {
 
        $('.dropdown-toggle').dropdown();
 
    });
 
{/literal}
 
</script>

I see the text in the menu, but the javascript does not work. I'd be very glad for any guidance concerning this topic.

Best wishes from Bamako

Sebastian

Friday 21 September 2012 12:52:05 pm

Hello,

You need to modify extenstion/<name>/design/<name>/less/bootstrap.less.
As you can see dropdown and some other less files have been commented.
Uncomment them, recompile the bootstrap.less to bootstrap.css.

Regards.

Friday 21 September 2012 6:40:35 pm

Gosh, I was wondering. Many thanks for the hint Guillaume. It did the job.

Best wishes from Mali

Sebastian

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from