Forum

Thread tagged as: Problem, Suggestions

Max options for Blocks, Categories and Relationships

Hello Drew,

In perch podcast 57 at 23:19 you mentioned having added "max options for Blocks, Categories and Relationships" to control "how many items can be added".

tl;dr - I can't find this functionality - question: is it not implemented in Perch (or runway) ?

In a previous thread I asked for this functionality,
Forum Thread about 'max=' for a block And I was pleased you were going to add it to Perch/Runway. But now I need it and I can't seem to find it anywhere in the docs. Only in relationships there is a mention of the max= attribute.

I have tried some examples in Perch, but the 'max' attribute for <block> or <blocks> doesn't seem to work. James Harrison mentioned you could do this: <perch:if id="perch_item_index" match="lt" value="3"> blocks code </perch:if> But that doesn't solve my use case, I want to restrict the user of adding any more block(s) than the max number.

Questions: 1. Did I misinterpret this from the Perch Podcast ? 2. has it since been removed ? 3. or is there a way to do it, which I haven't discovered yet ?

thanks, Rene

René Banus

René Banus 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

It should be max="3" on repeaters, categories and relationships. I don't believe it's implemented for blocks.

Thanks, that clears the issue.

If you are thinking of supporting it, please support it on the <block> level, not the <blocks> level.

René