Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.
Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.
I was going to answer the same about IValidator of T, but would be great to have more human friendly UI -> that dropping is enabled only for allowed blocks. this might involve spelling some dojo magika..
Hi guys,
Yes sorry I should've expanded on my question really.. was more wondering whether there were a way to remove the "Create a new block" option within the content area - and hence restricting it down to only allow shared blocks essentially.
Thanks
Hi David.
Other Episerver friends of ours has done something you'll find useful.
Try and have a look here:
Please note; it does not mean editor simply can't create a new block through the Asset pane, under "For This Page".
/Casper Aagaard Rasmussen
Yes you could do something like this
[AllowedTypes(new []{ typeof(XBlock), typeof(YBlock)})]
public virtual ContentArea MainContentArea { get; set; }
or
solution is to add an interface to the block:
public class SliderBlock : INotAvailableContent {}
The interface and descriptor:
public interface INotAvailableContent { }
[UIDescriptorRegistration]
public class NotAvailableContentDescriptor : UIDescriptor<INotAvailableContent> { }
The ContentArea defintion:
[AllowedTypes(RestrictedTypes = new[] { typeof(INotAvailableContent) })]
public virtual ContentArea MainContentArea { get; set; }
Now you can easy add INotAvailableContent for ContentAreas and blocks to avoid them.
Hey David
This may be exactly what you are looking for:
https://gregwiechec.com/2016/05/how-to-disable-creating-new-blocks-in-content-area/
David
Hi guys,
Wondering if anyone has come across a method of restricting a content area to only allowing global/shared blocks in the content area.
Any help would be appreciated.
Thanks