Can you use the Expand macro within a table cell?

Bob November 25, 2024

I am using the expand macro to collapse a table of contents (list of sections within the document) for a document in Confluence. I followed the steps below. 

  1. type /expand
  2. add title
  3. type /toc on the next line

The expand/collapse works fine but doesn't work if I put the expand function in a cell of a table with other document information (owner, stakeholders, dates, etc.). When used in a table the expand doesn't control the /toc like it does when used outside of a table. 

2 answers

2 accepted

2 votes
Answer accepted
Mariana Silveira Sales
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.
November 25, 2024

Hi @Bob 

As @Kristian Klima shared, it's possible to use the expand macro within the table cell. However, you can not add a ToC macro inside this expand. 

You are able to add a ToC within a expand macro only when the expand macro is on the page:

Screenshot at Nov 25 16-58-52.png

Bob November 25, 2024

Thank you for the follow up, this is what I encountered. 

0 votes
Answer accepted
Kristian Klima
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 25, 2024

Hi @Bob and welcome to the community.

Can you provide a screenshot (with sensitive info blurred)?

I'm having a hard time visualizing this.

I was able to do the following 2024-11-25_19-41-38.png

...and it works as expected (the macro expands).

The standard TOC macro always contains the headings on the entire page, no matter where you put it. (I vaguely remember a TOC Zone or smth like that macro but I never used it).

Another important thing - not all macros can be nested (one inside another), you'll notice this when a such an attempt results in the nested macro just jumping out :) 

So that was the Confluence Can / Cannot do.

 

Now, as a content person... I advise against nesting information elements (macros). I would never use expand macro in a table. Why? Because table shows lists and relationships among the elements and, given the size of a Confluence page, it works best in a 'I look and I see' size. But even if the page real estate wasn't an issue, the moment you expand one cell - you a) suddenly add more content for the reader to process IN relation to other elements while, at the same time, challenging them to spot where everything has moved.

Bob November 25, 2024

Thanks for the follow up. I inserted a screen shot for your reference. Option 1 has the TOC in the table without using expand which will result in long list of links. Option 2 is the TOC macro inside the expand macro but outside the table. This is not a bad option. I was trying to see if the TOC macro could be inside the expand macro in the table. Mariana confirm this is not possible, which is what I was experiencing. I wanted to make sure I wasn't just making a mistake. 

 

Using TOC macro - expand macro.jpg

Like Kristian Klima likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events