> I'm trying to catch a Tiddler tagged with a custom field. Below is the
> inline js. I've produced a minimal test (MTC) case [1]

Your MTC was A+!!!!  You started with a default tiddler that explained
what you were trying to do and how the test case was set up (which
tiddlers, etc).  Then, you clearly defined your goals in visual terms,
by simulating the desired result through hand-edited TW formatting and
went step by step through the various 'minimal' cases, building up to
the point of error.

Thanks so much!  That was a pleasure to read!  Now... here's some
answers:

> var u=store.getValue(tids[i] ,"field1");

In your MTC, the values stored in "field1" are already enclosed in
[[...]], which works nicely when rendering the value as a wiki link,
but is not correct when looking for tagged tiddlers.  You need to
remove the [[ and ]] before using at a param for doing the lookup.
This can be done in several ways.  Here's one:
        var v=store.getTaggedTiddlers(u.readBracketedList()[0]);

> out.push('|'+t+'|'+u+'|'+v+'|');}

I assume that the 3rd column above ("v") is intended to display a list
of titles for the matching tagged tiddlers.  However, the value of "v"
is not plain text... it's an array of tiddler objects.  To convert
that array into space-separated, bracketed text containing a list of
titles, ready to display, add:
        v=v.map(function(tid){return "[["+tid.title+"]]"}).join(" ");
just before generating your output.

Putting it together, the tweaked script looks like this:
        ...
        var t=tids[i].title;
        var u=store.getValue(tids[i] ,"field1");
        var v=store.getTaggedTiddlers(u.readBracketedList()[0]);
        v=v.map(function(tid){return "[["+tid.title+"]]"}).join(" ");
        out.push('|'+t+'|'+u+'|'+v+'|');
        ...

That should do it... let me know if it works.

enjoy,
-e

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to