Method to access values without custom field #2
furioursus
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It’d be great (especially when setting up a project) to be able to get at the values of my various design token blocks without using a custom field at times. I know I could replicate the field values elsewhere, but it seems like it'd be a good idea to have the design tokens be the source of truth in these matters.
Essentially, I'd love to be able instead of just writing
{{ entry.myTokenField.get('text') }}
when I have a custom field set, instead be able to write{{ craft.designTokens.collection('blocks').group('red').get('text') }}
where I have a file calledblocks.json
that has an object namedred
and a key namedtext
.Beta Was this translation helpful? Give feedback.
All reactions