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.

General

The best way to provide site-wide data?

Started by P. Fighter 8 years ago · 4 replies · 845 views
8 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?

8 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
8 years ago

See also my answer to a similar question recently, where I store reusable components in subdirectories of pages/components and then the dreaded page.find()

👍 1
8 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 Jerry Hunt, 4 days ago
2 80 9 hours ago
General · by pamtbaau, 15 hours ago
1 51 14 hours ago
General · by Andy Miller, 1 day ago
0 45 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago