Include shared block from same page

Issue #161 resolved
David Csikkel created an issue

Requirement:

I need to be able to set the attribute page of macro Include Shared Block (Inline as well) to same page, where this macro is inserted (used below as page=THIS_PAGE).

Use Case:

On one page, I define “simple data fields” by shared_block macro and “composite fields” by shared_block macro in combination with include_shared_block_inline macro, I use both types of these fields on other pages (include_shared_block and include_shared_block_inline macros). Such page I will use as a template for a new page (copy page) and I would like to avoid repetitive editing of composite fields.

Example:

Page with the definition of an actor with a set of simple fields and some composite fields i.e. field plantuml composed from text and data fields: id, name, description.

Source page:

{macro:shared_block:id=”summary”}This is the definition of the actor {macro:Include_shared_block_inline:page=THIS_PAGE, id=”name”}{/macro}{/macro}

Field Value
ID {macro:shared_block:id=”id”}ret_cust{/macro}
Name {macro:shared_block:id=”Name”}Retail customer{/macro}
Description {macro:shared_block:id=”description”}A customer of the bank, with personal bank accounts{/macro}
PlantUML {macro:shared_block:id=”plantuml”}Person({macro:Include_shared_block_inline:page=THIS_PAGE, id=”id”}{/macro}, “{macro:Include_shared_block_inline:page=THIS_PAGE, id=”name”}{/macro}“, “{macro:Include_shared_block_inline:page=THIS_PAGE, id=”description”}{/macro}“){/macro}

Result:

This is the definition of the actor Customer

Field Value
ID ret_cust
Name Retail customer
Description A customer of the bank, with personal bank accounts
PlantUML Person(ret_cust, “Retail customer”, "A customer of the bank, with personal bank accounts")

Comments (5)

  1. David Csikkel reporter

    Workaround: before page edit you should publish it first, later page renaming will work correctly.

  2. Log in to comment