Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

AllowedTypes - Extending functionality

$
0
0

Hi everybody.

I have a site which contains Page -> Blocks (Level 1) -> Blocks (Level 2)
And it works quite well - however, I'm running into a situation where I'd like to extend AllowedTypes for a block ContentArea.

I've seen that AllowedTypes are basically just an ValidateAttribute, so I should be able to build my own additional validation as well to determine valid blocks;
however - that means the blocks that are invalid according to my logic are still shown in the cms editor when creating a new block for a Content Area.

So I'm looking for whether it's possible to extending/overrule the function that lists Allowed blocks or extending the AllowedTypes IsValid functionality?

Basically - what I'm after is that some Block types are only valid on some Level 2 if they're on a specific Page. And if I'm going to solve that using AllowedType, I'll need to duplicate my Level 1 blocks or start assigning the AllowedTypes programmatically.
So I'm thinking simply adding an additional validation would be easiest, *if* I could also remove them from the shown list in cms edit.


Viewing all articles
Browse latest Browse all 9076

Trending Articles