I currently have a placeholder text "Add more" for a header and I would like to exclude it if the user does not fill it in. I've tried inputting Add.* under exclude header but it doesn't work. "Add more" still shows as a header in the TOC.
Hello @Adriel Liew
I've just tested the Exclude Headings filter Add.* with the TOC macro, and it is working fine on Confluence Cloud:
Chances are you have some other issue that is interfering. Double check the other settings for the TOC macro.
Hi @[deleted]
Strange, I tried doing it on a blank template and the placeholder text headings still show.
Are you saying the macro doesn't work properly when looking at a template or a page created from that template?
In the lower picture, the text headings "Add more H2" and "Add more H1" have suddenly disappeared from the page... yet the TOC macro is generating a list of headings as if they were still there! That is just plain bizarre!
I have also tested the TOC macro in a template, with and without the heading filter, and then looked at that template and it correctly filtered out all headings that started with "Add":
The TOC macros in pages based on that template work just fine too:
I think you have some sort of content caching issue with your web browser, as the macro seems to be 'lagging' behind what is actually on the page. Try another browser for that same page and see if the macro there also doesn't correctly filter out the headings that start with "Add".
Wait let's go back to my story.
I'm creating a template with some text headings and placeholder headings.
When the users use the template to create a new page, assuming they fill in the placeholder text headings with "xxx" if it's applicable, and leave them blank when it's not, I want the page's TOC to show the headers that are filled and those blank (still placeholders) to be excluded.
Hopefully this makes sense.
and yes I do think that that is bizarre that the TOC is showing the placeholder headings.
and yes I tried using Edge browser and it's happening there too.
It looks like you're new here. Sign in or register to get started.