Disable 'Add to area'

Permalink
Hey

I'm busy building a template from scratch.
I am pre-populating some areas. I would like to know if there's a way to disable 'adding to an area' but keep 'edit the area'. IE. I have an image block, but I don't want the user to be able to add another image, just to change the one already there. Any ideas?

 
Mnkras replied on at Permalink Reply
Mnkras
im interested in this as well, anyone find anything?
elyon replied on at Permalink Reply
elyon
There's a method called "setBlockLimit" that you can use. Set the limit to one, for example, and add will disappear once you add the first block. You can still edit it, but you can't add any more.

I haven't tested it, but I think it would work like this:

<?php
   $a = new Area ('Main');
   $a -> setBlockLimit (1);
   $a -> display ($c);
?>
admin replied on at Permalink Reply
Brilliant - works a charm thanks!