If the JSON tiddler is a flat array:
[ .... ]
not
{ ... }
then zero-based numerals function fine for the index.
Button to add the content of [[$:/temp/newIndex]] to the JSON tiddler
defined in {{$:/temp/newIndex!!parent}}:
<$set name="i" filter="[{$:/temp/newIndex!!parent}indexes[]count[]]">
<$button><$action-setfield $tiddler={{$:/temp/newIndex!!parent}} $index=<<i>>
$value={{$:/temp/newIndex!!text}} />
Add Index
</$button>
</$set>
Tested on Tiddlywiki.com, works fine with both JSON tiddler types. If the
Json tiddler starts empty it will be started as an object {"0":"test"}, but
if it is aready setup as an array, a new index will just be appended:
["test"] -> ["test,"test"]
Best,
Joshua Fontany
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/66a73584-5e5d-41df-8beb-251119c31489%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.