Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Linking to Printed versions

Okay, so let's say I'm creating a website that has a printed version, is in English, Spanish and German. How do I create a link from one version to another?

On the English page:

"Click for: Spanish German Printable"

This is some Bizarro kind of "Link to Alternate Self" that I can't figure out. I half expect Mxyzptlk tell me the only way to do it is to make him say his name backwards.

Mark W
Tuesday, January 29, 2002

I agree; there should be a built in function for this.

I had given up on this until I found that {$.link$}, when used in an article to refer to itself, will give the filename (without the path).  With this, I was able to link across template families this way:

<a href="http://mymachine/PrinterFriendly/Articles/{$.link$}">(Click for printer friendly version)</a>

Where "PrinterFriendly/" is the name of my template family, and "articles/" is the folder inside CityDesk.

Because the URL is hard-coded, this solution has several weaknesses:

o  It will only work if you are using the given template for articles in a single folder.
o  The links will only work with a single publishing location.
o  It will only work if both template families use the same extension.

It wouldn't be too difficult to write a bit of JavaScript to munge a URL to point to another family, but I suspect the best solution will be in a future version of CityDesk.

Neil Hoopman
Thursday, January 31, 2002

Thanks for the advice on how to link to a different version of the same file. Somewhat inelegant, but functional. If you build it into the template, you can change it with relative ease when you change your site structure, though you'd have to document this somewhere so anyone else (or you later on) will know what to do when things start to break.

Mark W
Friday, February 01, 2002

i'll try to figure out an elegant way to do this for the next version.

Joel Spolsky
Friday, February 01, 2002

Thanks Joel, You RAWK.

PS I put in an order to my company's purchasing dept. for a couple of CityDesk pro editions yesterday. Not everyone in my dept is sold on it yet, but I think once they see how quickly I start churning out sites and how dynamic they are, they'll come around.

Mark W
Saturday, February 02, 2002

*  Recent Topics

*  Fog Creek Home