[Plugin Dev] How to override tiddlers from one plugin with another plugin?

58 views
Skip to first unread message

Adithya B

unread,
Mar 27, 2021, 3:07:09 AM3/27/21
to TiddlyWiki
Hi Everyone?

Suppose "abc" has a tiddler "$:/plugins/abc/abc/hi.js". 

Now, I want to change how this plugin behaves by overriding the tiddler "hi.js" using another plugin "xyz". 

Can I replace the "hi.js" tiddler from plugin "abc" with a new one in "xyz"?
Is there a mechanism to achieve this?

Thanks and Regards,
Adithya

Jeremy Ruston

unread,
Mar 27, 2021, 4:00:34 AM3/27/21
to tiddl...@googlegroups.com
Hi Adithya

Suppose "abc" has a tiddler "$:/plugins/abc/abc/hi.js". 

Now, I want to change how this plugin behaves by overriding the tiddler "hi.js" using another plugin "xyz"

Can I replace the "hi.js" tiddler from plugin "abc" with a new one in "xyz"?
Is there a mechanism to achieve this?

Yes, with the following points to watch:

* The module tiddlers must have exactly the same title
* If the module is added dynamically (eg drag and drop), the override won't take effect until TW is restarted
* Non-shadow modules always override shadow modules with the same title, but if you're overriding with another shadow module then the plugin doing the overriding may need to set its "plugin-priority" field to a numerical value to control the loading order of plugins

Best wishes

Jeremy



Thanks and Regards,
Adithya

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/19495cd8-c52b-45d6-b932-1c70bc82ca6cn%40googlegroups.com.

PMario

unread,
Mar 27, 2021, 8:21:55 AM3/27/21
to TiddlyWiki
On Saturday, March 27, 2021 at 8:07:09 AM UTC+1 bmad...@gmail.com wrote:

Now, I want to change how this plugin behaves by overriding the tiddler "hi.js" using another plugin "xyz". 

hmmm,
IMO this should be the last resort. I think the best way would be to contact the plugin author and try to establish an "interface" between the 2 plugins.
So it will be possible to develop them independently, but play nice together.

just a thought.
mario
Reply all
Reply to author
Forward
0 new messages