You are here: Foswiki>Tasks Web>Item5532 (12 Jun 2022, MichaelDaum)Edit Attach

Item5532: TwistyPlugin has some mean sideeffects. (and some feature ideas)

Priority: Enhancement
Current State: No Action Required
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: TwistyPlugin
Reported By: TWiki:Main.SvenDowideit
Waiting For:
Last Change By: MichaelDaum
I was going to try to use twistie to build a UI from sections that are used in several places, and noticed the following
  1. TWISTYTOGGLE{id="login" start="show"} will hide the content if there is no matching TWISTYBUTTON
  2. there is some real oddity if your page has more than one TWISTYBUTTON with the same id
  3. the js header is literal text in the pm file - if that gets moved out to a .tmpl file, we can have one TWistie plugin with multiple js backends
    • tracked in Item5557, and fixing Item4780 because it will be needed for consistency

and as feature requests
  1. depressingly for me, I can't specfy an alt text to use for TWISTYBUTTON if there is no JS - I want a twisty, but if i can't have it, for the user to be directed to another topic..
    • I'd also love to be able to have TWISTYBUTTON use the alt text if there is no matching TWISTYTOGGLE section on the page
  2. there's no way to make the configure UI? I thought twistyplugin and configure shared code?

so the big Q is - are you happy to let me add these? and have you other ideas / info that could help me get to this?

-- TWiki:Main/SvenDowideit - 14 Apr 2008

Twisty is not really made to show other content if javascript if not available. By default it will show the contents.

Surprisingly it will hide contents if only TWISTYTOGGLE is used, you explicitly must pass start="show". That may be a bug.

What works is this - be it verbose - construction:
%TWISTYTOGGLE{id="1" start="show" noscript="hide"}%
This text is shown is javascript is ON
%TWISTYTOGGLE{id="2" start="hide" noscript="show"}%
This text is shown is javascript is OFF

Which results in:
This text is shown is javascript is ON
This text is shown is javascript is OFF

Parameter id must be unique. But apparently the plugin does not add ids automatically when they are not passed, as it does with TWISTY. This may be a bug.
The configure accordion has unique code. It is also not without bugs. There is no Twisty code out of the box to create this.
Multiple js backends sounds fine. It would make maintenance easier instead of having 2 Twisty plugins.

-- TWiki:Main.ArthurClemens - 15 Apr 2008

It turns out that the one TWISTYBUTTON per id is hardcoded into the way that the html id's are built to map to the SECTION names, and the JS Storage - this means that changing it will cause much of the code to need re-writing, and that using 2 TWISTYBUTTON's with the same id produces invalid html - as you get 2 elements with the same ID.

-- TWiki:Main.SvenDowideit - 22 Apr 2008

I cannot see this is a release blocker. It has been hidden from the Release Blocker view because someone changed the release blocker search in a way that many extensions incl this one was missed.

But now I see it I will downgrade it to normal. Fix it if you want. But if you do not we can still release 4.2.1

KJL 02 Jun 2008

Closing due to lack of actions.

-- MichaelDaum - 12 Jun 2022

ItemTemplate edit

Summary TwistyPlugin has some mean sideeffects. (and some feature ideas)
ReportedBy TWiki:Main.SvenDowideit
SVN Range TWiki-5.0.0, Sun, 13 Apr 2008, build 16659
AppliesTo Extension
Component TwistyPlugin
Priority Enhancement
CurrentState No Action Required
TargetRelease n/a
ReleasedIn n/a
Topic revision: r8 - 12 Jun 2022, MichaelDaum
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