• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

With cookies the selected state of the Twisty is remembered the next time the Twisty is shown.

SVN 7249.

AC

Don't use cookies. Use session variables.

MD

I would, but:

  • TwistyContrib is installed by default for PatternSkin, not TwistyPlugin
  • TwistyContrib does not have any Perl, only Javascript
  • How to use session variables in this external Javascript file?

AC

Why do you need a dedicated TwistyContrib? If there's no indispensable reason for it then do everything just with the TwistyPlugin. Most will install both anyway.

Besides, I'd love to have a PersistentSessionVarsPlugin that stores session variables into TWikiVariables in the user topic. That would enable some nice stuff, but only for things that are stored within the session object.

MD

New item: Item814.

Wait a minute - the user clicks on a Twisty link, javascript makes the Twisty contents hidden or shown. Where does the session come into play?

AC

Just in case you are not aware of session objects: (skip if you already know)

The session object is the store for a user's session state. He knows which session object belongs to him by a cookie that stores a sesson id - an integer which is sent to the browser. If this user comes back TWiki gets the session id and retrieves the session object belonging to it and everything that is stored in it. You can arbitrary amount of data in one session object and still only send one cookie to the browser. Thereby session info is stored on the server vs. on the client in its cookie jar.

So if the user clicks on a Twisty link a session variable is created to store the Twisty state. Note, that the session object stores key-value-pairs. To store the Twisty state you have to construct a reasonable key taking the page location and the twisty-id on the page into account which you should have done already using cookies (didn't examin your javascript code so far).

MD

OK. Now I need a bit more help on the practical level: from within the javascript read the session info and write back to it.

AC

Oh, now I see the problem. Twisty is a pure javascript solution with no communication to the server while changing the Twisty state. The server never notices that the user is twisting html. Now I understand what this Twisty is all about. /me paddles backwards.

MD

ItemTemplate
Summary TwistyContrib + TwistyPlugin: add cookie support
ReportedBy ArthurClemens
AppliesTo Extension
Priority Low
CurrentState Closed
WaitingFor

Checkins 7275 7278
Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r9 - 2005-11-01 - MichaelDaum
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback