Hi Mohammad

There are some explanation on *currentTiddler *variable on Tiddlywiki.com 
> but still I cannot find the exact use-case for it.
>
> I want to know inside a tiddler how can I use *currentTiddler*
>
>
>    - <<currentTiddler>>
>    - $currentTiddler$
>    - $(currentTiddler)$
>
>
> A case study:
>
> On https://tiddlywiki.com create a tiddler with following code! You can 
> see it works
>
> \define test(_)  This is a $_$
>
>
> <<test $(currentTiddler)$>>
>
> But in documentation it says, $(var)$ is only available inside macro!
>

The confusing thing here is that the macro text substitution process is 
performed repeatedly until no more substitutions are found. Thus, in this 
example, the string "$(currentTiddler)$" is passed as a parameter to the 
macro. The first text substitution replaces the $_$ with that parameter 
value, yielding "This is a $(currentTiddler)$". The second text 
substitution replaces "$(currentTiddler)$" with the value of the variable 
"currentTiddler".

Note that text substitution is rarely the best way to accomplish things. It 
was implemented early in TW5's life as a bit of a hack to allow certain 
complex operations to be performed in order to build the UI. There are 
quite a number of gotchas with its use. The wikitext language has been 
enhanced considerably since then, and now there are better primitives for 
most situations.

Best wishes

Jeremy.


 

>
> - Mohammad
>
>
>
>
>
>
>
>
>
>
> Supporting docs:
>
>    - https://tiddlywiki.com/prerelease/#Current%20Tiddler
>    - https://tiddlywiki.com/prerelease/#currentTiddler%20Variable
>    
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/8fad62e1-8a2c-4318-be8b-8503a944edce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to