How to fill HTML field with dataTiddler?

74 views
Skip to first unread message

Yuki Guo

unread,
Jan 13, 2021, 1:38:14 PM1/13/21
to TiddlyWiki

Hi,

I want to make Images Gallery on TiddlerWiki.
So I import the ImageList like this:
------
ImageList
------
------
TiddlerType: application/x-tiddler-dictionary


And only static dataTidder+index is working, but it not to change index.
------
<img src={{ImageList##1}} />
------

Then I try  RangeWidget and ViewWidget to finish it, but not working.
------
<$range tiddler="dataIndex" min="1" max="3" default="1" increment="1"/>
<img src=<$view tiddler="ImageList" index=dataIndex > />
------

I want to know: How to fill HTML field with dataTiddler?

Thanks.
Yuki

Mark S.

unread,
Jan 13, 2021, 2:11:41 PM1/13/21
to TiddlyWiki
The range widget needs to be linked to a tiddler that collects the value selected.

<$range tiddler="$:/myindex" min="1" max="3" default="1" increment="1"/>
<img src={{{ [[dataIndex]getindex{$:/myindex}] }}} />

Unfortunately, you can't reference the output of a widget (e.g. <$view/>) inside an HTML tag or even another widget. So instead the filtered transclusion  syntax is needed.

Yuki Guo

unread,
Jan 19, 2021, 9:47:06 AM1/19/21
to TiddlyWiki
Thanks Mark

Its worked fine.

Yuki

Mark S. 在 2021年1月14日 星期四上午3:11:41 [UTC+8] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages