[tw5] Re: How to link to file using relative path?

I’m picking up this very old discussion. What is the state of the art? It seems that the proposed solution by Eric Shulman


[[filename.pdf]] is a link to a tiddler, but
[[filename.pdf|filename.pdf]] is a link to an external file

And, because the link doesn't start with an /absolute/path/to/
folder/..., it is automatically handled by the browser as *relative to
the current directory* (i.e, the one containing the TW document).
Thus, you can also write something like:
[[old version|archives/filename.jpg]]
to link to a file in a *relative sub-directory*.

doesn’t work with the current version of TiddlyWiki.

I have exactly the constellation described in this example (see attached screenshot). The two links using a relative path respectively, point to a non-existing internal tiddler. The last link with the fullpath point correctly to the external PDF file.
How can I use relative paths to external files nowadays?

-Reinhard

Did you try: [[old version|./archives/filename.jpg]] ?
-m

To create a link to an external file using a relative path that doesn’t start with a URI scheme (e.g., not http://, https://, file://, etc.), you can use the [ext[text|relative path/file]] syntax

For example:
[ext[pdf|articles/Microcontent with TiddlyWiki.pdf]]

See “External links” in https://tiddlywiki.com/#Linking%20in%20WikiText

enjoy,
-e

3 Likes

Yes; it didn’t work as well.

By chance I stumpled upon a solution:

As soon as I put the prefix file: before the relative path, everything works as expected. So

[[old version|file:archives/filename.jpg]]

should do the job.

In my case

[[pdf|file:articles/MicroContent with TiddlyWiki.pdf]]

does work.

-Reinhard

(I’m using Firefox; didn’t test with Chrome.)

Of course, it must read ‘I stumbled upon…’

Is there a way to edit one’s own posts?

-Reinhard

Editing your own posts is one of the many features that GoogleGroups has REMOVED from their interface. This steady “decay” in utility of the GoogleGroups interface has led to the creation of an alternative Discourse-based server – https://talk.tiddlywiki.org/ – that provides a much richer set of tools. Many people (though not all) have migrated to using that system as their primary means for engaging with others in the TiddlyWiki community.

-e

Thanks Eric! In the future, I will post on the new forum.

-Reinhard