{"action":"created","issue":{"url":"https://api.github.com/repos/jarednova/timber/issues/582","labels_url":"https://api.github.com/repos/jarednova/timber/issues/582/labels{/name}","comments_url":"https://api.github.com/repos/jarednova/timber/issues/582/comments","events_url":"https://api.github.com/repos/jarednova/timber/issues/582/events","html_url":"https://github.com/jarednova/timber/issues/582","id":90842290,"number":582,"title":"ACF options page fields not working","user":{"login":"spentacular","id":1043478,"avatar_url":"https://avatars.githubusercontent.com/u/1043478?v=3","gravatar_id":"","url":"https://api.github.com/users/spentacular","html_url":"https://github.com/spentacular","followers_url":"https://api.github.com/users/spentacular/followers","following_url":"https://api.github.com/users/spentacular/following{/other_user}","gists_url":"https://api.github.com/users/spentacular/gists{/gist_id}","starred_url":"https://api.github.com/users/spentacular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spentacular/subscriptions","organizations_url":"https://api.github.com/users/spentacular/orgs","repos_url":"https://api.github.com/users/spentacular/repos","events_url":"https://api.github.com/users/spentacular/events{/privacy}","received_events_url":"https://api.github.com/users/spentacular/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jarednova/timber/labels/needs-investigation","name":"needs-investigation","color":"d4c5f9"},{"url":"https://api.github.com/repos/jarednova/timber/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-06-25T03:34:32Z","updated_at":"2015-07-08T13:31:50Z","closed_at":null,"body":"I'm trying to add a few of the fields from the options page to my footer.\r\n\r\nCurrently, in my `footer.php`:\r\n\r\n```php\r\n$context['options'] = get_fields('options');\r\nTimber::render('footer.twig', $context);\r\n```\r\n\r\nBut when I try to reference anything using the `{{options.[field]}}` syntax, I can't get it to work.\r\n\r\nI'm using ACF Pro, and the options page is included now, instead of a separate plugin. Could that be causing the error?\r\n\r\nI've also tried referencing via the syntax [here](http://www.advancedcustomfields.com/resources/get-values-from-an-options-page/) (specifically, using 'option' instead of 'option'), but no luck.\r\n\r\nAny ideas?\r\n\r\nThanks for the incredible work on this as well!"},"comment":{"url":"https://api.github.com/repos/jarednova/timber/issues/comments/119579508","html_url":"https://github.com/jarednova/timber/issues/582#issuecomment-119579508","issue_url":"https://api.github.com/repos/jarednova/timber/issues/582","id":119579508,"user":{"login":"jarednova","id":1298086,"avatar_url":"https://avatars.githubusercontent.com/u/1298086?v=3","gravatar_id":"","url":"https://api.github.com/users/jarednova","html_url":"https://github.com/jarednova","followers_url":"https://api.github.com/users/jarednova/followers","following_url":"https://api.github.com/users/jarednova/following{/other_user}","gists_url":"https://api.github.com/users/jarednova/gists{/gist_id}","starred_url":"https://api.github.com/users/jarednova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jarednova/subscriptions","organizations_url":"https://api.github.com/users/jarednova/orgs","repos_url":"https://api.github.com/users/jarednova/repos","events_url":"https://api.github.com/users/jarednova/events{/privacy}","received_events_url":"https://api.github.com/users/jarednova/received_events","type":"User","site_admin":false},"created_at":"2015-07-08T13:31:49Z","updated_at":"2015-07-08T13:31:49Z","body":"@anugupta -- thanks for that! a nice piece of defensive programming by @elliotcondon.\r\n* * *\r\nTo @spentacular's question, if this is going to appear on every page, my recommendation is to put it in `functions.php` in the context filter:\r\n```php\r\n/* functions.php */\r\nadd_filter( 'timber_context', 'mytheme_timber_context'  );\r\n\r\nfunction mytheme_timber_context( $context ) {\r\n    $context['option'] = get_fields('option');\r\n}\r\n```\r\n\r\nThis will now be available to every template (as long as it receives the `Timber::get_context` array) so then on your `base.twig` you could... \r\n\r\n```twig\r\n{# base.twig #}\r\n        <footer><h4>{{option.footer_message}}</h4></footer>\r\n    </body>\r\n</html>\r\n```\r\n"}}