How to refer to a content of particular tiddler

19 views
Skip to first unread message

Joc

unread,
Mar 21, 2012, 12:48:31 PM3/21/12
to TiddlyWikiDev
I am using forEachTiddler plugin and I would like to make a search
condition based on a text found in particular tiddler referenced by
name.

e.g.

<<forEachTiddler
where
'tiddler.tags.containsAny(["TaskToDo","TaskOpen","TaskDone"])'
>>

I'd like to replace everything inside parenthesis
(["TaskToDo","TaskOpen","TaskDone"]) with text from a tiddler called
"Filter".

Thanks for help.
Message has been deleted

Eric Shulman

unread,
Mar 21, 2012, 7:04:53 PM3/21/12
to TiddlyWikiDev
>  'tiddler.tags.containsAny(["TaskToDo","TaskOpen","TaskDone"])'
>
> I'd like to replace everything inside parenthesis
> (["TaskToDo","TaskOpen","TaskDone"]) with text from a tiddler called
> "Filter".

'tiddler.tags.containsAny(store.getTiddlerText("Filter","").split("\n"))'

store.getTiddlerText() retrieves the source text from a tiddler named
"Filter" (with fallback to blank text if the tiddler does not exist).
This text is then split() at the newlines (if any) into an array of
separate values, which is passed to containsAny(...) to test the
'current' tiddler's tags. To specify the desired tags to match, you
simply list them, *one per line* in the [[Filter]] tiddler (note: make
sure there are no blank lines, as this will produce a match for the
empty string, "")

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

----
WAS THIS ANSWER HELPFUL? IF SO, PLEASE MAKE A DONATION
http://www.TiddlyTools.com/#Donations
note: donations are directly used to pay for food, rent,
gas, net connection, etc., so please give generously and often!

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


Joc

unread,
Mar 22, 2012, 3:41:40 AM3/22/12
to tiddly...@googlegroups.com

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios


Eric, perfect!
Thanks,
 Joc.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages