Hi

I am trying to create a sort of treeview diagram of tiddlers linked
through costum fields.
Lets say I have 6 tiddlers,

"TiddlerHead" with no input in field "myfield"

"TiddlerNeck" with the input "TiddlerHead" in field "myfield"

"TiddlerRightArm" with the input "TiddlerNeck" in field "myfield"

"TiddlerLeftArm" with the input "TiddlerNeck" in field "myfield"

"TiddlerRightHand" with the input "TiddlerRightArm" in field
"myfield"

"TiddlerLeftHand" with the input "TiddlerLeftArm" in field "myfield"

"TiddlerFingers" with the input "TiddlerRightHand" in field "myfield"
and "TiddlerLeftHand" in field "myfield2"

Now my goal is an output like:
----------------------------
TiddlerHead
        1. TiddlerNeck
                    1:a TiddlerRightArm
                                   1:a;i TiddlerRightHand
 
1:a;i-1TiddlerFingers
                    1:b TiddlerLeftArm
                                   1:b;i TiddlerLeftHand
 
1:b;i-1TiddlerFingers
----------------------------
I cant find a plugin that quite does this (cf http://tinyurl.com/qahkgm)
- non sorts through costum fields, and that is what i want.

So instead I am trying something like (be warned this may hurt real
programmers eyes)
(http://groups.google.com/group/tiddlywiki/browse_thread/thread/
5faa95cbd66cf884?tvc=2)

-------
/%
!out
$1
!end
%/<<tiddler ShowList##out with: {{
var out=[];
var target="$1";
var tids=store.getTiddlers();
for (var i=0;i<tids.length;i++) {
   var alpha=tids[i].fields.field
    if (alpha && alpha.contains(target))
      out.push("# [["+tids[i].title+"]]");

var target2= result2??;

   if (alpha && alpha.contains(target2))
             out.push("## [["+tids[i].title+"]]");

var target3=result??;

   if (alpha && alpha.contains(target3))
              out.push("### [["+tids[i].title+"]]");
}


out.join("\n");}}>>

------------------
And then I would be able to put
---------------------
[[TiddlerHead]]
<<tiddler ShowList with: {{tiddler.title}}>>
---------------------
Into TiddlerHead¨

But the code above clearly doesnt work, and I cant figure out how to
go beyond the first target.

The following code inserted into Tiddlerhead almost does what i want,
but it is obviously not a usefull code.
---------------
/%
!out
$1
!end
%/<<tiddler ShowList##out with: {{
var out=[];
var target="TiddlerHead";
var tids=store.getTiddlers();
for (var i=0;i<tids.length;i++) {
   var alpha=tids[i].fields.field
    if (alpha && alpha.contains(target))
      out.push("#[["+tids[i].title+"]]");

var target2= "TiddlerNeck";

   if (alpha && alpha.contains(target2))
             out.push("##[["+tids[i].title+"]]");

var target3="TiddlerRightArm";

   if (alpha && alpha.contains(target3))
              out.push("###[["+tids[i].title+"]]");
}


out.join("\n");}}>>
------------------------------

--

You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to tiddlyw...@googlegroups.com.
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.


Reply via email to