Can't get the RightSidebar to hide by default

46 views
Skip to first unread message

Septimus

unread,
Oct 30, 2009, 12:34:58 PM10/30/09
to TiddlyWiki
Hi people!

I like the RightSidebar to be hidden by default, and only show if I,
myself and me, log in.
This should be easily configured and is explained here
http://tiddlywiki.org/wiki/How_To/Setting_Up_TiddlyWiki_As_a_Website
under heading "Hide right side bar".

I followed the instructions to the letter, a couple of times even, and
the RightSidebar keeps
on showing by default. That is, it shows up each and every time, no
matter who's logged in.

I'd like to go over my steps here, and perhaps that someone among you,
see's what the
-beep- I'm doing wrong, okay? Great!
Here's what I did:
-1- install the InlineJavascriptPlugin;
-2- install the ToggleRightSidebar macro;
-3- add tyhe following line to tiddler zzTweak:

config.options.chkShowRightSidebar=false;

-4- save the page and reload.

I checked PluginManager if the plugin is installed and it is.

Anyone any suggestions to what might be wrong?

Thanks!
Septimus

shavinder

unread,
Oct 30, 2009, 1:53:14 PM10/30/09
to TiddlyWiki
Did you confirm that zzTweak tiddler has a systemConfig tag?
Is it being loaded during startup?
if you have firebug you could check the value of the
config.options.chkShowRightSidebar by entering it on the firebug
console and pressing enter. If you dont use FF I think you could
import jash from tiddlytools and do the same check.

-shavinder

On Oct 30, 9:34 pm, Septimus <eric.p.win...@gmail.com> wrote:
> Hi people!
>
> I like the RightSidebar to be hidden by default, and only show if I,
> myself and me, log in.
> This should be easily configured and is explained herehttp://tiddlywiki.org/wiki/How_To/Setting_Up_TiddlyWiki_As_a_Website

Eric Winter

unread,
Oct 30, 2009, 2:32:12 PM10/30/09
to tiddl...@googlegroups.com
Hi Shavinder,

Good suggestion, well done!

First of all, yes, I have tiddler zzTweak preperly tagged "systemConfig".

I took a look with Firebug and found that when I am logged in as user "admin",
config.options.chkShowRightSidebar is TRUE.

When I change the username to another user and reload the page, the value
of config.options.chkShowRightSidebar changes to NULL.

When I re-enter "config.options.chkShowRightSidebar" in Firebug's expression
watchbox, it's value changes to FALSE.

So, config.options.chkShowRightSidebar appears to behave as expected. 
I don't know what to make of the intermediate transition to NULL.

Do you?
Septimus

Eric Winter

unread,
Oct 30, 2009, 2:34:04 PM10/30/09
to tiddl...@googlegroups.com
BTW, here's my content of tiddler zzTweak:

if(config.options.txtUserName != "admin") {
    config.options.chkSinglePageMode = true;
    config.options.chkShowRightSidebar = false;
    readOnly = true;
    showBackstage = false;
}

Septimus

shavinder

unread,
Oct 30, 2009, 11:57:56 PM10/30/09
to TiddlyWiki
Are you calling the [[ToggleRightSidebar]] from somewhere?
ToggleRightSidebar is a script (transclusion now) which is not tagged
with systemConfig and therefore in order to run it one needs to call
it like this from somewhere: <<tiddler ToggleRightSidebar
with:"sidebar">>. This can either be done after startup in a normal
tiddler or in a tiddler which is called at startup like in
[[MainMenu]] or [[SiteSubtitle]]. You could make it more discreet by
using a smaller label, eg a dot '.' instead of 'sidebar' and making
its color same as the background.

hope this helps
-shavinder

On Oct 30, 11:34 pm, Eric Winter <eric.p.win...@gmail.com> wrote:
> BTW, here's my content of tiddler zzTweak:
>
> if(config.options.txtUserName != "admin") {
>     config.options.chkSinglePageMode = true;
>     config.options.chkShowRightSidebar = false;
>     readOnly = true;
>     showBackstage = false;
>
> }
>
> Septimus
>
> On Fri, Oct 30, 2009 at 7:32 PM, Eric Winter <eric.p.win...@gmail.com>wrote:
>
> > Hi Shavinder,
>
> > Good suggestion, well done!
>
> > First of all, yes, I have tiddler zzTweak preperly tagged "systemConfig".
>
> > I took a look with Firebug and found that when I am logged in as user
> > "admin",
> > config.options.chkShowRightSidebar is TRUE.
>
> > When I change the username to another user and reload the page, the value
> > of config.options.chkShowRightSidebar changes to NULL.
>
> > When I re-enter "config.options.chkShowRightSidebar" in Firebug's
> > expression
> > watchbox, it's value changes to FALSE.
>
> > So, config.options.chkShowRightSidebar appears to behave as expected.
> > I don't know what to make of the intermediate transition to NULL.
>
> > Do you?
> > Septimus
>

Eric Winter

unread,
Oct 31, 2009, 10:50:51 AM10/31/09
to tiddl...@googlegroups.com
Hi Shavinder!

Got it solved thanks to you!

I never called [[ToggleRightSidebar]] before checking the value of "config.options.chkShowRightSidebar".
That would explain why it's value changed to NULL on page reloads -- it never got initialized.

So, I added statement: <<tiddler ToggleRightSidebar>> to one of the tiddlers called at startup as you
explained, and now the right sidebar is hidden for regular visitors and shown when admin logs in.

I think the documentation on TiddlyTools.com needs serious improvement.

Thanks a million, Sir!

Septimus

shavinder

unread,
Oct 31, 2009, 11:53:32 AM10/31/09
to TiddlyWiki
> I think the documentation on TiddlyTools.com needs serious improvement.

Tiddlytools says it clearly:
Usage

<<tiddler ToggleRightSidebar>>
<<tiddler ToggleRightSidebar with: label tooltip>>

-shavinder


On Oct 31, 7:50 pm, Eric Winter <eric.p.win...@gmail.com> wrote:
> Hi Shavinder!
>
> Got it solved thanks to you!
>
> I never called [[ToggleRightSidebar]] before checking the value of
> "config.options.chkShowRightSidebar".
> That would explain why it's value changed to NULL on page reloads -- it
> never got initialized.
>
> So, I added statement: <<tiddler ToggleRightSidebar>> to one of the tiddlers
> called at startup as you
> explained, and now the right sidebar is hidden for regular visitors and
> shown when admin logs in.
>
> I think the documentation on TiddlyTools.com needs serious improvement.
>
> Thanks a million, Sir!
>
> Septimus
>

Eric Shulman

unread,
Oct 31, 2009, 12:28:31 PM10/31/09
to TiddlyWiki
First, many apologies for not promptly responding to your question...
I've been sick for almost two weeks, so I haven't been as active in
managing the groups as I usually am.

As noted by Shavinder, transclusions are not 'plugins'. Transclusions
are only invoked when they are *rendered*, and thus do not get invoked
*automatically* during startup unless they are actually embedded
somewhere in your page content. One convenient way to do this is to
add the following to your PageTemplate:

<span style='display:none' macro='tiddler SiteStartup'></span>

This will cause the [[SiteStartup]] tiddler to be rendered any time
the PageTemplate is processed. Note the use of style='display:none'.
This allows content in SiteStartup to be handled without creating any
unintended output on the page. Note also that, if SiteStartup does
not exist, the above span will not be rendered, so it is safe to
include this line in every document's PageTemplate, even if
SiteStartup handling is not currently needed in those documents.

Next, create your custom SiteStartup, containing any transclusions,
macros, or inline scripts that you want to invoke, like this:

<<tiddler ToggleRightSidebar>>
<<tiddler ToggleLeftSidebar>>
<<someMacro>>
<script>... JS code ...</script>
etc.

You can see an example of this technique here:
http://www.TiddlyTools.com/#SiteStartup

> I think the documentation on TiddlyTools.com needs serious improvement.

I appreciate the feedback regarding my documentation, but I think that
the above criticism is seriously overstated.

I want my documentation to "do it's job" effectively, so that it
actually helps help people *use* the stuff I've written. To
accomplish this, I need feedback from the community. However, rather
than merely stating that it "needs serious improvement" (which is
really just a complaint and isn't really helpful), please suggest
*specific* information that is lacking, so I can write additional
documentation that actually addresses your concerns.

I have published more than 200 addons (plugins, scripts,
transclusions, templates, stylesheets, etc.) on TiddlyTools. Many of
these addons contain extensive documentation, and over 40 plugins have
*separate* 'pluginInfo' tiddlers because their documentation was so
extensive that people complained it bloated the plugin tiddlers
themselves.

In fact, there is about 400K of *documentation* currently contained
within over 2Mb of tiddler content. Thus, nearly 20% of the content
of TiddlyTools is documentation, including syntax/usage instructions,
examples, configuration controls, and revision histories.

Unfortunately, despite my efforts, not all of my addons have been
documented as thoroughly as I might like. This may be particularly so
for transclusions, as I recently re-wrote all 76 of these tiddlers to
convert from using InlineJavascriptPlugin and instead, invoke custom
JS code
using a TW-native technique based on the <<tiddler>> macro, thereby
eliminating the dependency on the plugin.

Prior to this massive re-write (which took a full week), most inline
scripts had virtually *no* documentation, except for notes embedded in
the script tiddlers' source. As part of the re-write, I standardized
the format that I use for transclusions, and added a 'self-
documenting' mechanism so that directly viewing a transclusion tiddler
now shows *some* documentation, where previously there was none.

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

Eric Winter

unread,
Nov 1, 2009, 11:36:10 AM11/1/09
to tiddl...@googlegroups.com
Thank you for your explanation.

Septimus
Reply all
Reply to author
Forward
0 new messages