Creating multiple Tiddlers by iterating through a variable...

209 views
Skip to first unread message

Jan

unread,
Feb 7, 2017, 9:21:24 AM2/7/17
to tiddlyWiki
Hello,
I want to create multiple Tiddlers in the background, which shall later
on be used for a slideshow. They shall contain text created with a
variant of Thomas` extract Macro
http://tid.li/tw5/numbers.html#%24%3A%2F_telmiger%2Fslice (Here
<<slicetext>>) and have the numbered titles $:temp/Slide/$(number)$.
I would like to extract the text of the $(number)$ 1 to 10 if it has a
slice (<sli1>slicetext</sli1>) marked .
I do not know how to perform an iteration in Wikitext ... and
unfortunately there seems to be something else which is wrong because it
does not work with a number and a given Tiddler instead of variables either.

Here is a link to my experiment:
SlidesNStories.tiddlyspot.com#slidesfromslices:slidesfromslices%20SourceTiddler

\define nextsl() -->defines the Tiddler to extract from
<$list
filter='[list[$:/StoryList]after{$:/HistoryList!!current-tiddler}[search:text[sli1]]'>{{!!title}}</$list>
\end
\define slicetext(number)
<<slice $(next)$ $(number)$>>
\end


<$button>
<$set name="next" value=<<nextsl>>>
<$set name="text" value=<<slicetext>>>
<$list filter='[title[$(next)$][search:text[sli$(number)$]]'>
<$fieldmangler>
<$action-setfield $tiddler="$:temp/Slide/$(number)$" text=$(text)$/>
</$fieldmangler>create slide tiddler 1
</$list>
</$set>
</$set>
</$button>

Thanks a lot for help.
Jan

Thomas Elmiger

unread,
Feb 8, 2017, 4:41:58 AM2/8/17
to TiddlyWiki
Hi Jan,

just a quick hint from my phone: Is the link to your example working? Maybe you should update and expand the test content?

All the best!
Thomas

Jan Johannpeter

unread,
Feb 8, 2017, 1:25:18 PM2/8/17
to TiddlyWiki
Hi Thomas,
You are right. Obviously updating didn't work. My internet is down to snailspeed at the moment. I will be able to update by Friday.You could copy the text into the nonexisting tiddler so long.

Best wishes
Jan

\define nextsl()

<$list
filter='[list[$:/StoryList]after{$:/HistoryList!!current-tiddler}[search:text[sli1]]'>{{!!title}}</$list>
\end
\define slicetext(number)
<<slice $(next)$ $(number)$>>
\end


<$button>
<$set name="next" value=<<nextsl>>>
<$set name="text" value=<<slicetext>>>
<$list filter='[title[$(next)$][search:text[sli$(number)$]]'>
<$fieldmangler>
<$action-setfield $tiddler="$:temp/Slide/$(number)$" text=$(text)$/>
</$fieldmangler>create slide tiddler 1
</$list>
</$set>
</$set>
</$button>
--
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/06b2d249-6744-48c2-9619-99de196dbb7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jan Johannpeter

unread,
Feb 10, 2017, 11:43:39 AM2/10/17
to TiddlyWiki
Hi Thomas, hi all...
I am still searching a way to create multiple Tiddlers by iterating different numbers to extract numbered slices from a tiddler.
At least I managed to update my TW so that you can see my experiment which is alas not working yet:
http://slidesnstories.tiddlyspot.com/#slidesfromslices:slidesfromslices%20SourceTiddler

Help is very Welcome

Best wishes Jan

Jan

unread,
Feb 13, 2017, 7:14:06 PM2/13/17
to TiddlyWiki
Hi,
I am still looking for a way to create tiddlers that contain text
extracted from slices of a tiddler. (The aim is to build a slideshow
where big tiddlers can be divided into smaller slides.)
I managed to achieve most of it but one problem remains:
At the moment the macro (<<slicetext>>) is pasted into the field.
I would like to paste in the rendered value of the macro.

The link to the Test now works:
http://SlidesNStories.tiddlyspot.com#slidesfromslices:slidesfromslices%20SourceTiddler

Thanks for Help
Jan


\define slidetitle()
$:/temp/Slide/$(number)$
\end
\define nextslide()
[list[$:/StoryList]after{$:/HistoryList!!current-tiddler}search:text[sli$(number)$]]'>
\end
\define slicetext()
<<slice $(sourcetitle)$ $(number)$>>
\end

<$button>
<$list filter='1 2' variable="number">
<$list filter=<<nextslide>> variable="sourcetitle">
<$action-setfield $tiddler=<<slidetitle>>
text=<<slicetext>>/>
</$list>
</$list>
create temporary slide Tiddlers from slices
</$button>
Reply all
Reply to author
Forward
0 new messages