Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

The best way to provide site-wide data?

Started by P. Fighter 9 years ago · 4 replies · 1166 views
9 years ago

Hi, I have a bunch of header data in my home template which I need to use in the content of other templates. It's fairly trivial to use page.find within their Twig markup to locate the home page and fetch the data there but it seems a little off...

Is there a way to offer data storage in a similar way to the admin page blueprint forms, but readily available site-wide?

1 reply
9 years ago

The Flex Directory Plugin stores data in the 'user/data' folder and contains Twig templates for you to use as examples how to use that data in your templates.

👍 1
9 years ago

Apparently future versions of Grav (v2?) will have a feature called "content blocks" but there's nothing written about it, so not sure if that will be along the lines of what you are asking about.

Suggested topics

Topic Participants Replies Views Activity
General · by themetman, 23 hours ago
2 40 16 hours ago
General · by Hanns Mattes, 1 week ago
0 121 1 week ago
General · by Karmalakas, 1 week ago
2 185 1 week ago
General · by Hanns Mattes, 3 weeks ago
0 235 3 weeks ago
General · by Dima, 4 weeks ago
1 211 4 weeks ago