Using a ViewTemplate which contains a %TOC% macro leads to inconsistent results depending on the parameters used. I've set up an example in the Sandbox web. The ViewTemplate is defined in TocTestViewTemplate and contains the %TOC% macro (with different parameters) as well as the header ViewTemplate Header. The topic which uses this ViewTemplate is TocTest which contains the header TocTest Header.

The results are the following (in case the Sandbox topics are no longer available):

To include both headers (the one from the ViewTemplate as well as the one from the topic using the ViewTemplate) would mean that the parsing for the TOC would have to happen at a later stage in the processing of the topic. This would of course be the preferred solution.

The following hack can be used as a (hopefully temporary) work-around:

%TOC%
<div style="margin-top:-2em;">%TOC{ "%BASEWEB%.%BASETOPIC%" }%</div>

Effectively a duplicate of Item2317

-- CrawfordCurrie - 29 Jun 2010

Even with the workarround it doesn't show content of the whole topic but only the content of the viewTemplate itself. I tried with the Sandbox example from above and even more permutations - nothing gets TOC to show the real content of the whole topic. Can anyone confirm this is a general problem with 1.1.1 and has there been a fix meanwhile?

Kind regards

-- EnrikGuenter

I am putting this back in no action as it is covered by Item2317

That does not mean the bug is not a bug. Just that we are OK with ONE open bug. The Item2317 refers to this bug so the feedback will be read when someone decides to address this.

Thanks for the feedback.

-- KennethLavrsen - 09 Nov 2010

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. see CopyrightStatement. Creative Commons LicenseGet Foswiki at sourceforge.net. Fast, secure and Free Open Source software downloads