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.

Support

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

Started by Claud Rusnac 9 years ago · 1 replies · 571 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 Thomas, 1 week ago
2 53 9 hours ago
Support · by Anna, 3 days ago
2 59 12 hours ago
Support · by Justin Young, 13 hours ago
1 30 13 hours ago
Support · by Duc , 1 week ago
2 65 5 days ago
Support · by Colin Hume, 1 week ago
2 56 5 days ago