2

I am trying to get a value of a text field that is in a Section which is a structure and has multiple entry types. I don't want to use a loop. I tried this and some other variations but does not give me the correct value.

{% set value = craft.entries.section('mySectionHandle').type('entryTypeHandle').myTextFieldHandle.first() %}

What is the correct syntax? Thanks.

3

Try this:

{% set value = craft.entries.section('mySectionHandle').type('entryTypeHandle').first().myTextFieldHandle %}

{{ value }}

Just with your field handle at the end

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.