{{ forms.field({
label: "Configuration"|t('app'),
instructions: "Define the types of blocks that can be created within this Matrix field, as well as the fields each block type is made up of."|t('app'),
name: 'config',
errors: matrixField.getErrors('blockTypes'),
}, blockTypeInput) }}
{% if craft.app.getIsMultiSite() %}
{{ forms.selectField({
label: 'Propagation Method'|t('app'),
instructions: 'Which sites should blocks be saved to?'|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: matrixField.propagationMethod
}) }}
{% if matrixField.id and matrixField.propagationMethod != 'none' %}
{% js %}
(function() {
var showingWarning = false;
$("#{{ 'propagationMethod'|namespaceInputId }}").on('change', function() {
if ($(this).val() !== '{{ matrixField.propagationMethod }}') {
if (!showingWarning) {
$('', {'class': 'warning', text: "{{ 'Applying this change to existing blocks can take some time.'|t('app')|e('js') }}"})
.appendTo($("#{{ 'propagationMethod-field'|namespaceInputId }}"));
showingWarning = true;
}
} else if (showingWarning) {
$("#{{ 'propagationMethod-field'|namespaceInputId }} .warning").remove();
showingWarning = false;
}
});
})();
{% endjs %}
{% endif %}
{% endif %}
{{ forms.textField({
label: "Min Blocks"|t('app'),
instructions: "The minimum number of blocks the field is allowed to have."|t('app'),
id: 'minBlocks',
name: 'minBlocks',
value: matrixField.minBlocks,
size: 3,
errors: matrixField.getErrors('minBlocks')
}) }}
{{ forms.textField({
label: "Max Blocks"|t('app'),
instructions: "The maximum number of blocks the field is allowed to have."|t('app'),
id: 'maxBlocks',
name: 'maxBlocks',
value: matrixField.maxBlocks,
size: 3,
errors: matrixField.getErrors('maxBlocks')
}) }}