How to get rig of "Add to Header Nav" and other blocks

Permalink 1 user found helpful
Hi

Since upgrading to 5.6.1.2 I now get "add to block name" under each editable area. Below is the code im using:

<?php
$a = new Area('Header Nav');
$a->setBlockLimit(1);
$a->display($c);
?>

Any ideas how to get rid of this?

See attached

1 Attachment

johnkidd
 
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
It should be there otherwise you cannot add blocks.

Rony
johnkidd replied on at Permalink Reply
johnkidd
Hey Rony thanks for the reply. I understand intially it should say Add to whatever but once i have added content i dont want it to keep saying "add too" underneath. I have added an attachment
madeforspace replied on at Permalink Reply
madeforspace
Opps sorry yes there is on the top post, sorry.
madeforspace replied on at Permalink Reply
madeforspace
This old post may explain why.

http://www.concrete5.org/community/forums/usage/setblocklimit-not-w...

Hope it helps.
johnkidd replied on at Permalink Reply
johnkidd
thanks for this. Wondering where I add this line of code? define('ENABLE_CUSTOM_DESIGN', false);
ronyDdeveloper replied on at Permalink Reply
ronyDdeveloper
Go to your Roots config folder & find site.php

Open that page with any editor like Dreamweaver or notepad & put it there.

Rony
johnkidd replied on at Permalink Reply
johnkidd
Tried it but didnt seem to work. Is there any order it needs to be in? and do I still leave this bit the same?
<?php
$a = new Area('Test');
$a->setBlockLimit(1);
$a->display($c);
?>
madeforspace replied on at Permalink Reply
madeforspace
This link give a list for white label codes for your site.php.
The code is referenced in there along with loads of other useful stuff.

http://www.concrete5.org/documentation/how-tos/developers/white-lab...

I am not sure if you need to leave the block limit in or not but you can test that quickly.
juliandale replied on at Permalink Best Answer Reply
juliandale
Find the file at /concrete/elements/block_area_footer.php
Copy it to /elements/block_area_footer.php

Update this line (around line 25):
if (!$c->isArrangeMode()) { ?>


Replacing it with this line:
if (!$c->isArrangeMode() && $a->areaAcceptsBlocks()) { ?>


Done!

If you move a block out of the area, then you may have to refresh the page to make the "Add to Area" selector available again.
johnkidd replied on at Permalink Reply
johnkidd
Hi Julian! That worked great! Thank you very much! Just what I was after.