Moving TiddlyWiki from "file:///" to Server

Greetings,

I have a simple 5.1.22 TiddlyWiki I’ve been building up as a simple file (file:///home/user/…/tw.html). Copying it for view under a web server (even localhost) causes the Javascript to stop functioning. The table-of-contents under a “Contents” tab I have, doesn’t render properly, I can’t bring up the settings via the gear icon…nothing. I can’t even scroll the page up/down through the table of contents.

What would stop the TW from functioning just by moving the file to web accessible? FWIW, a newly downloaded TW (empty) works just fine in the web-server context. The only work I’ve done is too add tiddlers and reference tiddlers from others. I’m not a JS coder, so no JS has been changed.

I did notice, by viewing the source of my TW HTML file, two variables:

$:/info/url/full
$:/info/url/pathname

still seem to have “file” path information. I’m presuming there is some config settings I need to change?

Ideas?

TIA

EDIT: I got it working using 2 different methods, but not sure if these are the correct methods.

Method #1: I changed the following Tiddlers to have server #1 information (localhost) while in “file” mode:

$:/info/url/full
$:/info/url/host
$:/info/url/protocol
$:/info/url/origin
$:/info/url/hostname

When I did this, it worked AND moving the file from server #1 to server #2, server #1’s info was on server #2, but things seemed to work.

Method #2: I deleted the above Tiddlers. This ended up with the tiddlers being auto-created/adjusted for each server it was on. This seems to be a better way of moving a file onto a web server, but I’m still hoping I’ll get an “authoritative” solution. :slight_smile:

Just checking that by ‘copy’ you really mean an Operating system file copy and not a “save file” from your internet browser, the latter will not work.

If you place a tiddlywiki file on a http server like any http file it can be viewed interactivly. Yes upload the file in disk so not save as. Now if you want to edit and save that is another story. On my cpanel server i have user tw-reciever.

  • for more support you need to detail what server.

As you’ve noted, the $:/info/url/... tiddlers are auto-created as “shadow” tiddlers by the TWCore code upon startup. Note that if you edit any of these shadow tiddlers, they become “real” tiddlers that effectively “lock in” their current values.

As such, when you moved your TiddlyWiki “from file:/// to Server”, those existing “real” tiddlers (with their local “file:///” values) interferred with the proper operation of your TW on the server. It’s not clear to me exactly why it produced the symptoms you described, but your solution (deleting those “real” tiddlers so the auto-created “shadow” values will be used) is the correct “authoritative” solution.

Also, welcome to the wonderful world of TiddlyWiki! We’re a friendly bunch, and generally eager to help, so feel free to ask as many questions as you like.

-e
Eric Shulman - https://TiddlyTools.com

2 Likes