Listfilter help needed for TW5 tutorials

181 views
Skip to first unread message

David Gifford

unread,
Jul 28, 2014, 11:24:27 AM7/28/14
to tiddl...@googlegroups.com
Hi guys

I plan to do a few introductory tutorials for TW5, something like http://giffmex.org/TiddlyQuickly.html, but I need help designing a piece of the puzzle.

I would like to have a setup tiddler for slideshows, tagged $:/tags/ViewTemplate, that displays arrows to the previous and next tiddlers in a list, and a home icon in the center that links to the first tiddler in the list.

The list filters needed would grab the tiddler in the current tiddler's 'listed' tab of the info panel, and would then create links to the previous, first, and next tiddlers in the list of that tiddler. It would display those links as left arrow, home, and right arrow icons, and apply CSS to position them left, center and right, respectively.

The list filter is the part that is beyond me. Figuring out TW list filters is like learning a foreign language to me. A foreign language with currently only a few native speakers and no introductory grammar textbook. So I would appreciate your help. :-)

If someone can get me the list filter I need, I can try to pump out some simple tutorials for TW5 before the full release. Thank you all, and blessings!
Message has been deleted

Richard Smith

unread,
Jul 28, 2014, 11:53:55 PM7/28/14
to tiddl...@googlegroups.com
Hi Dave,

I am trying to teach myself all the ins-and-outs of filters and things like that at the moment so I thought I would have a play with your request.

Although this is not exactly what you asked for, I wonder if it might suffice?

You can make a "tutorial" tiddler which has a list field containing the names of the tiddlers for each section and a field called "current" which holds the name of the current section. Then you ca have buttons that go backwards/forwards/home by changing the value of the "current" field.


list field: tut1sec1 tut1sec2 tut1sec3 etc.
current field: tut1sec1

<$list filter="[list[!!current]]">
Current slide: {{!!title}}
!{{!!title}}
{{}}
</$list>
---
First Slide in Current Tutorial (Home)
<$list filter="[list[]] +[first[]]" variable="gotofirsttiddler">
<$button set="!!current" setTo=<<gotofirsttiddler>>>
<<gotofirsttiddler>>
</$button>
</$list>
---
Previous Slide in Current Tutorial:
<$list filter="[list[]before{!!current}]" variable="gotoprevioustiddler">
<$button set="!!current" setTo=<<gotoprevioustiddler>>>
<<gotoprevioustiddler>>
</$button>
</$list>
---
Next Slide in Current Tutorial:
<$list filter="[list[]after{!!current}]" variable="gotonexttiddler">
<$button set="!!current" setTo=<<gotonexttiddler>>>
<<gotonexttiddler>>
</$button>
</$list>
---

Regards,
Richard 

Richard Smith

unread,
Jul 28, 2014, 11:55:58 PM7/28/14
to tiddl...@googlegroups.com
I forgot to say - I think this is better in some ways than what you asked for, for example it means that a single tiddler can potentially be included in multiple tutorials.

Regards,
Richard

David Gifford

unread,
Jul 29, 2014, 8:46:48 AM7/29/14
to tiddl...@googlegroups.com
Hey thanks Richard, actually, my original vision was to have the slide content visible from a framework like that rather than switching between slides. So your solution worked even better than expected. Here is my final product. (I am not sure how to center the home button so I am leaving it out for now).

<$list filter="[list[!!current]]">
{{}}
</$list>


<span class="floatleft"><$list filter="[list[]before{!!current}]" variable="gotoprevioustiddler"><$button class="btn-invisible" set="!!current" setTo=<<gotoprevioustiddler>>>{{$:/left.arrow.svg}}</$button></$list></span><span class="floatright"><$list filter="[list[]after{!!current}]" variable="gotonexttiddler"><$button class="btn-invisible" set="!!current" setTo=<<gotonexttiddler>>>{{$:/right.arrow.svg}}</$button></$list></span>


On Tuesday, July 29, 2014 1:24:27 AM UTC+10, David Gifford wrote:

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/1xb90ZBMk2U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.



--
David Gifford
Christian Reformed World Missions, Mexico City

Matabele

unread,
Jul 29, 2014, 9:14:50 AM7/29/14
to tiddl...@googlegroups.com
Hi David


On Tuesday, July 29, 2014 2:46:48 PM UTC+2, David Gifford wrote:

<$list filter="[list[!!current]]">
{{}}
</$list>

This will do for displaying the current tiddler:

<$transclude tiddler={{!!current}} mode="block"/>

regards

David Gifford

unread,
Jul 29, 2014, 9:30:21 AM7/29/14
to tiddl...@googlegroups.com
Thanks Matabele

Måns

unread,
Aug 11, 2014, 8:56:21 PM8/11/14
to tiddl...@googlegroups.com
Hi Richard

Nice :-)

How would you make it work with titles with more than one word?

Cheers Måns Mårtensson

Richard Smith

unread,
Aug 12, 2014, 5:03:48 AM8/12/14
to tiddl...@googlegroups.com
Hi Mans,

I just had another play with it and I think it's as simple as swapping the list-thingy at the top for a transclude-thingy, like this

<$transclude tiddler={{!!current}} />

---
First Slide in Current Tutorial (Home)
<$list filter="[list[]] +[first[]]" variable="gotofirsttiddler">
<$button set="!!current" setTo=<<gotofirsttiddler>>>
<<gotofirsttiddler>>
</$button>
</$list>
---
Previous Slide in Current Tutorial:
<$list filter="[list[]before{!!current}]" variable="gotoprevioustiddler">
<$button set="!!current" setTo=<<gotoprevioustiddler>>>
<<gotoprevioustiddler>>
</$button>
</$list>
---
Next Slide in Current Tutorial:
<$list filter="[list[]after{!!current}]" variable="gotonexttiddler">
<$button set="!!current" setTo=<<gotonexttiddler>>>
<<gotonexttiddler>>
</$button>
</$list>
---


I'm not really sure why I did it the other way - perhaps I hadn't figured out the transclude widget properly at that point (not that I feel I've really figured anything out yet)

The list widget fails to produce the correct behaviour when the text in the 'current' field looks like a list.

Regards,
Richard
Reply all
Reply to author
Forward
0 new messages