Thanks you Eric,
Excellence as usual.
>
> I think you meant to say "when there are two space-separated values in
> the single custom field".
Yes, that is more accurate. I should have said 'two or more space-separated
values [...]
Are fields different from tags in that each individual space-separated value
have to be surrounded by [[double brackets]]? My experiments lead me to
believe this, but it might be the way that I have presented my problem in
the first place.
> for (var i=0; i<tids.length; i++) {
>
var val=store.getValue(tids[i],"field1");
> var filter="[tag["+val.readBracketedList().join("]][tag[")+"]]";
> var list=store.filterTiddlers(filter).map(function(t){return
> "[["+t.title+"]]"});
> out.push('|'+tids[i].title+'|'+val+'|'+list.join(" ")+'|');
> }
>
> I've been working though the code. [1] Here is how i understand it.
This is a string variable prepared to the format which
store.filterTiddlers() can handle. -
"[tag[val1]][tag[val2]][tag[val3]][tag[val4]]"
It can be seen that "[tag["+val.readBracketedList() means "take val, the
array of values in field1, and read them as a bracketed list.
But what about .join("]][tag[") ?
This is added to the string so that [tag[]] is added to the end of each
item, each time the for loop loops over the tiddlers.
What I don't understand is why [tag[]]
is needed. Why not just [tag["+val.readBracketedList()]]
I've tied to work back from the solution to learn how things work. [1]
Best Wishes
ALex
[1]
https://dl.getdropbox.com/u/1316865/TiddlyWiki/TiddlyWikiTestCases/TiddlersTaggedWithTwoFieldValues.html#[[The%20Solution]]%20[[Working%20back%20from%20the%20solution]]
enjoy,
> -e
>
> >
>
--
http://www.multiurl.com/g/64
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---