Is there an equivalent to the Excerpt Include Macro?

Marcel Woschek
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 18, 2016

This question is in reference to Atlassian Documentation: Excerpt Include Macro

The Excerpt Include macro allows you to include an explicite part of a page.

I was wondering now if there is a macro that works the other way round. A macro that excludes parts of a page and the rest of the page will be included.

That would be very helpful for large pages with only a small part to be excluded. Also this excluded part could be in between relevant parts, which is not possible with the Excerpt Include macro...

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 7, 2017

You can use the add-on we develop - Smart Templates for Confluence

It allows you to include the contents from pages, templates, page excerpts. Helps you to build truly dynamic pages and reuse the contents as much as possible

You can define what can be included, as the plugin is very extendable (comes with pre-configured support to include and reuse excerpts (including multiple excerpts) and panels).

0 votes
Bill Bailey
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2016

Well depends on how much you want to exclude the content, meaning, as long as you can't see it, does that work?

My suggestion would be to create a user macro that allows you to toggle a class (on inline style) to set display:none; Would take some work to come up with logic that allows display in the source but not in the destination – maybe something based on space, labels, metadata, etc,, but doable.

I would solve this the way Davin suggests as being the most straightforward.

0 votes
Robert Reiner _smartics_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2016

I'm using the projectdoc Toolbox (Disclaimer: commercial, on-premise only, I'm one of the authors of this add-on smile).

Using this add-on authors add new sections using the Section Macro, mark it with identifier and/or tags and then select and exclude content based on identifiers and tags.

For instance: If you have three sections with titles "Description", "Summary", and "References" you could use the Transclusion Macro with a selection of "!Description" to render only the summary and references section.

image2016-8-20 14:20:58.png

But this is not helpful in your context since I suppose you do not want to rewrite your documents. I assume that would be just to cumbersome as you mentioned in your reply to Davin's answer.

What you could do with the projectdoc Toolbox is to have one large section and add additional sections that are tagged with e.g. "internal".

Example: This is the document to transclude from:

image2016-8-20 14-4-23.png

The whole content is within a Content Marker Macro (with the id "all") and each section that needs to be excluded is using the Section Macro with the tag "internal".

The Transclusion Macro on the transcluding page then selects "all" content and excludes all sections tagged with "internal" from the page given above.

image2016-8-20 14-5-40.png

In the preview you can see that the internal section with title "Subsection B" is excluded because Tags is specified as "!internal".

I hope I understood your use case correctly. You could install a trial version of the projectdoc Toolbox to make sure that you have no additional requirements that are not covered by this add-on. If you have questions, I'm happy to help!

Note that for some features to work the page requires to include the Document Properties Marker Macro. But the example shown above works without it. The projectdoc Toolbox is based on the concept that every page has properties and sections and the tools provided by this add-on in some cases rely on this assumption. More information can be found online in the projectdoc Toolbox Manual.

0 votes
Davin Studer
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 18, 2016

There is the Multi Excerpt add-on that could do this. You would need three excerpts on the page and just include excerpt 1 and 3 on another page and leave out excerpt 2. Another option if you don't want to pay for the add-on would be to make all three sections excerpts on separate pages. Then you could combine them as you want. On one page you could include all three and another just include two.

Marcel Woschek
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 18, 2016

Sounds like an expensive workaround to me (in multiple ways).

If I would want to exclude 2 part, I would have to insert 3 parts around them.

Excluding 3 parts I would need to include 4 etc. 

That's not really satisfying to me laugh

I was more thinking of a macro that excludes a part and when you use the basic Include Macro only the rest will be included.

I guess that's not possible though...

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events