There is 1 update.
 
 
XWiki Platform / cid:jira-generated-image-avatar-00987065-17bd-4d21-9a67-42cd69c11367 XWIKI-25456 Open

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

 
View issue   ยท   Add comment
 

1 update

 
cid:jira-generated-image-avatar-aaf7d65e-bac7-42a4-8790-b980087b13e1 Changes by Charpentier Lucas on 22/Oct/26 10:52
 
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 on macro fluidity
The [WYSIWYG usability audit of the macros|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 alternative ways to set the same thing are presented as one choice in the Edit Macro dialog. Three macros have a {{source}} parameter that replaces their content, and the 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 the [cross-macro findings|https://design.xwiki.org/xwiki/bin/view/Proposal/WYSIWYGusabilityofXWikimacros/Cross-macro%20findings/] of the WYSIWYG usability audit of the macros , since they cannot do better until it is fixed.