On Wednesday, March 5, 2014 9:52:48 AM UTC-8, Bill Mullen wrote:
>
> I was looking for a way to re-display my DefaultTiddlers - mostly after a 
> search because the search feature was closing all the open tiddlers before 
> displaying the results.
> In my search, Morris Gray included some code in the following thread:
>
> https://groups.google.com/forum/#!searchin/TiddlyWiki/DefaultTiddler/tiddlywiki/k3qdZ64aARQ/PpTeG7swBxkJ
>
<html><a href="javascript:void(0)" onclick="story.closeAllTiddlers
> ();story.displayTiddlers(null,store.getTiddlerText
> ('DefaultTiddlers').readBracketedList())"
> ><span title="Display default tiddlers" style="cursor:pointer; color: 
> white;">My Site Title</span></a></html>
>

1) Note that this only applies to TiddlyWiki Classic (TWC), not TiddlyWiki5 
(TW5).  Please remember to put either TWC or TW5 in the subject of your 
posts.

2) The code you posted can be shortened to:
<html><a href="javascript:;" onclick="story.closeAllTiddlers();restart();" 
title="Display default tiddlers">My Site Title</a></html>
* the href and onclick codes are simpler
* there's no need to set the cursor style, since <a> already defaults to 
using "pointer"
* colors should not be hard coded.. you should add/edit custom CSS in 
[[StyleSheet]] to affect changes in appearance

3) I suggest moving the code to another tiddler, e.g., 
[[ShowDefaultTiddlers]], with a substitution parameter for the clickable 
text, like this:
<html><a href="javascript:;" onclick="story.closeAllTiddlers();restart();" 
title="Display default tiddlers">$1</a></html>
Then, you can use this in [[SiteTitle]] like this:
<<tiddler ShowDefaultTiddlers with: "Site title goes here">>
The net advantages are that
* the content in SiteTitle is more readable because the technical stuff is 
separated in another tiddler
* you can re-use the same transclusion to add a "home" link elsewhere in 
your document (e.g., [[MainMenu]] or [[SideBarOptions]]).  For example:
<<tiddler ShowDefaultTiddlers with: "home">>

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
   http://TiddlyTools.github.com/fundraising.html#MakeADonation

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
   http://www.TiddlyTools.com/#Contact

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to