Sibling widget communication

How can two sibling widgets (children or even descendants of a common parent) communicate?

For child-parent relation, there are ways: If a parent widget sets a variable, a child widget can read it. If a child widget sends an event, the parent can listen to it.

Is communicating through fields the only option?

In TW everything is “state” driven. That means, if any tiddler in the store changes, the refresh mechanism is activated. So if a widget has a state tiddler as an input, and this tiddler is changed, it will be refreshed. So if 2 sibling widgets “listen” to the same state tiddler they can use it to communicate.

Not sure if that helps.

You should be a bit more specific, what you want to achieve, so we could help in a more specific way.

1 Like

Rather than getting into the weeds, can you find the parent?, use a list or function that finds the related tiddlers and iterate them with your desired result displayed or a button/trigger to make some change.

As @pmario says;

Tell use what you want to achieve rather than describing a general function part way into the weeds.

I am confident this does not need JavaScript just TiddlyWiki Script