Fetching pictures from field via fET - how to get the right ones?

10 views
Skip to first unread message

Måns

unread,
Mar 14, 2009, 5:14:54 PM3/14/09
to TiddlyWiki
Hi
I've made a table with fET - which I would like to incorporate
pictures which have a fieldvalue in the tiddlers fetched...
Heres the idea for a fETcode in the table:
| <<wikify [img(55%,auto)[%0]] image@here \>\> |

- BUT image@here fetches the imagefield of the tiddler containing the
table and not from the tiddlers fetched into the table! - What am I to
write instead of "here"??


My full fET (Everything else works! - it's just the images that show
the wrong picture!!)

<<forEachTiddler where 'tiddler.tags.contains("Student") &&
tiddler.data("Lives")&& tiddler.data("Teacher") && tiddler.data
("Teacher").contains(context.viewerTiddler.title)'
sortBy 'tiddler.data("Teacher")'
write
'(index < 10)? "|"+(index+1)+"|[["+tiddler.title+"]] |
[["+tiddler.data("Lives")+"]] | [["+tiddler.data("Class") +"]] |
<<wikify [img(55%,auto)[%0]] image@here \>\> |<<toggleTag HERE
[["+tiddler.title+"]] nolabel \>\> | <<toggleTag SickLeave
[["+tiddler.title+"]] nolabel \>\> |\n" : ""'
begin '"|sortable|k\n"
+"|>|>|>| !<<wikify %0 teachersname@here \>\> | | <<tiddler HEREUpdate
\>\> | <<tiddler SickLeaveUpdate\>\> |h\n"
+"|!#| <<wikify [img(55%,auto)[%0]] image@here \>\> | Lives | Class |
image | ![[HERE]] | ![[SickLeave]] |h\n"'
end 'count+" Students\n"' none '"No students for this teacher\n"'>>

YS Måns Mårtensson

Måns

unread,
Mar 14, 2009, 7:10:46 PM3/14/09
to TiddlyWiki
As You can see from the code - it's essential that the link is
relative - because it resides in a template that I use for all
teachers.
The pictures are embedded as links in a field called "image"...

YS Måns Mårtensson

Måns

unread,
Mar 15, 2009, 5:36:27 AM3/15/09
to TiddlyWiki
Ok I found out myself:
|[img(25%,auto)["+store.getValue(tiddler,"image")+"]]|

It works very well!!

YS Måns Mårtensson
Reply all
Reply to author
Forward
0 new messages