This is what I want. However, what if I would put two or more tiddlers into examples field making it an array of tiddlers?
Like examples: S11, S12
How could I treat the value of examples field as an array? Since it seems not possible to run js directly in viewtemplate, is there any other method for my situation?
You can use the enlist filter operator to take a field containing several values, and split it into separate values for further processing with a $list widget.
TiddlyWiki uses SPACE-separated lists, so the contents of the !!examples field would be “S11 S12” (without commas). If an individual tiddler title in the field includes any spaces, you will need to enclose that title inside doubled square brackets, like this: “S11 [[S12 has spaces]]”
The $list widget gets the contents of the !!examples field from the current tiddler and uses the enlist filter operator to split it into separate values, each of which is assigned to the variable this_example, for processing one at a time.
The $link widget has an abbreviated form: when the text to display has the same value as the to=... widget parameter, you can avoid repeating the value and just end the $link widget with a closing /> as shown in the example above