Adding only one special Block Type

Permalink
Hey community,

to improve the usability for customers I want to restrict that he can add on a special place only one special Block Type like "Google Maps" or anything else like a Navigation.

I want to restrict that the customer is not able to add any other Block Type like this type I allow in the code.

For example I have a div, and in this div only the Block Type "Auto-Nav" should be added here.

The best possibility to restrict could be:

<?php
$navigation = new BlockType('Auto-Nav');
$navigation->setBlockLimit(1);
$navigation->display($c);
?>

But this is not impossible.

Can anybody help me please?

1 Attachment

 
nebuleu replied on at Permalink Best Answer Reply
nebuleu
With advanced permission, you can restrict blocks types by groups in area.

-> Edit a page
-> clic on the area and select "Set Permissions"
-> "Override Permissions" button
-> "Add Block to Area" permission
-> "Details" tab
-> Customize the blocks by groups

So it should be possible to do it programmatically, but I don't have a ready to use example.
eldios replied on at Permalink Reply 1 Attachment
Hi nebuleu,

thank you so much for you answer.
I tried to follow your instructions,
but I wasn´t able to find the buttons.

I only see whats in the attached screenshot.
Can you please help me again, respectively
give me please more details?

Thank you so much.
eldios replied on at Permalink Reply
Hi, sorry I found it, now...
I was at the wrong permissions,
I have to click to the "Add to" Section

Thank you so much
nebuleu replied on at Permalink Reply
nebuleu
Yes, this permissions settings are linked with an Area, not the page.