Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25456

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

    XMLWordPrintable

Details

    • Unknown

    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.

      Impact found on macro fluidity

      The WYSIWYG usability audit of the macros checks with criterion C7 alternatives 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: the code to highlight, typed as the content or read by source from a script variable or a page.
      • Content: the content to render, typed or read by source.
      • 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 the cross-macro findings of the WYSIWYG usability audit of the macros, since they cannot do better until it is fixed.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Lucas C Charpentier Lucas
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: