There's probably a plugin that will do this for you. But I was rolling
some code for this a couple weeks ago, so here's one approach.

Put the code labeled MAS_Library below into a tiddler with the title
MAS_Library (or whatever) and tag it as systemConfig.

Then to use the code, get the InlineJavascriptPlugin from the
tiddlytools.com website. Save and reload.

Then you can create a tiddler -- call it whatever you want -- to
invoke the code like this:

<script label="Start">
var tags = ["PACK", "BUY"] ;
var tids = MAS.getTiddlersWithAllTags(tags) ;
var titles = [] ;
for(var i=0;i<tags.length;i++) titles.push(tids[i].title) ;
story.displayTiddlers(null,titles) ;
</script>

After closing out the tiddler, clicking on the "Start" link will
invoke the code.
Just substitute your tags for the two I was using ("PACK", and "BUY").

HTH
Mark

** CODE FOR MAS_Libary Follows **
MAS = {} ;
MAS.getTiddlersWithAllTags = function(tags) {
//First collect all the tiddlers based on the first tag
//alert("key tag collection length: " + keyTags.length) ;
//alert("trying key tag: " + keyTags[0] ) ;
tiddlers2 = store.getTaggedTiddlers(tags[0]) ;
// Start a second empty collection
var out = [] ;
// Scan through each tiddler in collection generated by first tag
for(var i=0;i<tiddlers2.length;i++) {
  var isTagged = true ;
  // Scan through each remaining tag that wasn't part of
  // the initial collection
//alert("Checking " +tiddlers2[i] ) ;
  for(var j=1;j<tags.length;j++) {
    if(! tiddlers2[i].isTagged(tags[j]) ) {
      isTagged = false ;
      break ;
    }
  }
  //If all tags are present, add to second collection
  if(isTagged) out.push(tiddlers2[i]) ;
}
return out ;
}

--

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