Spread out FeT generated thumbnails to a selection of tiddlers

23 views
Skip to first unread message

julien23

unread,
Aug 16, 2010, 12:39:04 PM8/16/10
to TiddlyWiki
Most of my tiddlers start with thumbnails with this FeT :

<<forEachTiddler
where
'tiddler.tags.contains("attachment") &&
tiddler.tags.contains(context.inTiddler.title) &&
tiddler.text.contains("image") '
sortBy
tiddler.created
descending
write
'"[img(,12em+)["+tiddler.title+"]] "'
>>

Is there a way to automate that ?

Could it be something to do with Stylesheet ? Transclusion ?

Regards

Måns

unread,
Aug 16, 2010, 5:15:39 PM8/16/10
to TiddlyWiki
Hi Julien23

On 16 Aug., 18:39, julien23 <ju.bouc...@gmail.com> wrote:
> Most of my tiddlers start with thumbnails with this FeT :
...
> Is there a way to automate that ?
>
> Could it be something to do with Stylesheet ? Transclusion ?
There are several ways to "automate" showing the result of your fEt in
tiddlers.
One idea is to use the tiddlermacro (<<tiddler SomeTiddler>>) in your
ViewTemplate tiddler.
Put your fEt in a tiddler [[thumbnails]] and put it in your
ViewTemplate like this:
<div macro='tiddler thumbnails'></div>

You might also want to use HideWhenPlugin - or TaggedTemplateTweak
plugin - to show the fEt only in tiddlers tagged with "SomeTag"

Regards Måns Mårtensson

Måns

unread,
Aug 17, 2010, 2:46:18 AM8/17/10
to TiddlyWiki
You might want to change your fET to:
<<forEachTiddler
where
'tiddler.tags.contains("attachment") &&
tiddler.tags.contains("$1") && tiddler.text.contains("image") '
sortBy
tiddler.created
descending
write
'"[img(,12em+)["+tiddler.title+"]] "'>>

and write in your ViewTemplate: <div macro='tiddler thumbnails with:
{{tiddler.title}}'></div>
to make it work..

Regards Måns Mårtensson

julien23

unread,
Aug 17, 2010, 5:35:34 PM8/17/10
to TiddlyWiki
Thanks a lot it works fine ( except for tidler title with the
character ' )

I just need to do a few adjustments to match my initial layout...

Thus I added

class='thumbnails'

in

<div class='thumbnails' macro='tiddler fetThumbnails with:
{{tiddler.title}}'></div>

but it would not let me define attributes for thumbnails in
[[StyleSheet]]

.thumbnails {
border:1px solid [[ColorPalette::Foreground]];
}

am I missing something?

Regards

Julien

julien23

unread,
Aug 18, 2010, 9:13:17 AM8/18/10
to TiddlyWiki
I have just noted a weak point to this method : thumbnails won't show
up if I call [[aTiddlerWithThumbnails]] with

<<tiddler aTiddlerWithThumbnails>>

since they are not real content of that tiddler.

PMario

unread,
Aug 18, 2010, 9:37:26 AM8/18/10
to TiddlyWiki
On Aug 17, 11:35 pm, julien23 <ju.bouc...@gmail.com> wrote:
> Thus I added
>
>    class='thumbnails'
>
>    <div class='thumbnails' macro='tiddler fetThumbnails with:
> {{tiddler.title}}'></div>

tiddler macro accepts a second parameter which adds a class to the
rendered content.
<<tiddler MyTiddler "thumbnails">>

in the template it should look like
<div macro='tiddler fetThumbnails thumbnails with:
{{tiddler.title}}'></div>

not tested. tell me, if it won't work.
-m
Reply all
Reply to author
Forward
0 new messages