Documentation on Bard field sets #9411
Unanswered
kyle-cyberprairie
asked this question in
Troubleshooting
Replies: 1 comment
-
Sounds like a bug, what version of Statamic are you on? |
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
-
Hello, I'm unable to access the code and mode variables in my code block field, as described in this documentation
This is what it suggests:
This is what I'm doing in my own template:
The above is used with a Bard field set, simply as:
Where type is 'code_set' in folder sets/code_set.antlers.html
My post blueprint looks like:
And my post content looks like:
When I view the page, I see the empty wrapper around where a code block should be. So I know the template is loading properly.
The only way to get this code to load, is to change the sets/code_set.antlers template like so:
But this means I lose the 'mode' variable, which is the whole reason I'm going through all this trouble.
I've also tried doing
code_field:code
andcode_field:mode
in their respective places, but this again results in a blank output.I have tried using this field template in a regular code field, instead of a Bard set, and it works. This tells me Bard is not able to see the variables within the code field.
Has anyone else encountered this or similar?
Beta Was this translation helpful? Give feedback.
All reactions