Hi Mans,
Your scripts doesn't work (here) for a number of reasons.
1) It doesn't output any tiddler text
2) it doesn't properly close the table on any number of hr-separated
tiddlers that is not a multiple of 5
3) if it actually was to output tiddler text, it wouldn't work,
because you would have to ensure that the tiddler-text wouldn't break
the table syntax... so you might have to put <<tiddler
embedThisTidder>> into table cells
4) yet, using <<tiddler SomeTiddler>> to embed its content wouldn't
actually collate the tiddler contents as Morris was looking for
Also...
*you don't need hr's... simple linebreaks will do too, even a
bracketed list
I have been fiddling with your codebits to make something I would
consider a workable solution:
<script>
var i,n,out='',tid,txt;
if('$1'=='$'+'1')return;//no list, no output
var items=store.getTiddlerText('$1') .split('\n');//linebreaks will do
var cols=parseInt('$2');if(isNaN(cols))cols=5;//num cols as 2nd param
n=(parseInt(items.length/cols)+1)*cols;//num cells as multiple of num
cols
for(i=0;i<n;i++){
if(i&&i%cols==0)out+="|\n";//new row
ti=items[i];//title
tid=store.getTiddler(ti);//tiddler
out+='|'+(tid?'<<tiddler [['+ti+']]>>':(ti?'!@@color:red; "'+ti+'"
not found!@@':''));//add item to row
}
out+="|\n";//end last row
return out;
</script>
Assuming script-tiddler is called 'out', you can call it via
<<tiddler out with: tidderWithList##OrListSection 3>>
Where 3 would be the number of columns.
Regards, Tobias.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---