Tags:
create new tag
view all tags

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

TWiki version: TWikiRelease04x02x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: cent os5
Web server: Apache/2.2.3 (CentOS)
Perl version: 5.008008 (linux)
Client OS: win xp
Web Browser: Firefox2.0, IE7
Categories: Search, Plugins, Skin

-- DavidLahmer - 24 May 2008

Answer

ALERT! 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

Change status to:
Topic attachments
I Attachment History Action Size Date Who Comment
JPEGjpg untitled.JPG r1 manage 14.5 K 2008-05-24 - 20:58 UnknownUser  
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2008-08-02 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.