SimpleNavigation

232 views
Skip to first unread message

Magnus

unread,
Nov 29, 2019, 8:17:23 PM11/29/19
to TiddlyWiki
I have been trying to adapt the SimpleNavigation from https://tw-scripts.github.io/Yazd/#macro%2Fsimple-navigation.
I wanted to be able to cycle thru all childrenTiddler with the same parentTiddler but I can only cycle thru all tiddler.

I have a testTW up on http://magnus.test.tiddlyspot.com/.  All tiddler have a parent-field with value no 1 or no 2, and a relation-field with value parent, child or grandchild. I would like to be able to cycle from one child to the next child or grandchild with the same parent.

I bet it is super-simple but I think I tried all combination my tired brain can think of. Hope a tiddlywikier out there can help me :D

Cheers
Magnus 

Mohammad

unread,
Nov 30, 2019, 6:41:25 AM11/30/19
to tiddl...@googlegroups.com
Hi Magnus,
 This is a question of how write a filter to work as you asked!

The mechanism of simplenavigation is quite easy! It steps through tiddlers come from filter in a $list widget

Hope some one with better knowledge of filter operator can help.

--Mohammad

A Gloom

unread,
Dec 1, 2019, 12:21:52 AM12/1/19
to TiddlyWiki
I believe TWScripts has Tobias Beer's filter and filter operator examples -- here's the wki of filter examples -- http://tobibeer.github.io/tw/filters

I believe you want --
each of type *(type being field)
[each[type]get[type]]

Magnus

unread,
Dec 5, 2019, 7:53:30 PM12/5/19
to TiddlyWiki
Thanks for the help, suspected it had to do with the filter. Think I made it work, there is only one sorting problem left :)

A Gloom

unread,
Dec 5, 2019, 8:00:36 PM12/5/19
to TiddlyWiki
Magnus

Thanks for the help, suspected it had to do with the filter. Think I made it work, there is only one sorting problem left :)

Cool, whats the sorting problem?

Magnus

unread,
Dec 5, 2019, 8:21:10 PM12/5/19
to TiddlyWiki
I manage to cycle through only those with the same parent, now I'm trying to double-sort them, sort on relation, grandchildren first children last, and sort them after name, caption or whatever last. Kinda works but there isn't a next button on the last child-tiddler to first grand-child. It does work in the grand-child-tiddlers, the next and previous button are there and jumps to the right tiddler. 
I think it's still my filtering that's not working quite right

A Gloom

unread,
Dec 5, 2019, 11:52:24 PM12/5/19
to TiddlyWiki
Not sure if this would be of help, it involves tags & fields but what I use to backtrack a tiddlers' parent & grandparent and make a tree view of them

<$list filter="[all[current]tags[]has[categorytype]]">
<$link><$view field=title/></$link> - <$view field=categorytype/><br/>
<$list filter="[all[current]tags[]has[categorytype]]">
<$link><$view field=title/></$link> - <$view field=categorytype/><br/>
<$list filter="[all[current]tags[]has[categorytype]]">
<$link><$view field=title/></$link> - <$view field=categorytype/><br/>
</$list>
</$list>
</$list>

TonyM

unread,
Dec 6, 2019, 10:39:33 PM12/6/19
to TiddlyWiki
Magnus,

I am a little unsure of you having fields for parent-field and relation-field. My Parent is my child's grandparent, my grandchild's great grandparent. The only information is who is my parent then you can follow the story. The Kin Operator by Bimlas can help as can the TOCP plugin. Most relationships can be inferred from attributes and need not them self exist as separate entities. If you do have such a relationship field with a value you may be forced to maintain it unnecessarily when a change is made somewhere in the tree..

Regards
Tony

Magnus

unread,
Dec 9, 2019, 10:21:30 PM12/9/19
to TiddlyWiki
The http://magnus.test.tiddlyspot.com/ is only a small, generic testing ground to make it easier to find errors :) The "real" work is on http://magnus.playground.tiddlyspot.com/ (still only a small set of all orchid species) but all template and systemtiddler are hidden make it harder to work with :)

Magnus

unread,
Dec 9, 2019, 10:31:25 PM12/9/19
to TiddlyWiki
I think I worked out the sorting problem too, thanks to all your help! 
Just a thought, a "1-99% problem", 1% of the overall design, 99% of the work :D 
How would I go about to change the tooltip to show the caption-field of the target tiddler instead of the title?

Magnus

unread,
Dec 9, 2019, 10:40:34 PM12/9/19
to TiddlyWiki
Looks interesting, have to play with and see how I can use it :)

TonyM

unread,
Dec 10, 2019, 1:05:14 AM12/10/19
to TiddlyWiki
 
How would I go about to change the tooltip to show the caption-field of the target tiddler instead of the title?

 This provides the caption if available otherwise the title
{{{ [all[current]get[caption]] ~[all[current]get[title]] }}}

However getting this into the tooltip there are a few methods, but they all seem fussy
<$wikify name=mytooltip text="""<$view field="created" format="relativedate"/>, <$view field="created" format="date" template="On YYYY-0MM-0DD at 0hh:0mm"/> Caption or Title {{{ [all[current]get[caption]] ~[all[current]get[title]] }}}""" >

<$button tooltip=<
<mytooltip>> >Mouse over</$button>

<$wikify>

Regards
Tony

Magnus

unread,
Dec 10, 2019, 8:48:14 PM12/10/19
to TiddlyWiki
Thanks for all help & tips, managed to get it working :) 
I created a macro with 

\define tv-wikilink-tooltip()
<$transclude field="caption"><$transclude field="title"/></$transclude>
\end

and changed <$button to <$link in the simpleNavigation-macro and everything is dandy :D

A Gloom

unread,
Dec 10, 2019, 10:54:46 PM12/10/19
to TiddlyWiki
Thanks for all help & tips, managed to get it working :) 

most excellant to hear
 
I created a macro with 

\define tv-wikilink-tooltip()
<$transclude field="caption"><$transclude field="title"/></$transclude>
\end

ah, thats how the ToC macro displays caption then title -- you can also use that in normal lists (see below) -- reusing code is good

<$list filter="[list[$:/tags/SideBar]]">

<$set name="tv-wikilinks" value="yes">
  <$link><$transclude field="caption">
    <$view field="title"/>
  </$transclude></$link>
</$set>
</$list>

ToC macro

\define toc-caption()
<$set name="tv-wikilinks" value="no">
  <$transclude field="caption">
    <$view field="title"/>
  </$transclude>
</$set>
\end

TonyM

unread,
Dec 11, 2019, 8:41:51 PM12/11/19
to TiddlyWiki
For the passers by

 <$transclude field="caption">
    <$view field="title"/>
 </$transclude>

Shows only the caption OR the title because

The TranscludeWidget treats any contained content as a fallback if the target of the transclusion is not defined 
(ie a missing tiddler or a missing field).

This varies according to the widget in use, look at tiddlywiki.com widget tiddler to see the ViewWidget works the same way but not others;
eg The action-createtiddler widget is invisible. Any content within it is ignored. The content of the <$browse> widget is ignored....

Regards
Tony
Reply all
Reply to author
Forward
0 new messages