I’m working on a plugin for my personal use that I can easily install in multiple wikis. This way I can maintain multiple wiki configurations very simply. But now I need to modify tiddler in another plugin and package the modified tiddler into my plugin, how do I do that?
A simple but never occurred to me before is to write a button in the settings option, with the code in another entry. That way all someone has to do is click the button and a new entry is immediately created out of it, and then it’s done overwriting the rest of the plugin content that way.
<$button>
<$action-createtiddler $basetitle="search-box-fixed-notebook" tags="$:/tags/Stylesheet" text={{$:/plugins/mabuqian/gumo-customisation/search-box-fixed-notebook}}>
<$action-navigate $to=<<createTiddler-title>>/>
</$action-createtiddler>
Creating fixed search box for notebook themes
</$button>
I’m not sure how that second post of yours answers your original question, but this is an answer to the quoted here:
Assuming you know how to create a plugin - you can just include that modified shadow tiddler in your plugin without a problem, just like with any tiddler.
But I’m pretty sure you will get problems if two shadowtiddlers from two different plugins use the same title. I don’t know how to get around that. Also make sure that any macros or procedures therein use different titles.
Thanks for the reply, but I’m having this problem again today and it doesn’t look like I’ve solved the problem.
I have a question as to why the style files packed into the plugin don’t work. Whereas copying the same code to a newly created tiddler, the style file works immediately. May I ask what causes this? How can I make the style file in my plugin work? Especially for global nature like tc-editor-toolbar.
The problems I’ve had so far in creating plugins are basically css problems. css is so complex that I have absolutely no idea how to modify it to achieve the effect I want.
So now I’m basically using the !important
way to get around it. It may not be the best way, but it works.
OK, CSS behaves different than other code. For example, if there are two css definitions with identical targeting, e.g
.my-class div a {background:red}
…and in some other place
.my-class div a {background:blue}
…then the last one called “wins”. So, you can, without a problem, copy a stylesheet from some plugin and make modifications, but you must ensure that your version is called after the other. This is fortunately very easy to control:
If you click the $:/tags/Stylesheet
tag that every stylesheet has, you can see the order in the dropdown and rearrange the stylesheets. The lowermost wins over anyone above it.
Thanks again for your warm reply.
But sometimes when I do, it doesn’t take effect. And because it may only be this one tag, I usually need to look for conflicts in many stylesheet files.
Make sure that stylesheets are not only tagged correctly but also of tiddler type Static stylesheet (text/css)
or of type TiddlyWiki 5 (text/vnd.tiddlywiki)
If you are using any local style blocks (i.e <style>...</style>
in tiddlers) or inline styles (e.g <div style="...">
) then this takes precedence over stylesheets. Other than that, there should be no conflicts - the last stylesheet should “win” if the targeting has the same specificity.