have been reading all the discussions with pleasure. One newby
question relating to the togglesidebar macro.
Where exactly can you state that the default should be "hide". I am
unable to get this working and would be thrilled if you can help me
out with this.
gr
Marco
Though I never used ToggleSideBar, but there I read:
Usage:
<<toggleSideBar>> »
additional options:
where:
label = custom label for the button,
tooltip = custom tooltip for the button,
show/hide = use one or the other, determines whether the sidebar is
shown at first or not.
(default is to show the sidebar)
You can add it to your tiddler toolbar, your MainMenu, or where you
like really.
If you are using a horizontal MainMenu and want the button to be right
aligned, put the following in your StyleSheet:
.HideSideBarButton {float:right;}
So that does means to me, just place the following in whichever
tiddler or menu most convenient (since you aren't concerned with a
label of the button or a popupmenu anyway):
<<toggleSideBar hide>>
Regards,
W.
Here's what I did to solve the problem. That is, you never see the
right bar. The solution is ugly, but it works.
1. Create a tiddler called SetReaderMode
It contains the following 1 line:
<<toggleSideBar " " " " hide>>
2. Make a core tweak as follows:
In "function main()" directly before the line, "restart();", I added
the following 2 lines:
story.displayTiddler(null,"SetReaderMode");
story.closeTiddler("SetReaderMode");
3. I have another tiddler called SetWorkMode. It contains the
following
<<toggleSideBar "Display Side Bar, for author only" "You Shouldn't be
clicking this">>
This is referenced by an inconspicuous link on a rarely referenced
page so I can get to the side bar when I need it as the author.
Okay, I know, I know, core tweaks are bad. I just couldn't find
another way to activate the macro without human intervention. If
someone could suggest a way to either close a tiddler automatically
after executing it, or to execute a macro without forcing the user to
click a button, then I could remove the core tweek.
Joe
<<toggleSideBar "" "" hide>>!. So easy, if you know how it works,
gr
marco
To render yoru [[SetReaderMode]] tiddler during startup, without it
being visible, you can add the following to the [[PageTemplate]]:
<span style="display:none" macro="tiddler SetReaderMode"></span>
Whenever the TW page template is re-drawn, [[SetReaderMode]] is
automatically invoked, triggering the <<toggleSideBar>> macro it
contains. Note that the span that invokes the macro is NOT displayed,
so that it will have no net effect on the page appearance, even though
it is being rendered when the page is drawn.
Also, rather than using an obscurely placed link to trigger
[[SetWorkMode]] you could combine both cases into a single tiddler,
and use InlineJavascriptPlugin to conditionally show/hide the sidebar,
based on programmatic criteria, such as checking the current username,
like this:
[[SetMode]]
<script>
if (config.options.txtUserName="admin")
return '<<toggleSideBar ... show>>';
else
return '<<toggleSideBar ... hide>>';
</script>
[[PageTemplate]]
<span style="display:none" macro="tiddler SetMode"></span>
Then, to use "author mode", just set your username to "admin"... any
other username will default to "reader mode"...
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
Continuously learning,
Joe