CiviMail - Only display "Headers and Footers" if there are headers and footers #15326
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Anecdotally, traditional CiviMail users follow several different tactics for managing templates, such as:
Message Template
(s); each template includes a complete layout. Don't use headers or footers for layout.Header
(s) andFooter
(s) with partial layouts. Don't useMessage Template
s for layout.Header
/Footer
with partial layouts - and then useMessage Template
s for different content.The importance of the "Header" and "Footer" fields vary - if you use approach (1), the headers/footers are distractions and could be completely removed from the system. For (2), they're central part of composition process. For (3), the values should be set but rarely consulted or changed. The current layout represents a compromise (making the fields always-available but not in-your-face).
This change is an optimization for scenario (1) - if you don't use headers/footers, then you should disable them, and the UI will become cleaner.
Additionally, once you have the technique of hiding the field completely, then you can consider moving the fields to a more prominent spot to improve usability for folks in scenario (2). I'm on the fence about some details, so I've left that as a matter for a different PR.
Depends: #15325
Origin: https://lab.civicrm.org/dev/core/issues/1258
Before
The "Headers and Footers" tab is always displayed.
After
The "Headers and Footers" tab is only displayed if there are some headers or footers to choose from. If there aren't any, then the section is omitted.
Comments
There are some other changes that may be good follow-ups: