Fixed Top Navbar

Permalink 1 user found helpful
Does anyone know how to over ride my css for a top fixed nav bar. I am having an issue when I go to edit. It will mask the c5 toolbar.

Basically, when the user is logged in I want the bar to have margin top 42px.

Any ideas? I am a PHP noob. So any help would be appreciated.

Thanks in advance.

ahein624
View Replies: View Best Answer
hostco replied on at Permalink Reply
hostco
Hello,

You can use this

<?php if ($c->isEditMode()) { ?>
<div style="width:100%;height:42px;display:block;clear:both"></div>
<?php }?>
ahein624 replied on at Permalink Reply
ahein624
That would be good if I needed it for editing. What about being logged in ?
mhawke replied on at Permalink Best Answer Reply
mhawke
The toolbar shows up when the current user has permission to edit something on the page so you really want to check if they have editing permission and then add some space. Try this...

<?php
$pageObject = Page::getCurrentPage();
$po = new Permissions($pageObject);
if ($po->canWrite()){?>
<div style="width:100%;height:49px;display:block;clear:both"></div>
<?php }?>


Also, I think the spacing needs to be 49px high if I'm not mistaken.
ahein624 replied on at Permalink Reply
ahein624
Perfect! Thanks.
GeraldSchandl replied on at Permalink Reply
I use UIKIT-Framework with Concrete5 and i apply a fixed navbar with javascript. So i just use the z-index to fix the concrete navbar overlay!

Works perfect and is easy.

<?php
      $c = Page::getCurrentPage();
      $cp = new Permissions($c);
      if (is_object($cp) && ($cp->canWrite() || $cp->canAddSubContent() || $cp->canAdminPage())) { ?>
        <style type="text/css">
        .uk-navbar {z-index: 999;}
        </style>
    <?php }   ?>


May someone could use this.

Have a nice day.
mhawke replied on at Permalink Reply
mhawke
If there are editable areas near the top of the page, does a z-index solution make it impossible to edit these areas because they are under the c5 toolbar?
siton replied on at Permalink Reply
siton
Please add tags: uikit , uikit Sticky navigation, Sticky navigation
(For future searches about this issue - this is usefull post for uiKit users)