I’m using Forge Custom UI for macros and noticed some strange behavior. Inline macros render correctly when they appear directly on a page, but when the same macro is nested inside a rich macro (for example, inside a Panel), the display is different because it uses the ADF export (with export type other). This results in inconsistent rendering of the same macro depending on where it’s placed, which doesn’t seem logical especially that the not nested case uses react but the adf export is limited.
Is there any known solution or workaround for this inconsistency?
Hi @SamiBelHajHassine just to clarify, the EAP linked above is to support embedded Forge content (i.e macros within macros). This is semi-related to nested macros; in that it allows for a 1-level embedding of forge content inside parent forge content; but may not be applicable for the scenario you described above.
Your use case looks to be with rendering your custom ui macro inside a native Confluence panel. I think for this scenario we should can raise this with our Confluence page experience team to see if this is a known issue or if there are any workarounds from your end and/or easy fixes from their end.
I’ll ping the relevant team and get them to respond here once they have investigated.
We have had a report from a customer that our app, when rendered on a page works fine, but when that page is then included in another page using the include content macro, that our app renders using our adfExport function (which in our case shows a message indicating that we don’t support PDF/Word exports, as our app is heavily client-side interactive).
Reading through this thread, there was a suggestion that a Custom UI macro rendered in a panel isn’t the same use case as the macro-in-macro case that the EAP was for.
Would a Custom UI macro inside the include content macro be expected to render using adfExport, or is this another case like the panel one that we should raise with the Confluence experience team to see if there is a workaround?
We think we may have found a workaround, although its still unclear to us exactly how/why this seems to work.
The problem, if I understand correctly, is that a Forge macro embedded inside another Forge macro will render using that embedded macro’s adfExport function (which in our case is essentially a message saying “sorry, no export…”).
And judging by the icon of the built-in “Include Content (Include page)” macro in Confluence cloud, it would appear that this macro was re-implemented in Forge:
…hence the issue.
Oddly, what we have found that works (at least in our initial testing) is this:
In the source page (containing the Forge macro that will later be included in another page), wrap the Forge macro in an “Excerpt” macro
On the target page, if you now use the Include content macro to include the source page…everything works?
It seems that by separating the two Forge macros (the “embedder” - Include Content in this case, and the “embeddee” - our app) by an non-Forge macro (“Excerpt”), the curse is broken and the embedded Forge macro renders as normal.