Email or username:

Password:

Forgot your password?
gavcloud

did you know that you can transclude a field directly into a filter run in ?

To test this out I started a Photo Journal in my 🌱 [[digital garden]]

I have a tiddler with the field `path` and I can print its contents using the transclusion notation:

{{!!path}}

7 comments
gavcloud

{{!!path}} is a unique field which contains the system path of where external image embeds are located.

I want Photo Journal to list all items tagged with [[Photo Journal]] and in reverse chronological order (date):

<$list filter="[tag[Photo Journal]!sort[date]]">

gavcloud

the only photo journal I have right now is called Berlin (2008 May) and the image grid code is very concise and cool!

<$list filter="[prefix[$:/images/photo-journal/berlin-2008/wide/]]">
<$link to=<<currentTiddler>>><$image source=<<currentTiddler>> />
</$link>
</$list>

gavcloud

This list widget is basically saying anything that starts with the path `…/berlin-2008/wide/` gets displayed. Notice the path is hard coded in this Photo Journal entry for Berlin (2008 May).

But what if I want to display an excerpt of this Berlin collection on the index page of all the Photo Journals, like a little preview ?

Back to our loop that pulls in all the items tagged [[Photo Journal]]:

<$list filter="[tag[Photo Journal]!sort[date]]">

gavcloud

Within this list widget, I am going to open up a new list widget and copy the filter run above used in the Berlin photo journal.

But there's a catch with the notation: transclusions within a filter run only accept single curly brackets 😮

gavcloud

So our sub-filter within the Photo Journal loop will now transclude the currentTiddler's field called `path` … with an offset of 6 + a limit of 3 (displaying the 7th 8th + 9th photos)

<$list filter="[prefix{!!path}rest[6]limit[3]]">
<$image source=<<currentTiddler>> />
</$list>

Go Up