Show a tiddler if wiki served over a certain URL

Is it possible to show a particular tiddler on page load if the wiki is served over a certain URL?

Obviously I can write a startup action widget that will do this, but that seems very heavy-weight. Are there other more idiomatic solutions?

One way is to load a generic tiddler via default tiddlers but the logic inside determins the content visible, in this case depending on if;

  • The key is to choose a $:/Info shdow tiddler or subset of one of these to do your test perhaps $:/info/url/origin
<$list filter="[{$:/info/url/origin}match[https://tiddlywiki.com]]" emptyMessage="Not where originally published">
Where originally published
</$list>
  • I just tested this on tiddlywiki.com, save and opened it locally and it worked.

You can use a start-up action if you want and its still light weight, you can just use it to trigger a navigation event to your desired tiddler.

Here is an untested example of the content of a startup tiddler

<$list filter="[{$:/info/url/origin}match[https://tiddlywiki.com]]" emptyMessage="""<$action-navigate $to="Thanks for downloading tiddler"/>""">
<$action-navigate $to="Welcome you can download this wiki tiddler"/>
</$list>

Interesting question. The alternative to using startup actions is to take advantage of the fact that $:/DefaultTiddlers contains a filter, not just a list of tiddler titles. Therefore it is possible to include items like this that calculate a tiddler title dynamically:

[{$:/info/url/full}match[https://tiddlywiki.com/]then[HelloThere]else[GettingStarted]]
2 Likes

Thank you; that looks perfect. I’ll test it tomorrow. I didn’t know anything about $:/info/*. I’ll dig into it

Once again, thank you for your time and your help.

Thank you. There’s always so much to learn. I’m going to have to investigate $:/info.

Thank you both. This worked well, combining Jeremy’s suggestion of $:/DefaultTiddlers with Tony’s suggestion of $:/info/url/origin. I hadn’t run across $:/info before, and it’s really nice to know it exists.

I asked my question in a hurry, and the brief backstory is that the big wiki I’ve been developing at work has been hosted in my personal GitLab region. The time has come to move it to a more permanent spot, which was easily enough done, but a number of early reviewers had been given its temporary URL. Not I have a way to keep my personal version around as a staging ground for bigger changes while telling users that they’re in the wrong place. It works great.

Thank you both for your help.