Tags:
create new tag
view all tags

Question

I've been increasing my use of Glue Plugin; it allows me to break up long lines and makes my TWiki code easier to debug. However, I can't seem to make it work properly with TWISTY.

%~~ TWISTY{
~~~ showlink="Show Me the list" 
~~~ showimg="%ICONURLPATH{toggleopen-small}%" 
~~~ hidelink="Hide" 
~~~ hideimg="%ICONURLPATH{toggleclose-small}%" 
~~~ mode="div" 
~~~ }%

   * item 1
   * item 2

%ENDTWISTY%

When I try this, the page "chrome" goes wonky; the web Left Bar drops below the content.

  • screenshot:
    screenshot.jpg

If, instead, I use

%TWISTY{showlink="Show Me the list" showimg="%ICONURLPATH{toggleopen-small}%" hidelink="Hide" hideimg="%ICONURLPATH{toggleclose-small}%" mode="div" }%

   * item 1
   * item 2

%ENDTWISTY%

presentation is as expected.

When I examine the HTML source, the "glued" version appears to be missing one </div>

Environment

TWiki version: unspecified
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin , GluePlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Plugins

-- VickiBrown - 11 Mar 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.

That's probably because the closing ENDTWISTY is processed before the TWISTY that is escaped by the glue chars in the first loop of the twiki parser. Try to make it %~~ ENDTWISTY%

Btw. you don't need glue just to have the params on separate lines. TWiki does fine with a

%TWISTY{
   showlink="Show Me the list" 
   showimg="%ICONURLPATH{toggleopen-small}%" 
   hidelink="Hide" 
   hideimg="%ICONURLPATH{toggleclose-small}%" 
   mode="div" 
}%

   * item 1
   * item 2

%ENDTWISTY%

-- MichaelDaum - 11 Mar 2008

I tried %~~ ENDTWISTY% -- that doesn't work either

> Btw. you don't need glue just to have the params on separate lines.

I wonder when that started to work. It didn't used to.

Well, that solves the need (if not the bug).

-- VickiBrown - 12 Mar 2008

Here's a patch that illustrates the problem and prevents a "Use of uninitialized value in concatenation" error that you should see in your error logs.

--- lib/TWiki/Plugins/TwistyPlugin.pm   (revision 16405)
+++ lib/TWiki/Plugins/TwistyPlugin.pm   (working copy)
@@ -189,6 +189,10 @@
 sub _ENDTWISTYTOGGLE {
     my ( $session, $params, $theTopic, $theWeb ) = @_;
     my $mode = shift @modes;
+
+    return "<span class='twikiAlert'>woops, ordering error: got an ENDTWISTY before seeing a TWISTY</span>"
+      unless $mode;
+
     my $modeTag = ($mode) ? '</' . $mode . '>' : '';
     return $modeTag . _wrapInContentHtmlClose();
 }

-- MichaelDaum - 12 Mar 2008

Another possible solution: Put the TwistyPlugin first in the {PluginsOrder} of configure.

-- PeterThoeny - 12 Mar 2008

That should make any difference as PluginsOrder only comes into play for plugins using the commonTagsHandler(). TwistyPlugin however is implemented using registerTagHandler() so that ordering is regulated within twiki's parser and not with PluginsOrder. All tags registered to the parser are executed first, even before the first plugin in PluginsOrder. GluePlugin however pushes tag expansions further down the chain...

-- MichaelDaum - 12 Mar 2008

Change status to:

Topic attachments
I Attachment History Action Size Date Who Comment
JPEGjpg screenshot.jpg r1 manage 91.7 K 2008-03-11 - 20:11 UnknownUser screenshot
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2008-03-12 - MichaelDaum
 
  • 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.