13

I've created a plain text-field and added this field into a section. I then created an entry and filled it with content.

I know I can output the content of the field in my template with {{ entry.field_handle }}, but is it also possible to display the field name? If so, how?

1 Answer 1

15

You can get any field with craft.fields, which returns a FieldModel:

{% set field = craft.fields.getFieldbyHandle('field_handle') %}
{{ field.name }}
{{ field.instructions }}

.

Note: There is no documentation on the FieldModel yet, but if you want to know more, take a look at craft/app/models/FieldModel.php.

This is a list of all attributes supported by the Model:

  • groupId
  • name
  • handle
  • context
  • instructions
  • required
  • translatable
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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