Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

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

Started by Claud Rusnac 9 years ago · 1 replies · 708 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.

9 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 complanar, 6 days ago
6 139 15 hours ago
Support · by Rick Beebe, 6 days ago
2 100 2 days ago
Support · by blu3prince, 3 days ago
0 51 3 days ago
Support · by alex, 4 days ago
2 92 3 days ago
Support · by Marcel, 2 weeks ago
1 143 4 days ago