Can a Space defined variable overwrite excerpt-include variable from template space
Asked by Erick van Rijk:

Hello everybody,

I'm currently working on getting our technical documentation in Confluence server and a large portion of the documentation is boilerplate text that will be the same over multiple projects.

The current idea I have (originating from here) is to use excerpt-include or include page to include multiple template pages (from a template Space (TS)) to build up a project page.

One thing that is not working correctly is that I would like to have a project/space defined variable (defined in _ConfluenceInclusions) that is present in this template text and will be automatically updated using the space variable.

Example:

**Template page (device_page) in Template Space (TS):**

This is a test page and refers to the device: _device_name

**Project page in Project Space (PS):**

This information is about a brand new device:

    {excerpt-include:TS:device_page|nopanel=true}

The idea would be to replace the _device_name with a local space variable so the boilerplate code can be the same for every instance of this template but still match the local device reference.

I did find the Keysight Include Content plugin but its kind of difficult to use for non technical users.

While browsing the documentation and community I did not find exactly what I am looking for.

Any ideas / suggestions?

Thanks!


Answers:
author: Erick van Rijk
body: Still haven't found an exact solution to this.

[projectdoc Toolbox](https://www.smartics.eu/confluence/x/1YEp) Seems to have some items that might work. But the hurdle seems to be that I want to use per scope variables inside template files.

<https://community.atlassian.com/t5/Confluence-questions/How-can-I-use-variables-to-define-Space-properties-such-as/qaq-p/619160>

Q: [@Robert Reiner _smartics_](/t5/user/viewprofilepage/user-id/853340) Could you advise?  

comments: author: Robert Reiner _smartics_
body: There are a few solutions to the problem to [transclude](https://www.smartics.eu/confluence/x/zoQoAg) content from another page with the *projectdoc Toolbox*.

Straight forward would be to create a section (using the [Section Macro](https://www.smartics.eu/confluence/x/ugNk)) and add text with placeholders, e.g. in a dedicated template space:

"This is the text of *${Product Name}* that ..."

Note the placeholder with name "*Product Name*".

From a [projectdoc Document](https://www.smartics.eu/confluence/x/rgDG) (may also be a plain Confluence page) within another space (e.g. the *Super Tool* space) you could use the [Transclusion Macro](https://www.smartics.eu/confluence/x/_QJk) and replace the placeholders with properties provided as [space properties](https://www.smartics.eu/confluence/x/8YXSAw) (see [Using Space Properties](https://www.smartics.eu/confluence/x/SQNwAg) for how to define space properties) and [document property](https://www.smartics.eu/confluence/x/54XSAw) by checking the parameter "*Apply Document Properties*". If unchecked, only key/value pairs in the body of the macro will be applied.

Assuming that there is a [space property](https://www.smartics.eu/confluence/x/8YXSAw) "*Product Name*" with the value "Super Tool" the transcluded text will be rendered as

"This is the text of *Super Tool* that ..."

There is a [tip](https://www.smartics.eu/confluence/x/woJAAg) on our website [Using Placeholders](https://www.smartics.eu/confluence/x/3AWaAg) that provides information for this use case.

As an alternative you could use the [Impersonator Feature](https://www.smartics.eu/confluence/x/DgDUBg). There is also a tip on our website [Impersonator - using Live Templates](https://www.smartics.eu/confluence/x/DYDBBg) that explains it. The impersonation allows to render the transcluded content in the context of the transcluded page. For simple text replacements this makes no difference (as long as the context of the transcluded page does not already provide values for the placeholders). But in case -- for instance -- you need to list components of a product, the list would be rendered in the context of the product page.

If I misunderstood your use case or if you have problems to run your use case with my explanation, please get in touch! :)


author: Erick van Rijk
body: Hi [@Robert Reiner _smartics_](/t5/user/viewprofilepage/user-id/853340) ,

thank you for you extensive answer. I will give the plugin a try in the upcoming weeks.

I will let you know if I have any issues.


author: Robert Reiner _smartics_
body: Hi [@Erick van Rijk](/t5/user/viewprofilepage/user-id/527906),

Thank you for your feedback!


Tags: atl-adm

confluence-server

excerpt

include

server