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?

1db
View Replies: View Best Answer
Steevb replied on at Permalink Reply
Steevb
Is the bar fixed or absolute?

Which version of C5 are you using?

Up to 5.6.0.2 page was moved down with body tag
<style type="text/css">body {margin-top: 49px !important;} </style>


5.6.1 uses html
<style type="text/css">html {margin-top: 49px !important;} </style>


So easiest option would be to update C5 and have a fixed bar, not absolute.
1db replied on at Permalink Reply
1db
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.
Steevb replied on at Permalink Best Answer Reply
Steevb
I used 'fixed', but I don't assign 'top'.

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 }   ?>
1db replied on at Permalink Reply
1db
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.
Steevb replied on at Permalink Reply
Steevb
Good news...

...You did say php solution

Kalinihta
1db replied on at Permalink Reply
1db
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?
Steevb replied on at Permalink Reply
Steevb
Of course Watson.

Put the snippet in header.php, maybe just before closing head tag.
JayCadilak replied on at Permalink Reply
You, sir, are excellence. Much appreciated!