2

I am trying to get the label from an object instead of its value to use as the automatic title for my entries.

For example: I have an entry that contains a dropdown with the handle exampleOne with values Item One, Item Two, etc. In the title format field I enter {{object.exampleOne}} and it outputs itemOne. It appears craft is outputting the "value" of that dropdown but I instead want it to output the "Label". Is this possible? I looked through the docs and did some googling but to no avail. I also tried {{ object.exampleOne|label }} but it failed to rename the entries.

Thanks in advance for any assistance!

1

Here's the documentation you're looking for: Working with Dropdown Field Data

You can get the label by adding .label, so you'll end up with {{object.exampleOne.label}}

The dropdown field contains a few properties:

  • label
  • selected
  • value (default)
  • valid
1
  • Perfect! Thank you. – Matt Apr 15 at 20:46

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.