I would like to be able to detect if my wiki is loaded via a file:// or http://
protocol. Is this possible? I want to be able to configure the wiki interface pending on the protocol.
Bobj
I would like to be able to detect if my wiki is loaded via a file:// or http://
protocol. Is this possible? I want to be able to configure the wiki interface pending on the protocol.
Bobj
see https://tiddlywiki.com/#InfoMechanism
You want to look in {{$:/info/url/protocol}}, which will contain “file:”, “http:”, or “https:”
Thus, you can create a “startup” tiddler (tagged with $:/tags/StartupAction/Browser
) containing something like this:
<% if [{$:/info/url/protocol}match[file:]] %>
... $action-setfield widgets for local file configuration ...
<% else %>
... $action-setfield widgets for hosted file configuration ...
<% endif %>
(see https://tiddlywiki.com/#Conditional%20Shortcut%20Syntax)
enjoy,
-e
For some toys and useful discussion from folks who have leveraged this difference with css etc., see this thread on TiddlyTweaks readOnly solution: Simple solution for an online read-only TW