-
Notifications
You must be signed in to change notification settings - Fork 683
Feature/cms 1411 thumb alignment setting for card view designers #17193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
brandonkelly
merged 20 commits into
5.8
from
feature/cms-1411-thumb-alignment-setting-for-card-view-designers
Jun 8, 2025
Merged
Feature/cms 1411 thumb alignment setting for card view designers #17193
brandonkelly
merged 20 commits into
5.8
from
feature/cms-1411-thumb-alignment-setting-for-card-view-designers
Jun 8, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…card-view-designers
…card-view-designers # Conflicts: # src/templates/_includes/forms/button.twig # src/templates/_includes/forms/buttonGroup.twig # src/web/assets/cp/dist/cp.js # src/web/assets/cp/dist/cp.js.map # src/web/assets/cp/dist/css/cp.css # src/web/assets/cp/dist/css/cp.css.map # src/web/assets/cp/src/js/FieldLayoutDesigner.js # src/web/assets/garnish/dist/garnish.js # src/web/assets/garnish/dist/garnish.js.map
[ci skip]
[ci skip]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
For field layout designers that use the card view designer, the selection of the field that should serve as the card thumbnail has been moved out of the layout element’s disclosure menu to a separate dropdown field.
It’s complemented by a new “Thumbnail alignment” button group, which allows you to select whether the thumbnail should be aligned to the start or end of the card (left or right in LTR languages, respectively). The default alignment is “end.” Selecting an alignment updates the card preview in the card view designer.
For field layouts for element types that have
hasThumbs()set totrue, the “Thumbnail alignment” buttons are shown even if no field is selected from the “Use for element thumbnails” dropdown. For those field layouts, the first and default option reads “Default”, whilst in other cases it’s “None” (indicates no thumbnail should be used for the card).For the field layouts that don’t use card view designer, the selection of the field that should serve as the card thumbnail remains in the disclosure menu (e.g. Globals).
@brandonkelly, LMK if you want to keep it like this for the field layouts that don’t use card view designer. I could change it to still have the alignment buttons, but as there’s no preview, you wouldn’t see that update until you save & view the actual element card.
Added:
src/base/Thumbable::getThumbAlignment()src/helpers/Cp::buttonGroupHtml()src/helpers/Cp::buttonGroupFieldHtml()src/models/FieldLayout::getCardThumbAlignment()src/models/FieldLayout::setCardThumbAlignment()Updated
Craft.Listbox,_includes/forms/button.twigand_includes/forms/buttonGroup.twigto respectreadOnlyconfig. This required a change inGarnishto allow certain buttons to have atabindexset.Related issues
cms-1411