Adding Space So Edit Bar Doesn't Overlap Theme

Permalink 1 user found helpful
Just wanted to post this for anyone looking - a few of my themes have editable areas very close to the top of the theme. In Concrete v5.5 the Edit Bar covers these areas. By adding the code below you can push the theme down (add space to the top) while a user is signed in as either an administrator or as the super user.

<?php
   $u = new User();
   $g = Group::getByName('Administrators');
   if($u->isSuperUser()||$u->inGroup($g)){ 
   ?>
      <div style="min-height: 45px"> </div> 
   <?php  } ?>

cheers!

cannonf700
 
mikefix replied on at Permalink Reply
When I have a spacing issue I've built a simple space block stored in my srapbook. The space block is a content block with a word that has the letters the same colur as the back ground,use it all the time
cannonf700 replied on at Permalink Reply
cannonf700
This is to fix in issue that is new in Concrete5 5.5 when logged in as an administrator the edit bar overlaps the top of the theme. your solution wouldn't work because:
1. There's not an editable area at the top of the theme.
2. It would mess up the whole theme wheather logged in as an Administrator or Not.
3. This is terrible SEO practice and could hurt your rankings.


It would be better if you used Travis's 'Spacer' Block from the Market Place
mkly replied on at Permalink Reply
mkly
Interesting. I'm using this right now. Still trying to figure out the smoothest way.
<?php $up = new Permissions(Page::getCurrentPage()) ?>
<?php if($up->canAdminPage()): ?>
  <div style="height: 50px; font-size: 1px">& nbsp;</div>
<?php endif; ?>


*remove the space from & nbsp;
adamjohnson replied on at Permalink Reply
adamjohnson
Question for core team (or perhaps someone in the know):

Previous versions of C5 added:

body { margin-top: 50px; }


With all the folks having similar issues with the edit bar, what's the reason for not having that style in 5.5?

Apologies in advance for hijacking this thread.
andrew replied on at Permalink Reply
andrew
No this is a legitimate question. I think this was just left out as an oversight. It will be back in in 5.5.1.
adamjohnson replied on at Permalink Reply
adamjohnson
Thanks Andrew. Good to hear.
mkly replied on at Permalink Reply
mkly
lol
c5mix replied on at Permalink Reply
Andrew,
Adding that margin-top back to the body tag means I will now have to go back and readjust all my themes that I just fixed to be compatible with 5.5.0. Pretty frustrating. (Not to mention all the other people that have updated their themes too)

Why cant this just stay the way it is now in 5.5.0?
pvernaglia replied on at Permalink Reply
pvernaglia
Andrew,

Adding that margin-top back to the body tag means I *won't* have to readjust all my themes 'cause I haven't done them yet!

:>
adamjohnson replied on at Permalink Reply
adamjohnson
I'm with Peter. Even though I already fixed it for my themes, some people might think C5 would be "broken" if the top margin wasn't there by default.
NBardales replied on at Permalink Reply 1 Attachment
NBardales
This is what I'm using... Just extract and upload the attached file to
C5_SITE_ROOT/elements

This is a temporary fix, did the trick for me.
BTW, I had already posted this solution before
ConcreteOwl replied on at Permalink Reply 1 Attachment
ConcreteOwl
I overcame the problem by editing the css file that controls the edit bar,
I have attached my revised ccm.app.css as a zip file, this should be extracted and loaded to the concrete/css/ folder (back up your own ccm.app.css file first in case you don't like my version)
It works for me...
NBardales replied on at Permalink Reply
NBardales
I tried your solution but it just turns my 'Edit Bar' into blue-colored pieces... Thanks anyway, I had to disable my own solution because it adds margins even when not in edit mode...
cannonf700 replied on at Permalink Reply
cannonf700
NBardales,
Take a look at the code I originally posted. If you add this to your theme's header.php after the theme's initial wrapper id (it could be anything from 'page' 'wrapper' or 'container' or whatever else the designer felt like naming it) Then the margins are added Only when a user - who has editing privileges - is signed in.
This works great because some site's have users who aren't editors/administrators so they don't want to see the extra margin.
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
NBardales your code works for me too! Nice one!!
I still prefer my own "fiddle" as I don't need to remember to modify the header.php files for all themes,
Anyway it will do until Concrete 5.5.1 is released..
ZeusExMachina replied on at Permalink Reply
ZeusExMachina
Doing it this way should fix the problem in 5.5.0 and stop functioning in 5.5.1.
<?php
$up = new Permissions(Page::getCurrentPage());
if($up->canAdminPage() && APP_VERSION == '5.5.0') { ?>
<div style="min-height: 50px;"> </div>
<?php } ?>


I'd recommend putting it immediately after your opening body tag, so it also pushes down the opening wrapper, but ymmv depending on how your theme is laid out.
dantheman replied on at Permalink Reply
Like your style Zeus, this works
primewaydesign replied on at Permalink Reply
primewaydesign
Thats very helpful.

By the way if someone is looking for editMode space here is the snippet:

<?php  if ($c->isEditMode()) { ?>
      <div style="min-height: 80px">
      <?php  } ?>
      <!-- insert Short height area here -->
      <?php 
      // we use the "is edit mode" check because, in edit mode, the bottom of the area overlaps the item below it, because
      // we're using absolute positioning. So in edit mode we add a bit of space so everything looks nice.
      ?>
      <?php  if ($c->isEditMode()) { ?>
      </div>
      <?php  } ?>
ablecreative replied on at Permalink Reply
nice one bud, nailed that exact problem I was having, thanks
programmieraffe replied on at Permalink Reply
programmieraffe
I came up with this to determine wheter the user can actually see the edit bar. Because sometimes the user has not writePermissions for SIngle Pages but still dashboard access:

$up = new Permissions(Page::getByPath('/dashboard/'));
$isEditBarVisible = (bool) $up->canRead();