Is there a way to get a widget instance ID? That is, given the use of a widget twice in a tiddler, something that uniquely identifies each?
Not that I am aware of but I see no reason to do so. Can you Give an example and tell us what led you to this question?
The example is that I have a widget with javascript code snippets that I’d like to add to the browser’s source tree with the sourceURL directive and I want something to use in case the user doesn’t supply one
This may be better in the Developer category as it’s not a regular discussion.
Had you named some widgets I may have pointed out a parameter or variable you could co-opt. But I am looking at it from the “TiddlyWiki Script” perspective not JavaScript.
- I can’t help any further unless you can generalise your requirement and share useable examples.
Hi @Ittayd we often need some kind of widget-specific ID in order to generate state tiddler titles that are unique to that widget. The core provides the <<qualify>>
macro and the <$qualify>
widget to help with this:
https://tiddlywiki.com/#StateMechanism:StateMechanism%20[[qualify%20Macro]]%20QualifyWidget