On Friday, February 21, 2014 11:44:48 PM UTC-8, whatever wrote:
>
> If I understand correctly, you want this to execute every time the tiddler 
> tags contain the tiddler's title?
> If so, this should work: where 'tiddler.tags.contains(tiddler.title)'
>

In his example, Anton said that the tiddler named "Locations" has
   <<forEachTiddler where 'tiddler.tags.contains("Locations")'
i.e, find tiddlers tagged with the title of the tiddler that contains the 
<<forEachTiddler>> macro.

However, in your suggestion:
   <<forEachTiddler where 'tiddler.tags.contains(tiddler.title)'
will find tiddlers tagged with their *own* title, rather than the title of 
the containing tiddler.

One way to achieve the desired result is to use <<tiddler>> transclusion 
with 'parameter substitution'... 

First, create a tiddler, [[InvokeParameterizedForEach]], containing:
------------
<<forEachTiddler
     where 'tiddler.tags.contains("$1")'
     ...
>>
-------------
Then, create a tiddler named [[Locations]], containing:
   <<tiddler InvokeParameterizedForEach with: {{tiddler.title}}>>

When the <<tiddler>> transclusion is processed, the current 
{{tiddler.title}} value (e.g., "Locations") with be inserted in place of 
the $1 that is in [[InvokeParameterizedForEach]].  

The <<tiddler ... with: param param ...>> macro syntax can accept up to 9 
parameters corresponding to $1 through $9 substitution markers in the 
target tiddler.  Thus, you could also parameterize the rest of the where 
clause as well as the action/display clause using the same <<tiddler>> 
transclusion method.  Caveat: as you've already noted, using quotes to 
delimit parameters becomes problematic when the parameter values themselves 
contain quotes.  One possible workaround: TWC macro params can be "quoted" 
by using doubled-square brackets.  Thus:

     <<tiddler Tiddlername with: [[first param value]] [[second param]] 
[[third param]] ... >>

That should be enough to get you started.... let me know if you get 
stuck....

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...
   http://TiddlyTools.github.com/fundraising.html#MakeADonation

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:
   http://www.TiddlyTools.com/#Contact

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to