Referencing the tiddler.title within the same tiddler

25 views
Skip to first unread message

AlanBCohen

unread,
Nov 26, 2009, 8:51:50 AM11/26/09
to TiddlyWiki
First, Happy Thanksgiving to the Americans, and belated Thanksgiving
to the Canadians.
My question is how to reference a tiddler's title within a tiddler.
For example; I have tiddlers where the title is a jobnumber/workunit.
The tiddler contains a forEachTiddler macro to list all the tiddlers
with that tag. For example, I have a workunit tiddler 'job12345',
which is also a tag used for journals. This tiddler contains a
forEachTiddler macro with a 'where tiddler.tags.contains
("job12345")'. Currently, to create a workunit tiddler, I copy an
existing workunit tiddler and edit the 'where' clause for the new tag
value. I'd like to simplify the process by using a template where the
'where' clause simply contains a reference to the tiddler.title of the
tiddler containing the macro (not the titles of the listed
tiddlers).
Another identical use in the same application is tiddlers titled by
date (yyyy-mm-dd) listing all the journals (date and timestamp titled)
for that date. currently, I create that tiddler by clicking on a date
from the calendarPlugin display and copy in a forEachTiddler macro
from the previous day and edit the 'where' clause. If I could use a
template for that, I could eliminate the edit 'where' clause step.
Thanks in advance!
Alan

Måns

unread,
Nov 26, 2009, 1:30:58 PM11/26/09
to TiddlyWiki
Hi Alan

{{tiddler.title}} or "+tiddler.title+"
Examples: http://dl.dropbox.com/u/1064531/screendmp/empty/fETtest.html


Regards Måns Mårtensson

Måns

unread,
Nov 26, 2009, 2:42:33 PM11/26/09
to TiddlyWiki
Yet another one:
{{story.findContainingTiddler(place).getAttribute ('tiddler');}}

try
<<tag {{story.findContainingTiddler(place).getAttribute ('tiddler');}}
>>
<<tag {{tiddler.title}}>>

regards Måns Mårtensson

AlanBCohen

unread,
Nov 28, 2009, 10:06:40 AM11/28/09
to TiddlyWiki
I'm sorry. Perhaps I'm a little slow following your suggestions. But
this doesn't seem to work for me. It is likely I didn't understand.
tiddler title : 2009-11-28
tiddler tag: status
tiddler.text:
<<forEachTiddler
where
'tiddler.title.contains({{tiddler.title}}) && ! tiddler.tags.contains
("status")'
sortBy
'tiddler.title'
>>

which should list tiddlers:
2009-11-28 11:22:33
2009-11-28 12:02:03

Another tiddler with tiddler.title: 2009-05-22 with the same tag and
text would then return
2009-05-22 09:08:07
2009-05-22 14:45:00

(sorry for not including a concrete example earlier)

cmari

unread,
Nov 28, 2009, 8:32:33 PM11/28/09
to TiddlyWiki
Hi Alan,
You could try context.inTiddler.title (see
http://tiddlywiki.abego-software.de/#whereClause):
<<forEachTiddler
where
'tiddler.title.contains(context.inTiddler.title) && !
tiddler.tags.contains
("status")'
sortBy
'tiddler.title' >>
cmari

AlanBCohen

unread,
Nov 29, 2009, 12:18:25 AM11/29/09
to TiddlyWiki
Using 'context.inTiddler.title' looks like a winner, it works in my
experimental TW at home. On Monday, I'll try it out at the client
where it is needed.
Thanks!
Alan

AlanBCohen

unread,
Dec 1, 2009, 8:11:56 PM12/1/09
to TiddlyWiki
Just one final comment; I've used this and it works like a champ;
doing exactly what I wanted. Thank you to all who responded and all
of you who make this group such a success.
Alan
Reply all
Reply to author
Forward
0 new messages