Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

List limit

Started by Muut Archive 9 years ago · 3 replies · 536 views
9 years ago

Hi guys,

I'm just currently messing about with Grav and I'm having a look at adding a list of fields a user can add but I want to limit so they can only add like 3. Is this possible? Is there like a size, or max, or limit option I can set on the list field?

Here's my yaml:

YAML

form:
    fields:
        tabs:
            fields:
                banana:
                    type: tab
                    title: Banana
                    fields:
                        header.banana:
                            name: banana
                            type: list
                            label: Banana                        

                            fields:
                                .caption: 
                                    type: text
                                    label: Caption
                                .image:
                                    type: file
                                    destination: '@page:/banana'
                                    accept:
                                        - image/*

---
9 years ago

Nothing is explicitly limiting levels. Your code looks ok to me at first glance.

9 years ago

Sorry, I meant is there a way to limit it. I want it to be limited.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1349 9 years ago
Archive · by Muut Archive, 9 years ago
2 934 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2946 9 years ago
Archive · by Muut Archive, 9 years ago
3 1117 9 years ago