[TW5] How to I apply a pretty link to widget and macrocalls etc...

183 views
Skip to first unread message

TonyM

unread,
May 3, 2018, 12:19:43 AM5/3/18
to TiddlyWiki
Folks,

I have a simple macro to open a tiddler outside of a "viewer" as follows;

<$navigator story="$:/StoryList"><<currentTiddler>></$navigator>

However this widget returns the fill tiddler name and I would like to replace it with something like "Open Tiddler" - effectivly a static value regardless of what the <<currentTiddler>> is.
I new a way in TWClassic but not sure here.

I can see someday wanting to apply a pretty link to macros as well

<<macro tiddlername>>

Thanks in advance
Tony

TonyM

unread,
May 3, 2018, 12:22:52 AM5/3/18
to TiddlyWiki
Post script,

Around a transclusion would be helpful as well eg;

{{||$:/core/ui/TagTemplate}} 

If rather than display the tag in the tagpill display some static text eg tagging which still operated the same. I have created a modified tag macro for this previously.

Regards
Tony

Mat

unread,
May 3, 2018, 3:32:30 AM5/3/18
to TiddlyWiki
<div class="foo1"><div class="foo2">
<$navigator story="$:/StoryList"><<currentTiddler>></$navigator>
</div></div>

<style>
.foo2 { visibility:hidden; }
.foo1:after { content:"xx"; }
</style>

------------------------------------------------------------

For macro

\define tiddlername(tid) <div class="foo1"><div class="foo2">$tid$</div></div>

<<tiddlername oooo>>


<:-)

TonyM

unread,
May 3, 2018, 3:40:28 AM5/3/18
to TiddlyWiki
Thanks Mat heaps

Mat

unread,
May 3, 2018, 4:20:00 AM5/3/18
to TiddlyWiki
I was a bit too quick. Here are better solutions;


<div class="foo"><$navigator story="$:/StoryList"><<currentTiddler>></$navigator></div>

<style>
/*when content is a link*/
.foo a {visibility:hidden; position:relative;}
.foo a:before {visibility:visible; content:"xx"; }

/*when content is not a link*/
.foo {visibility:hidden; position:relative;}
.foo:before {visibility:visible; content:"xx"; }
</style>

-------------------

\define tiddlername(tid) [[static|$tid$]]

<<tiddlername oooo>>



<:-)

TonyM

unread,
May 3, 2018, 5:33:01 AM5/3/18
to TiddlyWiki
Mat,

I am not so sure how to make the Navigator widget works in the above example

<style>
/*when content is a link*/
.foo a {visibility:hidden; position:relative;}
.foo a:before {visibility:visible; content:"xx"; }
</style>


<div class="foo"><$navigator story="$:/StoryList"><<currentTiddler>></$navigator></div>


Regard
Tony

Mat

unread,
May 3, 2018, 7:00:17 AM5/3/18
to TiddlyWiki
Well, I don't know what the Navigator widget is supposed to achieve there to begin with? (I don't quite understand the docs). 

<$navigator story="$:/StoryList"><<currentTiddler>></$navigator>

For example, the output does not seem to be a link.

Maybe using the non-link styling and putting the div inside the nav helps? Like so:

<style>
/*when content is NOT a link*/

.foo {visibility:hidden; position:relative;}
.foo:before {visibility:visible; content:"xx"; }
</style>


<$navigator story="$:/StoryList">
<div class="foo"><<currentTiddler>></div></$navigator>

<:-)

TonyM

unread,
May 3, 2018, 7:50:49 AM5/3/18
to TiddlyWiki
Mat,

Thanks for your help so far.

In this case the navigator widget should open the <<currentTiddler>> in the story river (and open the tiddler). Usually this is the default however I trying to open tiddlers from outside the story.

Unfortunately this seems over my head as well. Never the less thanks for the other solution.

Regards
Tony

Mark S.

unread,
May 3, 2018, 11:41:29 AM5/3/18
to TiddlyWiki
Hi Tony,

I don't think the navigator-widget actually opens anything. If I'm wrong, I would sure love to have the full docs of the NW, since the docs at TIddlyWiki.com are really sparse.

Here's what it does -- I think. It catches any tiddler openings inside the widget and then adds them to the the "story" list attribute. That's it. It's then up to *you* to determine what happens inside of the navigator widget.

So if you create a tiddler $:/StoryList2 and populate it's list field with "[[HelloThere]]" at TiddlyWiki.com, then you can use this NW inside a tiddler to create it's own "river" :

<$navigator openLinkFromInsideRiver="top" story="$:/StoryList2">
<$list filter="[enlist{$:/StoryList2!!list}]" template="$:/core/ui/ViewTemplate" editTemplate="$:/core/ui/EditTemplate"/>
</$navigator>

Whenever you click on a link to a tiddler inside the river, it gets added to "$:/StoryList2" which is then used by the list to create the contents of the river. But it's up to you to create the tiddlers and provide the templates, etc.

It seems a lot like the link catcher widget to me, except that the link catcher just holds the last link (single) clicked inside of the LC widget.

HTH
-- Mark

Jeremy Ruston

unread,
May 3, 2018, 12:57:29 PM5/3/18
to tiddl...@googlegroups.com
The purpose of the navigator widget is to respond to messages like tm-navigate, tm-close-tiddler etc. by modifying the attached story river. The core page template includes an instance of the navigator widget pointing at the usual $:/StoryList and $:/HistoryList tiddlers.

The only reason to use the navigator widget is if you wish to target a story or history list other than the defaults, such as when creating what the docs call a substory.

Best wishes

Jeremy.

-- 
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/f1742a6a-46cd-43d1-8641-cca67d2cbeb9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark S.

unread,
May 3, 2018, 1:27:14 PM5/3/18
to TiddlyWiki
Hi Jeremy,

But in terms of what actually happens, it's really only the $:/StoryList that gets changed ... or is there something else?

How is the HistoryList used, and how might a user make use of it? Thanks!

-- Mark

Jeremy Ruston

unread,
May 3, 2018, 1:31:21 PM5/3/18
to tiddl...@googlegroups.com
Hi Mark
But in terms of what actually happens, it's really only the $:/StoryList that gets changed ... or is there something else?

No, the navigator widget modifies both the story list and the history list.

How is the HistoryList used, and how might a user make use of it? Thanks!

The HistoryList is a stack of the tiddlers that have been navigated to. It is used by the storyviews to animate navigations.

There are some docs here:


Best wishes

Jeremy.


TonyM

unread,
May 3, 2018, 9:59:01 PM5/3/18
to TiddlyWiki
Jeremy,

If I understand it correctly Hear I am trying to open a tiddler in the main story from inside a sibstory.

Regards
Tony

Jeremy Ruston

unread,
May 4, 2018, 4:10:40 AM5/4/18
to tiddl...@googlegroups.com
Hi Tony
>
> If I understand it correctly Hear I am trying to open a tiddler in the main story from inside a sibstory.

Great, that makes perfect sense.

Try something like this:

<$navigator story="$:/StoryList" history="$:/HistoryList" history=><$link to=<<currentTiddler>>><$text text=<<currentTiddler>>/></$link></$navigator>

Best wishes

Jeremy.


>
> Regards
> Tony
>
> --
> 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 tiddlywiki+...@googlegroups.com.
> To post to this group, send email to tiddl...@googlegroups.com.
> Visit this group at https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/628b1df9-33bc-4278-b355-d530fd1ef18b%40googlegroups.com.

TonyM

unread,
May 4, 2018, 5:06:32 AM5/4/18
to TiddlyWiki
Jeremy,

Thanks, so the navigator widget sets the story and other parameters for subsequent or wrapped, commands that involve navigation.

Normal behaviour will occur until another navigation widget changes it. We can then use the navigation widget to tempoarily step out of the current "story".

That now makes sence and I may experiment a little more now.

I wonder if we could swipe tiddlers into a diferent story, or develop a history for particular actions. No need to respond to these speculations, just thinking out loud.

Regards
Tony

Mat

unread,
May 4, 2018, 5:20:19 AM5/4/18
to TiddlyWiki
Tony, with Jeremys info I can now propose the followig for your original issue;

before <$navigator story="$:/StoryList" history="$:/HistoryList" history=><$link to=<<currentTiddler>> class="foo"><$text text=<<currentTiddler>>/></$link></$navigator> after

<style>
.foo {font-size:0px;}
.foo:before {content:"xx"; font-size:14px; }
</style>

This doesn't use "visibility" because visibility can cause seemingly empty space before a succeeding word (the "after" in the text). Instead this shrinks the original title to 0 which means we must then enlarge the pseudo element - BUT you might not want to hard code "14px" like that and instead transclude the font size from the theme settings.

<:-)

Mat

unread,
May 4, 2018, 5:34:03 AM5/4/18
to TiddlyWiki
DOH! Disregard my last message. How embarassing. You should of course simply just do it like so:

<$navigator story="$:/StoryList" history="$:/HistoryList" history=><$link to=<<currentTiddler>> class="foo">WHATEVER YOU WANT</$link></$navigator>


<:-)

TonyM

unread,
May 4, 2018, 6:13:37 AM5/4/18
to TiddlyWiki
Mat

Thats fine. When you respond so quickly you are bound to occasionaly trip up. Thanks for you help.

Tony

Reply all
Reply to author
Forward
0 new messages