Can I set up a "page nesting" macro?
Asked by OSC:

Hi guys!

I'm currently setting up some blueprints and face a problem i was not able to solve by myself so far:

The goal is to have a blueprint. Nothing fancy so far. But I want this blueprint to contain macros that create content from templates ++*within that same page*++. Quite similar to the "create from template" macro, but I want the content not to be created in a separate page, rather in the same page the macro is in.

The blueprint is needed for product related pages that will be filled with content over time. So while a template makes sense here, I can't expect users to fill out the page at once.

Best Regards


Answers:
author: Robert Reiner _smartics_
body: I do not understand what you mean by "creating content in a separate page". As far as I understand the Create-from-Template-Macro there is always a new page created. What do I miss?

I see two scenarios: Either you want to create a new section within an existing page or you want to create a new page and the new content should show up in an existing page.

If you need the first, you just need a section / placeholder in the existing page that gets eventually filled. You could use the [Section Macro](https://www.smartics.eu/confluence/x/ugNk) for this (there is also a [free version](https://www.smartics.eu/confluence/x/p4aj) with limited features).

If you need the second, you could use transclusion mechanism. That is: create a page and then transclude parts of the document to show in the parent (or other) document. This might work with the [Excerpt Macro](https://confluence.atlassian.com/confcloud/excerpt-macro-724765191.html) / [Excerpt Include Macro](https://confluence.atlassian.com/confcloud/excerpt-include-macro-724765190.html)(I have not checked), but it would work with macros of the [projectdoc Toolbox](https://www.smartics.eu/confluence/x/EAFk). See [Transclusion Macro](https://www.smartics.eu/confluence/x/_QJk) and [Transclude Documents Macro](https://www.smartics.eu/confluence/x/7ADe) for details.

There is probably a third scenario ... :smile: - if my answer is not helpful to you, I'd like to ask you to provide more details about your use case.

Please note that the projectdoc Toolbox is a commercial add-on and I am one of its authors.

comments: author: OSC
body: Thank you for your answer.

I am "just" a space administrator and unfortunately not able to install additional plug-ins. I would need a confluence stock macro to solve my issue. Here is some more information:

Yes, the create-from-template macro always creates an additional page. And that is exactly what I don't want to happen.

I basically need a macro that enables users to create additional content based on a template in the same page the macro is in.

Kind of like a create-from-template macro that puts the content in the parent page.

I hope I was able to clear things up a bit. I'm not a native speaker and am trying my best here :smile:


author: Robert Reiner _smartics_
body: Thank you for your explanation! Rereading your first question I do not see why I did not understand it in first place ... (I am not a native speaker either :wink:). Now I understand what you want to achieve.

Unfortunately I don't know of such a macro.

Maybe you could define [user macros](https://confluence.atlassian.com/doc/writing-user-macros-4485.html) where users add parameters and the macro renders the content based on the user's input. Unfortunately you would need system administrator permissions. Following this suggestion the macro controls the structure and the user the content. This may work for some use cases, but certainly not for all. But note that I have not used user macros before by myself (it is easier for me to create add-ons).

Or you give the transclusion approach with the excerpt macros a try ... but this implies subpages and I'm not sure if the excerpt macros can handle content that is not yet existing.


author: OSC
body: Bumping because I'm really desperate to find out..