Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

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

Started by Jason 6 years ago · 2 replies · 991 views
6 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?

6 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 Japhy, 1 week ago
2 198 1 hour ago
Forms & Blueprints · by FrViPofm, 4 weeks ago
5 313 4 weeks ago
Forms & Blueprints · by Ton Haarmans, 6 years ago
13 2303 8 months ago
Forms & Blueprints · by Hugo Oliveira, 9 months ago
0 765 9 months ago
Forms & Blueprints · by Flachy Joe, 10 months ago
9 847 10 months ago