TiddlyRedirect: a question for dev

5 views
Skip to first unread message

Yakov

unread,
May 10, 2011, 4:39:36 PM5/10/11
to TiddlyWiki
Motivation. It's not hard to create a page which redirects to a simple
html document. To achieve this one can use either html redirection
mechanism

<meta http-equiv="refresh" content="15; url=http://www.example.com">

or JavaScript technique

<script type="text/javascript">
document.location.href = "http://www.example.com";
</script>

On the other hand, TiddlyWiki has it's permalink engine and simple
redirect like

<script type="text/javascript">
document.location.href = "http://www.example.com/tiddlywiki.html";
</script>

wouldn't be an option.

For what purposes redirection can be used? The purpose I imply is the
following: one can "host" a tw-page on Dropbox analogues or in
TiddlySpot/TiddlySpace and then deside that it's time to create his or
her own site for some reason. It is likely that in this case some
users already have some bookmarks or may be posts with links to the
"initial host" place. The author, if wants to be polite, would like to
turn the old page into the redirection page (which should reproduce
the permalink mechanism).

So, as I understand this wouldn't be hard to do so -- just extend the
script like this:

<script type="text/javascript">
...
document.location.href = "http://www.example.com/tiddlywiki.html" +
permalinkSuffix;
</script>

The question is how to form the permalinkSuffix. More specificly, how
to access the StartupParameters?

Then, the method can be extended if needed -- for instance, make
custom redirection for a specific tiddler (by checking whether the
tiddler's name present among those in the permalink).

Also, let me know if I missed something -- may be this solution is not
educated enough.

Eric Shulman

unread,
May 10, 2011, 5:09:23 PM5/10/11
to TiddlyWiki
> Then, the method can be extended if needed -- for instance, make
> custom redirection for a specific tiddler (by checking whether the
> tiddler's name present among those in the permalink).

Give this a try:
http://www.tiddlytools.com/#MissingTiddlersPlugin
http://www.tiddlytools.com/#MissingTiddlersPluginInfo

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios
----------
Was this answer useful? If so, please help support TiddlyTools:

TiddlyTools direct contributions: (paypal)
http://www.TiddlyTools.com/#Donate
UnaMesa tax-deductible contributions:
http://about.unamesa.org/Participate (paypal)
TiddlyWiki consulting:
http://www.TiddlyTools.com/#ELSDesignStudios
http://www.TiddlyTools.com/#Contact

Yakov

unread,
May 11, 2011, 2:34:39 PM5/11/11
to TiddlyWiki
MissingTiddlersPlugin is nice for inner redirection, like in the case
of SelectStylesheetPlugin. However, the purpose I mean would demand
some tweaking with <<tiddler>> macro with which I'm still not familiar
(somewhat like: in MissingTiddler -- <<tiddler>> with a script which
pushes tiddler.title into an array and a <<tiddler>> macro somewhere
else which would read the array and make the redirection). And anyway
this looks too devious.

Why I want the direct redirection instead of new fallback content?
because I want to try the first approach of personal "site" as
following: blog at LJ + TW-page with iframes for discussions connected
to the tiddlers. I don't want to learn the the domain registering and
other stories of site hosting for the first time. At the same time I
don't want the links in the blog become "click once more to go to the
page" things. I want to be sure that once I decide to move to another
service/new domain I can just stick the redirection engine and then
remove the deprecated links from the blog gradually.

So, I think I need to learn the paramifiers engine and use it. I can
in [1] that there's the config.paramifiers object but I as for now I
don't understand how to grab paramifier values.

Also, I've made two notes on the redirection. First, the redirecting
page should remain editable, so the author could "enter" TW without
being redirected. This can be done by using a "key" paramifier which
should be caught by the redirection engine. Second, redirection
mechanism can cause the new TW-page to open an additional tiddler
which would prompt to change the bookmark. But this is rather bad
practice since the user can just have followed a link from a site so
he or she can't refresh anything.

[1] http://www.tiddlytools.com/insideTW/
Reply all
Reply to author
Forward
0 new messages