var t = tiddler;
// OR logic
if (t.isTagged("AAA")) {
  // do stuff
}
else if (t.isTagged("AA")) {
  // do stuff
}
else {
  // none of the above is true
}
;


// AND
if (t.isTagged("AAA")) {
  if (t.isTagged("AA")) {
    // do stuff
  }
  else {
    // none of the above
  }
}

=====
As you can see, you may get heavily nested structures very fast.
So it is ok for 2 tags.

But if you need better filtering you may need

// AND
var tids;  // will be an array
tids = store.getTaggedTiddlers("AAA")

var i;
for (i=0, imax=tids.length; i<imax, i+=1) {
  if (tids[i].isTagged("AA")) {
    // do stuff
  }
}

// OR
var tidsAAA;  // will be an array
tidsAAA = store.getTaggedTiddlers("AAA")
// work with tidsAAA[index]

var tidsAA;  // will be an array
tidsAA = store.getTaggedTiddlers("AA")
// work with tidsAAA[index]

=====
I highly recomend to use FireBug or Chromes dev tools to test the
above in the console first. So you'll see, what's going on.

=====

Code above is not tested. Some tested info can by found at my
TeamWork[3] place.


Have a look at  [1] http://tiddlywiki.org  or insideTW for more TW
core function info.


[2] http://www.tiddlytools.com/insideTW/#TiddlyWiki.prototype.getTaggedTiddlers
[3]http://hoster.peermore.com/recipes/TeamWork/tiddlers.wiki#[[HowTo
%20Sort%20by%20custom%20field]]

hope this helps.
mario

On Apr 29, 5:02 pm, axelm <[email protected]> wrote:
> PMario, thanks for the link. I will start learning.
>
> Now I ran into another question I don't know:
>
> how do turn this:
>
> if (tiddler.isTagged("AAA")) return "AAA";
>
> into an "if tiddler.is.*Any*Tagged("AAA","AA")" statement?
>
> I can't get it to work,
>
> thank you,
>
> axelm

-- 
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