fantastic Eric!
Once again your advice is right on. Thank you, thank you very much.
Patrick.
For the record, for myself and other newbies out there, here is how to
"hide the edit button when online but have it show when offline, for
all tiddlers tagged Locked" while, at the same time, "keeping the
number of buttons to a minimum".
Specifically, the code below displays in every tiddler toolbar an
"edit" and a "close" button when offline but only a "close" button
when online for tiddlers tagged "Locked".
The purpose of this tweak is to prevent online visitors of your
TiddlyWiki (who may be unfamiliar with the TiddlyWiki concept) from
being distracted by the edit button.
If you're using the MptwTheme, simply replace the ViewTemplateToolbar
with the following. (If you're not using the MptwTheme, you will need
to edit the code of the relevant tiddler.)
!ViewTemplateToolbar
<!--{{{-->
<div class='toolbar'>
<span macro="showWhenTagged systemConfig">
<span macro="toggleTag systemConfigDisable . '[[disable|
systemConfigDisable]]'"></span>
</span>
<span macro="showWhenTagged systemTheme"><span macro="applyTheme"></
span></span>
<span macro="showWhenTagged systemPalette"><span
macro="applyPalette"></span></span>
<span macro="showWhen tiddler.tags.contains('css') || tiddler.title
== 'StyleSheet'">
<span macro="refreshAll"></span>
</span>
<span style="padding:1em;"></span>
<span macro="hideWhen tiddler.tags.contains('Locked') &&
window.location.protocol!='file:'">
<span macro='toolbar editTiddler'></span>
</span>
<span style="padding:1em;"></span>
<span macro='toolbar closeTiddler'></span>
</div>
<!--}}}-->
I would recommend, however, that instead of editing the MptwTheme
tiddler, you create a tiddler titled MptwThemeCustom and use that
tiddler as your theme. That way, you will be able to update the
MptwTheme in the future without overwriting the custom adjustments you
make. To do so, you will need to do three things:
(1) create a tiddler titled MptwThemeCustom in which you copy the
amended code of MptwTheme
(2) in your MptwThemeCustom tiddler, replace the line:
[[MptwTheme##ViewTemplateToolbar]] with:
[[MptwThemeCustom##ViewTemplateToolbar]]
(3) in your customization tiddler, paste the following line of code:
config.options.txtTheme = 'MptwThemeCustom';
If you do not have a customization tiddler yet, create a tiddler, tag
it with systemConfig, and title it something like zzCustom, the zz
ensuring that it is loaded last. (You can append other custom
modifications to that same zzCustom tiddler.)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---