Skip to content

Insert/Invoke Widget within widget code #5799

Answered by saqimtiaz
welford asked this question in Q&A
Discussion options

You must be logged in to vote

One option is to add a parse tree representation for widget1 into the children for widget2 in its execute method before calling this.makeChildWidgets (along with whatever parseTree will generate the content you want around widget1). This is a somewhat limited example:

this.makeChildWidgets([{
type: "edit-" + this.editorType,
attributes: this.parseTreeNode.attributes,
children: this.parseTreeNode.children
}]);

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…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@welford
Comment options

@welford
Comment options

Answer selected by welford
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants