-
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 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: https://github.com/Jermolene/TiddlyWiki5/blob/2da7ae0b735c45725802d813d15d0c807f95e65b/core/modules/widgets/edit.js#L58-L62Note 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.
If you ignore the context and just look at…