{% extends "_layouts/cp" %} {% set title = "Fields"|t %} {% includeJsResource "js/fields.js" %} {% includeTranslations "What do you want to name your group?", "Could not create the group:", "Could not create the group:", "Are you sure you want to delete this group and all its fields?", "Could not delete the group.", "Group renamed." %} {% set crumbs = [ { label: "Settings"|t, url: url('settings') } ] %} {% set groups = blx.fields.getAllGroups('id') %} {% if groupId is defined %} {% if groups[groupId] is not defined %} {% exit 404 %} {% endif %} {% set fields = groups[groupId].getFields() %} {% else %} {% set fields = blx.fields.getAllFields() %} {% endif %} {% set sidebar %}
{% endset %} {% set content %}{% if groupId is defined %} {{ "This group doesn’t have any fields yet."|t }} {% else %} {{ "No fields exist yet."|t }} {% endif %}
{% if fields %}{{ "Name"|t }} | {{ "Handle"|t }} | {{ "Type"|t }} | {% if groupId is not defined %}{{ "Group"|t }} | {% endif %}{% for field in fields %} |
---|---|---|---|---|
{{ field.name|t }} {%- if field.required %} {% endif -%} | {{ field.handle }} |
{% set fieldType = blx.fields.populateFieldType(field) %} {% if fieldType %} {{ fieldType.name }} {% else %} {{ field.type }} {% endif %} | {% if groupId is not defined %}{{ field.group.name }} | {% endif %}