Feature request: UX improvements for Macros

Enonic version: 7.7.1
OS: Ubuntu


We’re having a recurring problem in projects – that content creators are having problems understanding how to change macros that should have both a “start tag” and “end tag”


The body


We are at a point where we are considering stopping using those, even though they are very useful.


Let developers add a boolean config in the macro xml, which indicates if the macro should have a body.

If the configuration says that it should have a body:

  1. HtmlArea in Content Studio will produce a macro instruction pair ([mymacro] ... [/mymacro] instead of the current default [mymacro /])
  2. The macro dialog should automatically include a body HtmlArea where the content creator can add the body upon creation of the macro, and edit it later together with other macro settings. (They should also still be able to edit the body inline in the parent HtmlArea.)

Thanks guys!
– Tom Arild

1 Like

Hi Tom Arild.
Good news - this already exists. Solution is simply to add a body input inside the config (use textarea for instance).
It will then automatically do what you want.

Here is a screenshot of the “panel macros” that are available on Enonic Market:

After inserting the macro, I get this:

Here is the schema definition for the example above: https://github.com/enonic/app-panel-macros/blob/master/src/main/resources/site/macros/error/error.xml

Current limitation though is that you cannot use htmlarea as the body tag due to macro recursion… afaik

We’ll improve the docs so this is more obvious :slight_smile:

1 Like