Is it possible to create a separate YAML file and access it from TWIG? Right now I have a number of entries in my site.yaml file. This is fine, but really this stuff should be in a stand-alone file so that I can GIT it separate from the rest of the changes. So what I was wondering is whether GRAV supports the ability to have other YAML files. That way rather than using site.myparms I would use something like mystandalonefile.myparms?
Archive
Sure you can create a file in user/config/ folder and then access it via twig. For example:
/user/config/mydata.yaml
TXT
foo: bar
Then to display the value in Twig it's just:
TWIG
{{ config.mydata.foo }}
Oh that is completely awesome -- thank you! This product just keeps getting better the deeper you dig. Nicely done!
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 0 | 1359 | 9 years ago | ||
| 2 | 936 | 9 years ago | ||
| 2 | 4066 | 9 years ago | ||
| 1 | 2955 | 9 years ago | ||
| 3 | 1121 | 9 years ago |