{% namespace 'blockTypes[' ~ blockTypeId ~ '][fields][' ~ fieldId ~ '][typesettings]' %}
{# Special-case for Matrix at the moment - hopefully will not be needed after core alts #}
{# This is necessary to load our MatrixConfiguratorAlt.js rather than core Matrix JS #}
{% if field.displayName() == 'Matrix' %}
{{ craft.superTable.getMatrixSettingsHtml(field) | raw }}
{% else %}
{{ field.getSettingsHtml() | raw }}
{% endif %}
{% endnamespace %}
{% endset %}
{{ forms.selectField({
label: "Field Layout" | t('super-table'),
instructions: "Set how fields are presented. Table Layout displays fields vertically in a table, Row Layout displays fields horizontally and Matrix layout displays fields like a Matrix field." | t('super-table'),
id: 'fieldLayout',
name: 'fieldLayout',
options: {table: 'Table Layout', row: "Row Layout", matrix: "Matrix Layout"},
value: supertableField.fieldLayout,
}) }}
{{ forms.field({
label: "Configuration" | t,
instructions: "Define the fields your Super Table should have." | t('super-table'),
name: 'config'
}, blockTypeInput) }}
{% if craft.app.getIsMultiSite() %}
{{ forms.selectField({
label: 'Propagation Method' | t('app'),
instructions: 'Which sites should blocks be saved to?' | t('app'),
warning: supertableField.id and supertableField.propagationMethod != 'none' ? 'Changing this may result in data loss.' | t('app'),
id: 'propagationMethod',
name: 'propagationMethod',
options: [
{ value: 'none', label: 'Only save blocks to the site they were created in' | t('app') },
{ value: 'siteGroup', label: 'Save blocks to other sites in the same site group' | t('app') },
{ value: 'language', label: 'Save blocks to other sites with the same language' | t('app') },
{ value: 'all', label: 'Save blocks to all sites the owner element is saved in' | t('app') },
],
value: supertableField.propagationMethod
}) }}
{% endif %}
{{ forms.textField({
label: "New Row Label" | t('super-table'),
instructions: "Enter the text you want to appear in the button to create a new row." | t('super-table'),
id: 'selectionLabel',
name: 'selectionLabel',
value: supertableField.selectionLabel,
placeholder: supertableField.defaultSelectionLabel(),
errors: supertableField.getErrors('selectionLabel')
}) }}
{{ forms.textField({
label: "Min Rows" | t('super-table'),
instructions: "The minimum number of rows the field must have." | t('super-table'),
id: 'minRows',
name: 'minRows',
value: supertableField.minRows,
size: 3,
errors: supertableField.getErrors('minRows')
}) }}
{{ forms.textField({
label: "Max Rows" | t('super-table'),
instructions: "The maximum number of rows the field is allowed to have." | t('super-table'),
id: 'maxRows',
name: 'maxRows',
value: supertableField.maxRows,
size: 3,
errors: supertableField.getErrors('maxRows')
}) }}
{{ forms.lightswitchField({
label: "Static field" | t('super-table'),
instructions: "A static field will only display a single row of fields." | t('super-table'),
id: 'staticField',
name: 'staticField',
on: supertableField.staticField,
}) }}