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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Archive

Limit specific (modular) pages

Started by Muut Archive 9 years ago · 2 replies · 454 views
9 years ago

Hello,
I playing a few days now with GRAV and it is an awesome cms :-)
Next step trying making a theme with modular pages.
I'm reading the docs
What i will try to do:

  • adding 3 social media icons to the theme with modular pages (_social).

Question: is it possible limit specific modular pages? In my example max. 3 '_social' pages.

9 years ago

There is no mechanism to tell a page to only support 3 modular childs.

Modular pages are usually pages with different blocks, like in this screenshot.

If you want to add those 3 icons globally, a better option is to have a list field in the theme configuration, which in the next Admin release will support having a "max" attribute (https://github.com/getgrav/grav-plugin-admin/pull/1113) to limit the number of items you can have in a list. An example of a list can be found in Antimatter's "Showcase" modular page: https://github.com/getgrav/grav-theme-antimatter/blob/develop/blueprints/modular/showcase.yaml#L26-L46

9 years ago

Hi @flavioscopes,
Thank you for the useful info.
Good tip for adding this fields in theme config file.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1318 9 years ago
Archive · by Muut Archive, 9 years ago
2 915 9 years ago
Archive · by Muut Archive, 9 years ago
2 4044 9 years ago
Archive · by Muut Archive, 9 years ago
1 2920 9 years ago
Archive · by Muut Archive, 9 years ago
3 1104 9 years ago