Question
I have Code in my left bar to display a table of contents. It only works if I actually include the page in the personalized web left bar for a user. When I use include statements on the page i want to see a TOC for, TOC works just fine (of course the whole page shows under it in the left bar). But unless i use an INCLUDE statement on the personalized web left bar then it shows odd results.
Result #1)
it only shows the actual topics created on that page that is being shown (not the TOC from the include statements on the page).
A TOC placed on the page itself does expand and show the heading for included topics
Result #2)
it does not expand variables like MAKETEXT in the default web home topic for a web
A TOC placed on the page itself does expand the above variables
See the screen shot at the right.
Result #3)
on the Default TWiki web home page, it shows nothing (but this web has some
<div> stuff at the top of it so maybee this is affecting it??
Notes:
all headers that i hope to generate are coded with TML ie --+++ (or whatever it is supposed to be)
Code in Left Bar
%TWISTY{mode="div" showlink="Show Contents..." hidelink="Hide Contents" showimgleft=
"%ICONURLPATH{toggleopen}% "hideimgleft="%ICONURLPATH{toggleclose}%"}%
%TOC{%BASEWEB%.%BASETOPIC%}% %ENDTWISTY%
Environment
--
DavidLahmer - 24 May 2008
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
Result #2 is because variables do not expand on the include. Usually the
SpreadSheetPlugin is used to SET the value in a variable in the included page, and GET it in the including page. Result #1 is probably related. See
SpreadSheetPluginDev for discussion on that.
But I couldn't get it to work:
- Included topic
%STARTSECTION{"Saved TOC"}%
%CALC{$SET(toc, $NOP(%)TOC%)}%
%ENDSECTION{"Saved TOC"}%
- Including topic (left bar):
---
!ToC
%INCLUDE{"%BASEWEB%.%BASETOPIC%" section="Saved TOC"}%
%TWISTY{mode="div" showlink="Show " hidelink="Hide " showimgleft=
"%ICONURLPATH{toggleopen}% "hideimgleft="%ICONURLPATH{toggleclose}%"}%
%CALC{"$GET(toc)"}% %ENDTWISTY%
As you can see at
SeanCMorganSandbox, the GET works in the included topic, so the variable is set properly. But it's empty when displayed in my left bar.
Does anyone else have an idea?
--
SeanCMorgan - 04 Jun 2008
Closing this after more than 30 days of inactivity. Please feel free to re-open if needed.
--
PeterThoeny - 02 Aug 2008