This issue has been created
There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-8f52b922-05df-42e0-9139-4aa4ce91dcb8 XWIKI-25456 Open

Allow the macro content and a parameter to be offered as alternatives in the Edit Macro dialog

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-ee5a36a8-5d7f-45a3-8a19-98bd23aa80c5 Charpentier Lucas created this issue on 22/Oct/26 10:49
 
Summary: Allow the macro content and a parameter to be offered as alternatives in the Edit Macro dialog
Issue Type: cid:jira-generated-image-avatar-8f52b922-05df-42e0-9139-4aa4ce91dcb8 Improvement
Affects Versions: 17.10.14, 18.8.0
Assignee: Unassigned
Components: Rendering - Code Macro, WYSIWYG Editor
Created: 22/Oct/26 10:49
Priority: cid:jira-generated-image-static-major-722f345f-d507-40b4-ac45-ca1556d587e5 Major
Reporter: Charpentier Lucas
Description:

Some macros take their input either from their content or from a parameter that replaces it. For example, the source parameter of the Code macro highlights a script variable or a page instead of the content. The two are exclusive, but the Edit Macro dialog shows them as unrelated fields: the user can fill both, and nothing says that source replaces the content.

Parameters that are alternatives of each other can already be grouped as one feature with @PropertyFeature, and the dialog then shows them as one choice. The content is not a parameter, so it cannot be part of a feature.

Steps to reproduce

  1. Edit a page with the WYSIWYG editor.
  2. Insert a Code macro.

Expected

The dialog offers to either type the code or pick a source, as one choice.

Actual

The Content field and the Source field, under the advanced parameters, are separate. Filling both is accepted.

Proposal

Allow the content descriptor of a macro to be part of a feature, like a parameter, and show the content and the parameters of that feature as one choice in the Edit Macro dialog.

The WYSIWYG usability audit of the macros found this on the Code macro. The Content and Context macros have a source parameter of the same kind.

 
 

1 update

 
cid:jira-generated-image-avatar-ee5a36a8-5d7f-45a3-8a19-98bd23aa80c5 Changes by Charpentier Lucas on 22/Oct/26 10:51
 
Description: Some macros take their input either from their content or from a parameter that replaces it. For example, the {{source}} parameter of the Code macro highlights a script variable or a page instead of the content. The two are exclusive, but the Edit Macro dialog shows them as unrelated fields: the user can fill both, and nothing says that {{source}} replaces the content.

Parameters that are alternatives of each other can already be grouped as one feature with {{@PropertyFeature}}, and the dialog then shows them as one choice. The content is not a parameter, so it cannot be part of a feature.

h2. Steps to reproduce
# Edit a page with the WYSIWYG editor.
# Insert a Code macro.

h2. Expected
The dialog offers to either type the code or pick a source, as one choice.

h2. Actual
The Content field and the Source field, under the advanced parameters, are separate. Filling both is accepted.

h2. Proposal
Allow the content descriptor of a macro to be part of a feature, like a parameter, and show the content and the parameters of that feature as one choice in the Edit Macro dialog.

h2. Impact found by the audit
The [ WYSIWYG usability audit of the macros found this on |https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/] checks with criterion [C7, alternatives|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Usability%20criteria/] that the Code macro alternative ways to set the same thing are presented as one choice in the Edit Macro dialog . The Content and Context Three macros have a {{source}} parameter of that replaces their content, and the same kind dialog shows it as a separate field in all three:
* [Code|https://design
. xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/code/]: the code to highlight, typed as the content or read by {{source}} from a script variable or a page.
* [Content|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/content/]: the content to render, typed or read by {{source}}.
* [Context|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Macros/context/]: the content to render in the context of another page, typed or read by {{source}}.

The criterion was recorded OK on these macros, with a note pointing to this limitation, since they cannot do better until it is fixed.