I am trying to create a list a tiddlers inside tabs
<<tabs "[[Clean Noise]][[Rename File]]" default:"" state:"$:/state/tab1" class:"tc-vertical" template="$:/talha131/Template/VerticalTab">>
The tiddlers are
I am going to add more to the list.
Is it possible to create a list or an array and then pass it to tabs
macro? Something like
let aList = [
'Clean Noise',
'Rename
'Other example'
];
<<tabs <aList> default:"" state:"$:/state/tab1" class:"tc-vertical" template="$:/talha131/Template/VerticalTab">>
The advantage of this format is clear. I can add tiddlers to the list easily. The syntax is clearer than putting everything inside a filter. Is it possible?
The obvious work around, I can think of, is to tag those tiddlers and use the tag inside tabs macro. But I wonder if it is possible to do without creating a new tag for few tiddlers, just to get tabs transclusion working.
<<tabs "[list[aList]]" default:"" state:"$:/state/tab1" class:"tc-vertical" template="$:/talha131/Template/VerticalTab">>
The list field (s) is the closest thing to arrays in WikiText.
Ouch! I think I will stick with using tags then. I don’t think editing field of a tiddler would be as convenient as arrays in programming languages.
Thank you Mark.
Right. I have seen some example JS macros. In the examples, a simple parameter is passed to JS macro and it returns an output.
Currently, I am not sure how JS is used with TW constructs like tabs macro for example.
Say I create a JS macro, that returns a list of tiddlers. How do I use it with tabs
?
<$set name=someList value=<<yourJavascriptFanciness>>>
<$macrocall $name=tabs filter=<<someList>>/>
</$set>
Thanks Jed, this enlist
solution is perfect for my needs. I was looking for exactly the same format.
the interface between javascript and the much maligned widgets can be a bit complex because the widgets are designed to make markup tasks simple.
Haha, seems like there is a fault line in the community over JS vs widgets that I am yet to learn :)