Skip to content

Commit

Permalink
Allow disabling entry propagation for Structure sections
Browse files Browse the repository at this point in the history
Resolves #2386
  • Loading branch information
brandonkelly committed Oct 19, 2018
1 parent e37a58e commit bb334aa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## Unreleased

### Added
- Structure sections now have the ability to disable entry propagation, like Channel sections. ([#2386](https://github.com/craftcms/cms/issues/2386))

### Changed
- `craft\base\Field::supportedTranslationMethods()` now defaults to only returning `none` if the field type doesn’t have a content column. ([#3385](https://github.com/craftcms/cms/issues/3385))
- Craft.EntryTypeSwitcher now fires a `beforeTypeChange` event before swapping the Edit Entry form tabs. ([#3375](https://github.com/craftcms/cms/pull/3375))
Expand Down
2 changes: 1 addition & 1 deletion src/services/Sections.php
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ public function saveSection(Section $section, bool $runValidation = true): bool
}

// Main section settings
if ($section->type !== Section::TYPE_CHANNEL) {
if ($section->type === Section::TYPE_SINGLE) {
$section->propagateEntries = true;
}

Expand Down
4 changes: 2 additions & 2 deletions src/templates/settings/sections/_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
}) }}

{% if craft.app.getIsMultiSite() %}
<div class="type-channel {% if section.type != 'channel' %}hidden{% endif %}">
<div class="field type-channel type-structure {% if section.type == 'single' %}hidden{% endif %}">
{{ forms.checkboxField({
label: 'Propagate entries across all enabled sites?'|t('app'),
instructions: 'Whether entries should be propagated across all the sites the section is enabled in. If this is disabled, each entry will only belong to the site it was created in.'|t('app'),
Expand All @@ -151,7 +151,7 @@
</div>
{% endif %}

<div class="type-structure {% if section.type != 'structure' %}hidden{% endif %}">
<div class="field type-structure {% if section.type != 'structure' %}hidden{% endif %}">
{{ forms.textField({
label: "Max Levels"|t('app'),
instructions: "The maximum number of levels this section can have. Leave blank if you don’t care."|t('app'),
Expand Down

0 comments on commit bb334aa

Please sign in to comment.