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.

Forms & Blueprints

Does grav have the concept of relational links (many to many, one to many, etc.)?

Started by Jason 5 years ago · 2 replies · 745 views
5 years ago

I'm currently using the headless CMS Cockpit, which has the content field type collectionLink, which is a relational field that allows a content author to choose from all of the content entries of the defined content type and select one or multiple.

The headless CMS Directus, allows for one to many, many to one, etc. relational linking, that actually indicates the relationship on both content items linked.

This feature is super helpful for documentation sites, as there is a hierarchy of related content. Does Grav have anything similar or related?

5 years ago

There's a Pages field, which supports multiple option. Although assigning one page to another won't link them as you imagine. That other page won't know it's linked to the first one, unless you also mark it as linked. AFAIK..

5 years ago

@jasonday, Grav is a flat-file CMS and hence only knows about flat files...

Having said that, whatever valid data you can define in JSON or Yaml can be loaded by Grav. That doesn't mean that Grav itself does anything with it, but a custom plugin, or Twig template might interpret the logic in the data.

Or, you could add an RDBMS to store the relations and access the db from a custom plugin.

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Ton Haarmans, 5 years ago
13 1138 4 months ago
Forms & Blueprints · by Hugo Oliveira, 5 months ago
0 61 5 months ago
Forms & Blueprints · by Flachy Joe, 6 months ago
9 135 6 months ago
Forms & Blueprints · by Augustus, 7 months ago
7 110 7 months ago
Forms & Blueprints · by Julien, 7 months ago
10 129 7 months ago