How do you accommodate a fixed navigation bar in Concrete?
Permalink
I have a design that has a fixed bar across the top...but this conflicts with the Concrete edit bar when you're logged in. Is there some graceful way of making the fixed bar push down while in edit mode so that it doesn't hide the edit bar?
I'm using 5.5.2.1, and the navigation bar in my design has position:fixed. But while the body may have a top margin of 49px, my navigation bar also has a fixed position of top:0, the same as the ccm toolbar. It also has a z-index assigned to it, so it rests atop the toolbar, which is then invisible.
I was hoping someone had come across this problem before, and figured out a PHP solution to moving the design down or changing the CSS.
I was hoping someone had come across this problem before, and figured out a PHP solution to moving the design down or changing the CSS.
I used 'fixed', but I don't assign 'top'.
With z-index I sometimes change it in edit mode:
Or maybe:
Or even:
With z-index I sometimes change it in edit mode:
<?php $c = Page::getCurrentPage(); $cp = new Permissions($c); if (is_object($cp) && ($cp->canWrite() || $cp->canAddSubContent() || $cp->canAdminPage())) { ?> <style type="text/css"> nav{z-index:0} </style> <?php } ?>
Or maybe:
<?php $c = Page::getCurrentPage(); $cp = new Permissions($c); if (is_object($cp) && ($cp->canWrite() || $cp->canAddSubContent() || $cp->canAdminPage())) { ?> <style type="text/css"> nav{position:relative} </style> <?php } ?>
Or even:
<?php $c = Page::getCurrentPage(); $cp = new Permissions($c); if (is_object($cp) && ($cp->canWrite() || $cp->canAddSubContent() || $cp->canAdminPage())) { ?> <style type="text/css"> nav{top:49px} </style> <?php } ?>
Wow. In PHP terms, that's like the Iliad in the original Greek, and I'm still working my way through Dr. Seuss.
But taking out the specification for "top: 0" did the trick. Thanks.
But taking out the specification for "top: 0" did the trick. Thanks.
Good news...
...You did say php solution
Kalinihta
...You did say php solution
Kalinihta
I did indeed. I was just hoping it would be something more elementary. What? That IS elementary? Oh, dear...
BTW: where would I put that snippet?
BTW: where would I put that snippet?
Of course Watson.
Put the snippet in header.php, maybe just before closing head tag.
Put the snippet in header.php, maybe just before closing head tag.
You, sir, are excellence. Much appreciated!
Which version of C5 are you using?
Up to 5.6.0.2 page was moved down with body tag
5.6.1 uses html
So easiest option would be to update C5 and have a fixed bar, not absolute.