Item2509: Generation of TOC inconsistent when using ViewTemplate

pencil
Priority: Normal
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Engine
Component:
Branches:
Reported By: MartinKaufmann
Waiting For:
Last Change By: KennethLavrsen
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):
  • using %TOC% only shows ViewTemplate Header (as expected since the TOC macro is called from the ViewTemplate).
  • using %TOC{ "%BASETOPIC%" }% also shows ViewTemplate Header (unexpected).
  • using %TOC{ "%BASETOPIC%" web="%BASEWEB%" }% also shows ViewTemplate Header (unexpected).
  • using %TOC{ "%BASEWEB%.%BASETOPIC%"  }% shows TocTest Header (originally expected, but unexpected after the last couple of results).

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

ItemTemplate edit

Summary Generation of TOC inconsistent when using ViewTemplate
ReportedBy MartinKaufmann
Codebase 1.1.1, 1.0.7
SVN Range
AppliesTo Engine
Component
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
Topic revision: r4 - 09 Nov 2010, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy