Trying to get a global variable in <head> of _document.twig #594
Unanswered
andrewatduckpin
asked this question in
Q&A
Replies: 1 comment
-
@andrewatduckpin If I understand correctly, we are currently doing this in the theme.php file, where we pass the data to the context: Line 20 in a934c44 Does this help? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've tried a few different ways, but struggling to figure out how I might set a global variable using
Options::addGlobal
and then access that in the_document.twig
file so it applies to all of our pages.I can figure out how to manually add it to context for every entry php file, but I'd prefer to not have to duplicate code, it would be best to apply it once to
_document.twig
Is there a way to create a global option field and output it in the
<head>
of the_document.twig
file?Beta Was this translation helpful? Give feedback.
All reactions