This issue has been created
 
 
Confluence / cid:jira-generated-image-avatar-af553ec4-8540-44f9-a998-d8af36b288b9 CONFLUENCE-550 Open

Convert Include Content's shared-block and include-shared-block macros to excerpt and excerpt-include

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-2277eeba-5eba-4c1e-ac12-223f256c138d Christophe CN created this issue on 12/Nov/26 14:45
 
Summary: Convert Include Content's shared-block and include-shared-block macros to excerpt and excerpt-include
Issue Type: cid:jira-generated-image-avatar-af553ec4-8540-44f9-a998-d8af36b288b9 Improvement
Affects Versions: 9.96.7
Assignee: Unassigned
Components: XML
Created: 12/Nov/26 14:45
Priority: cid:jira-generated-image-static-major-952e106c-10ce-4b10-9c77-c2dd68ac588a Major
Reporter: Christophe CN
Description:

The following Macros are not converted :

  • shared-block
  • include-shared-block
  • include-shared-block-inline

They are currently not converted (kept as confluence_shared-block and confluence_include-shared-block, which no macro provides), so the content of the blocks is not displayed at all, neither on their own page nor where they are included.

 

The excerpt and excerpt-include macros already targeted by the filter for Confluence's excerpt and excerpt-include support all of this (named excerpts, hidden, inline, no panel).

 

Proposed conversion:

shared-block shared-block-key="K"            -> {{excerpt name="K"}}...{{/excerpt}}

shared-block with hidden (any value)         -> {{excerpt name="K" hidden="true"}}...{{/excerpt}}

include-shared-block page=P shared-block-key="K"

                                             -> {{excerpt-include 0="<reference of P>" name="K" nopanel="true"/}}

include-shared-block-inline (same)           -> {{excerpt-include 0="<reference of P>" name="K" nopanel="true" inline="true"/}}

nopanel="true" is needed because include-shared-block does not display a panel, while excerpt-include does by default.

suppress-errors has no equivalent and would be reported with markUnhandledParameterValue.

allowAnonymousAccess has the same meaning as allowUnprivilegedInclude (the include skips the view right check on the source page);

as it lowers access control, we suggest reporting it as unhandled and leaving the choice to the administrator.

 

Known differences:

  • include-shared-block without shared-block-key includes the first shared block of the page, whereas excerpt-include without name includes the unnamed excerpt, or the whole page if there is none. The key of the first block of another page is not known at conversion time; we suggest converting without name and reporting it.
  • A key that is not found renders nothing in Confluence, and an error in XWiki.
  • An empty page parameter would be converted like the empty page link of excerpt-include (0="WebHome").

Questions:

  1. Is a conversion of these macros already planned or done elsewhere (e.g. in a non-public module)? The Confluence Migrator Pro already converts Multi Excerpt's macros to the same targets (MultiExcerptMacroConverter, MultiExcerptIncludeMacroConverter).
  1. Is a dedicated converter fine with you (e.g. SharedBlockMacroConverter and IncludeSharedBlockMacroConverter), next to the existing excerpt-include conversion?

We are willing to provide the pull request, with filter tests.