Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

feature request: abslinks (2)

I've asked it once before, this time I have a suggestion on how to do it.

Could be done by preferences (also on folder level); but also per link.

E.g. "/fog00000042" could specify a abslink where
"fog00000042" would be default (relative) behavior.

My 404-handling (see other recent topic) made it once more important why relative links are not always convenient...

Adriaan van den Brand
Saturday, June 22, 2002

Or perhaps something like:

{$foreach 1 x in (filename "<name of article>") $} {$$} <other html here> {$next$}

Tuesday, June 25, 2002

Wait. I'm failing to see why this is a problem. Is it because you're using the link in a JavaScript?

Tuesday, June 25, 2002

(1): missing page. This is a page that is returned by the server regardless of the location of the desired page.


with a 404-handler at /missing.html

would send the /missing page to the browser, which thinks it is displaying /articles/thislinkdoesntexist.html
All images etc. of /missing.html are relative to the root whereas the browser will attempt to load them from /articles.

(2) perl scripts with template:
perl scripts run from /cgi-bin
So the browser will load images relatively from /cgi-bin.
However, there is no way I can publish an article in /cgi-bin because it is located on a different location on my server.
If I refer to a template in my html section, then the image-links are relative to that article, so useless from /cgi-bin

(3) generic files (e.g. central javascript file); If I want to 'load' some roll-over pictures, it can not be done from the javascript, since the browser will load relative to the html it belongs to, not the javascript.

(4) similar: import html page inside php

and so on.

Note that I see the value of relative links, and I want to be able to use both!

Ps: with absolute, I refer to absolute paths, not absolute urls (e.g. /articles/something as opposed to

Adriaan van den Brand
Thursday, June 27, 2002

Ah. I see your problem. You're not able to design normally and have a template that works in all of those situations. An absolute link is possible, but then you have to constantly preview on the server as you design, and lose a bunch of what's so cool about CityDesk in the meantime.

What if you kept all of your files one level deep.


etc. One index.htm at the root to redirect to whatever main page you have.

Then EVERY image link would be ../images/picture.jpg

Thursday, June 27, 2002

I have thought about this, but it doesn't work.

First: the website is currently designed in the same way as we organize the company, so I can deligate content to content owners. It is easyer on submaps.

My navigation system is designed for this too ;-)

Second: it doesn't work for cgi-bin. On one server I have
..  /cgi-bin
..  /html

and on another server

I have got everything working with other work-arounds.
So I have a variable PreloadMenu which contains the preload calls (and links) for the images; I use a PHP-wrapper to call perl and therefore my template is executed 'in place'. And so on. It would have been MUCH easier with abslinks though!

Adriaan van den Brand
Friday, June 28, 2002

*  Recent Topics

*  Fog Creek Home