Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
Oliver Scholz Member
@Utis · Joined 8 years ago · 54 posts · 8 topics · 12 reputation
Badges
Recent posts
-
Can twig_vars be used in any file?
· 8 years ago
[Post deleted, because on second reading I realized that you're already aware of onTwigExtensions.]
-
Can twig_vars be used in any file?
· 8 years ago
Interesting! Is this equivalent? So, @finanalyst, did you make the variable protected? It needs to be public.
-
Can twig_vars be used in any file?
· 8 years ago
I had this recently. It seems that you need to use the method $this->grav['twig']->twig->addGlobal(): // ... Inside Plugin Class public $myVar; // You need to enable this in getS
-
Reuse blocks of content on different pages
· 8 years ago
Thinking about this some more, I think I eventually agree: It’s maybe a better compromise to put the data in pages and maybe create a blueprint to edit them in forms. But for me, in this case, it’s mo
-
Reuse blocks of content on different pages
· 8 years ago
Well, the way I understood you, they are part of a sidebar that is displayed on many pages. Maybe it's an edge case and you could argue that it's content. My feeling, however, is that it's something t
-
Reuse blocks of content on different pages
· 8 years ago
I'm myself quite new to Grav, so my advice is probably not worth much. I bookmarked this thread to learn about the answers. And I'm glad I did. Many thanks to @hughbris for sharing those ideas and poi
-
Reference asset in theme configuration file/options
· 8 years ago
Since I just had to research this ... logo: 'theme://images/example.svg' And in Twig: <img src="{{ url(theme_config.logo) }}">
-
Handling resource URLs like "theme://images/..." in PHP
· 8 years ago
I'm embarrassed to be talking to myself (again). But after some more source code diving and head scratching, it seems that I found the solution. Maybe somebody else needs this in the future, so I'm po
-
Extending Twig in theme PHP file
· 8 years ago
Yes! In the class named after the theme inside a method onTwigExtensions, you can add something like: // ... public function onTwigExtensions() { $function = new \Twig_SimpleFunction ('my
-
Handling resource URLs like "theme://images/..." in PHP
· 8 years ago
I hope somebody can give me a hint. Most of the logic is already written. I'd hate to abandon this just because I can't figure out how access theme files in a reliable and maintainable way. So, I trie