Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load site variables programmatically? #353

Open
opdavies opened this issue Oct 30, 2017 · 0 comments
Open

Load site variables programmatically? #353

opdavies opened this issue Oct 30, 2017 · 0 comments

Comments

@opdavies
Copy link

I've written some custom Twig filters on my site (https://raw.githubusercontent.com/opdavies/oliverdavies.uk/master/src/FormatTalksBundle/Twig/FormatTalksExtension.php) to format talks data as needed to generate a talks table.

Currently I have to pass in the talk data depending on the context, and the global events data which is stored as site.events in sculpin_site.yml (there are two examples of this on https://raw.githubusercontent.com/opdavies/oliverdavies.uk/master/source/talks.html.twig).

As the latter is always the same, is there a way for me to load it programatically within the Twig template or inject it in, so that I no longer need to pass it as an argument and simplify the templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant