C5 5.5.1, Twitter Bootstrap 2.0 and Header Nav global area markup

Permalink 2 users found helpful
Hi Guys

I'm a bit of a C5 newbie but I've managed to convert a template I made with Twitter Bootstrap into a theme for my site. So far so good. I'm now trying to render the navbar. In my theme I have:

<code>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="#">VizualMobile</a>
<?php $a = new GlobalArea('Header Nav'); $a->display(); ?>
</div>
</div>
</div>
</code>

This displays the navigation correctly however how do I get it so that the Header Nav uses the right markup, e.g. <li class="active"> for selected menu options. Is this even possible or do I need to use an autonav template which I've seen in other discussions but not fully understood yet.

Thanks for any help

Tim

 
adamjohnson replied on at Permalink Reply
adamjohnson
Click the block in edit mode and hit Custom Template > Header Nav. That should add the appropriate classes.
tlloyduk replied on at Permalink Reply
Thanks for the quick reply!

Unfortunately although the block has a red dotted outline when I hover over it it doesn't let me click on it. Strange. All the other editable blocks are fine apart from the navbar. I'm wondering if its something in the Bootstrap CSS/JS preventing it from being clickable ?
tlloyduk replied on at Permalink Reply
Ahhh OK, I fixed it

In my bootstrap.css (stock v2.0) on line 2507 I commented out

z-index: 1030;


And now I can click the navbar block. I'm going to play around with the Custom Template next.
tlloyduk replied on at Permalink Reply
Bingo - with a couple of tweaks in

./concrete/blocks/autonav/templates/header_menu.php


It's working perfectly.
adamjohnson replied on at Permalink Reply
adamjohnson
If you changed the custom template in the C5 core, you're going to want to copy it to /blocks with the same path to preserve it when you upgrade later on. Google Concrete5 Overrides to find out more.
tlloyduk replied on at Permalink Reply
Done. Thanks for the tip!
Responsive replied on at Permalink Reply
Responsive
Hi
did you have a problem with class navbar-fixed-top when it came to the C5toolbar as the navbar overlaps it when signed in.

.navbar-fixed-top {
position: fixed;
top: 0;
right: 0;
left: 0;
z-index: 1030;
}
tlloyduk replied on at Permalink Reply
Sorry, this is what you need in elements/header.php

<?php
 $cp = new Permissions($c);
 if($cp->canWrite() && $cp->canAddSubContent()){
  echo('<style type="text/css">.navbar{margin-top:50px;}</style>');
 }
Loader::element('header_required'); ?>
scruft replied on at Permalink Reply 1 Attachment
Hi, this worked perfectly for me in moving the navbar down below the Edit bar.

My problem now is that the navbar is covering the 'Publish' or 'Exit Edit Mode' buttons when you hover over the 'Edit' button on the Edit bar. I've attached a screenshot to explain.
Steevb replied on at Permalink Reply
Steevb
Change the navbar z-index.
tlloyduk replied on at Permalink Reply
the above code should do it
Responsive replied on at Permalink Reply
Responsive
great this worked. many thanks