Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

Reading site.yaml or page frontmatter as a variable in plugin

Started by Claud Rusnac 9 years ago · 1 replies · 651 views
9 years ago

I have a config in my site.yaml file:

TXT
git_changelog: https://domain.com/api/v3/repos/repo/releases

and I want to read it in as a variable in my plugin. I tried to use:

PHP
$config = $grav['config']->get('site.git_changelog');

but get an error.

8 years ago

Listing the error would help, but this works in 1.4.1: $this->grav['config']->value('site.title'). Or, if you need to return it in a static function, for example when called by a blueprint: Grav::instance()['config']->value('site.title').

Suggested topics

Topic Participants Replies Views Activity
Support · by Anna, 17 hours ago
1 49 10 hours ago
Support · by gtx, 1 week ago
4 227 2 days ago
Support · by Paul Hodges, 2 weeks ago
13 277 5 days ago
Support · by Anna, 3 weeks ago
9 335 1 week ago
Support · by TomW, 2 weeks ago
4 188 2 weeks ago