-
I have two widgets in the same file, when i render the second one i would like to insert the first, is this possible? e.g. I would like this to expand to
and then have $widget1 run, I assume that would happen via "Widget.prototype.render.call" |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
One option is to add a parse tree representation for widget1 into the children for widget2 in its TiddlyWiki5/core/modules/widgets/edit.js Lines 58 to 62 in 2da7ae0 Note that the "internals" plugin is very useful for typing content into a tiddler editor and using the preview option to see the resultant parse tree. You absolutely can also create a widget1 instance and call render as well, but it will still need a parseTree. |
Beta Was this translation helpful? Give feedback.
One option is to add a parse tree representation for widget1 into the children for widget2 in its
execute
method before callingthis.makeChildWidgets
(along with whatever parseTree will generate the content you want around widget1). This is a somewhat limited example:TiddlyWiki5/core/modules/widgets/edit.js
Lines 58 to 62 in 2da7ae0
Note that the "internals" plugin is very useful for typing content into a tiddler editor and using the preview option to see the resultant parse tree.
You absolutely can also crea…