Referring to the Current tiddlers Title

56 views
Skip to first unread message

Anthony Muscio

unread,
Jul 21, 2008, 1:32:08 AM7/21/08
to TiddlyWiki
People,

To increase the power of tiddly Wiki can anyone tell me how I may
include the current tiddlers title in macros and within tiddlers to
display itself ?

for Example

"Tiddler Name Example"
<<newTiddler
label:"new $1 with (tiddler.title)"
title:"new tiddler tagged with both $1 and (tiddler.title)"
text:"$1"
tag:"(tiddler.title)"
tag:":work">>
<<tiddler tiddlertocall with:"(tiddler.title)">>
<<tiddler (tiddler.title)note>>

This is "(tiddler.title)"
[[Edit (tiddler.title)|(tiddler.title)]]

----

Where (tiddler.title) is replace with the Current Title

eg <<tiddler [[Tiddler Name Example]] with:worktask>>

gives

new worktask with Tiddler Name Example
tiddlertocall
Tiddler Name Examplenote

This is "Tiddler Name Example"
Edit Tiddler Name Example


Thanks in advance

FND

unread,
Jul 21, 2008, 3:41:12 AM7/21/08
to Tiddl...@googlegroups.com
> can anyone tell me how I may include the current tiddlers title in
> macros and within tiddlers to display itself ?

You'll need one of Eric's CoreTweaks (ticket reference #444):
http://www.tiddlytools.com/#CoreTweaks
http://trac.tiddlywiki.org/ticket/444

Then you can use evaluated parameters* in the respective macro call:
<<newTiddler label:{{"foo " + tiddler.title + " bar"}}>>

HTH.


-- F.


* http://www.tiddlywiki.org/wiki/Macros#Evaluated_Parameters

Anthony Muscio

unread,
Jul 21, 2008, 4:48:34 AM7/21/08
to TiddlyWiki
Thanks FND,

However I have traveled this path before, it only works within the
newtiddler macro.

The following will not work;

{{"foo " + tiddler.title + " bar"}}
<<tiddler {{+ tiddler.title + " Test"}}>>

Or the other examples in the above question.

Ideally this feature would treat say $0 as the current tiddler name
and evaluate it before attempting to "process" or render the tiddler.
As can be done using the <<tiddler With:value>> and $1. Of course the
"With" demands that the tiddler is "nested".

Does this sound like a "feature" request. I see from your ticket that
people instinctively look for this.

Tony

Eric Shulman

unread,
Jul 21, 2008, 9:09:01 AM7/21/08
to TiddlyWiki
> However I have traveled this path before, it only works within the
> newtiddler macro.

Actually, the TiddlyTools' CoreTweaks code for ticket #444 sets the
'current tiddler' global object immediately before invoking *any*
macro, not just <<newTiddler>>.

> The following will not work;
> {{"foo " + tiddler.title + " bar"}}

This doesn't work because the 'evaluated parameter' is not inside a
macro. However, you *can* render the desired output by using the
<<wikify>> macro provided by:
http://www.TiddlyTools.com/#WikifyPlugin

usage: <<wikify "%0" {{"foo " + tiddler.title + " bar"}}>>

> <<tiddler {{+ tiddler.title + " Test"}}>>

This definitely should work, as the evaluated parameter *is* contained
in a macro. Note: the initial "+" in the evaluated parameter's
expresssion is not needed (though it does no harm).

enjoy,
-e

Anthony Muscio

unread,
Jul 21, 2008, 9:45:19 PM7/21/08
to TiddlyWiki
Thanks allot,

This will be very helpful;

Without adopting your above wikify tip I did get the following to
work;

I managed to create a tiddler named @braidwood with the following
inside it
<<tiddler !.ShowTasksatPlace>>

and the Tiddler !.ShowTasksatPlace contained
<<tiddler !.ListCurrentat with:{{config.options.txtcurrentmode}}
{{config.options.txtCurrentProject}} {{tiddler.title}}>>

Such that !.ListCurrentat was rendered with $1=mode, $2=CurrentProject
and $3 the title of the original tiddler @braidwood.
!.ListCurrentat contains various foreachtiddler commands to list
tiddlers.

Very Powefull, because now I can create a tiddler tagged @, with a
name of @placename using a template containing;
<<tiddler !.ShowTasksatPlace>>, On my Task view template I have a drop
down tagger that lists all tiddlers tagged @ and I can tag my task
tiddlers to be done at a place. If I open the tag/tiddler @braidwood I
get a list of all tasks at @braidwood, including excluding completed
etc...

Cool Cool Cool....

Given this tip and others I hope to make a GTD that one builds as one
goes, you could say a "a reusable non-linear personal web Task
Manager". It would be the user who develops the categories,
priority's, status values and the tiddlywiki just provides the
listing, tagging, tabbing, history dialogues.

Thanks Again TonyM
Reply all
Reply to author
Forward
0 new messages