It’s possible that the
$context already contains an ACF object with the key
acf and your code overwrites it. This will then destroy any subsequent use of
$context['acf'] which Timber (or your Theme) needs.
Try using a different key in your own code (
$context['my_acf']) and see whether that helps, or just do a
$context['acf'] before the first line of code in your example, to see whether it already exists. Timber objects/context already have a lot of data in them, which you might not know already exists.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2022 Advanced Custom Fields.