Skip to content

Support toggle preview for choices#451

Merged
javihgil merged 4 commits into5.5from
support-toggle-preview-for-choices
Mar 27, 2026
Merged

Support toggle preview for choices#451
javihgil merged 4 commits into5.5from
support-toggle-preview-for-choices

Conversation

@javihgil
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for toggling preview elements based on the selected value of choice fields (currently implemented for <select> elements) in the admin content editor.

Changes:

  • Added a Twig macro to link preview elements to a “choice toggle” controller and specify which choice values should show the target.
  • Extended the admin preview toggle JS to listen to choice changes and show/hide preview targets based on configured value lists.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
templates/macros/modules_edit.html.twig Adds link_choice_toggle macro to generate data-attributes for choice-based preview toggling.
assets/scripts/admin/content-edit/preview-toggle.js Implements choice-based toggling logic and initializes toggles on page load.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@javihgil javihgil merged commit f3e8f9c into 5.5 Mar 27, 2026
2 of 3 checks passed
@javihgil javihgil deleted the support-toggle-preview-for-choices branch March 27, 2026 08:25
javihgil added a commit that referenced this pull request Mar 27, 2026
* Support toggle preview for choices

* Support toggle preview for choices

* Fix preview-toggle.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants