Scaffolding and TOC

Ruben van der Steenhoven July 5, 2011

Hi,

we're using scaffolding to create standardized pages.
In these pages we use textareas, so the user cannot easily forget certain subjects.
The last of these texareas is for the user to add his/her own subjects, so i cannot use Headings outside this textarea in that case.

We've noticed that Headings embedded in a textarea aren't included in the TOC.

Do you know/have a solution for this?

(we're using Confluence v3.5.6 and Scaffolding v3.4.2)

2 answers

1 vote
David Peterson
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 24, 2011

Hi Ruben,

I did a quick test an was able to replicate the problem. It seems that the {toc} macro is caching the TOC (which is a good thing, since generally the layout doesn't change, and it saves it from having to render the whole page twice every time you view it), however it's not updating the cache when Scaffolding data is saved.

I'm not sure if this is due to Scaffolding not sending out the correct event when it updates the page, or if it's something in TOC, or both, however there is a workaround. Simply add '?refresh=true' to the URL to force the TOC to refresh after you save a Scaffold page. Not ideal, but it's the best I've got at the moment.

It may also be worth raising an issue for Scaffolding (https://greenhouse.customware.net/jira/browse/SCAFF) and/or the TOC (https://studio.plugins.atlassian.com/browse/TOC).

Hope that helps!

David Peterson

Ruben van der Steenhoven September 15, 2011

This pointed me in the right direction, what i did as a workaround until the root problem is fixed is this:

I created a usermacro {kvk-refresh} which contains following code:

<a href="$content.getUrlPath()?refresh=true">$body</a>

Next, i added a call below my TOC heading in the scaffold like this:

h1. TOC
{kvk-refresh}(update TOC){kvk-refresh}
{toc:style=disc|indent=20px}

At least for now we're safe, i will file an issue for Scaffolding.

0 votes
twong_atlassian
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.
July 17, 2011

I don't actually know how scaffolding works (I haven't examined the customware code), but I do believe that it relies on some mechanism of "including a page," which means you're probably running into a variation of https://jira.atlassian.com/browse/CONF-3844

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events