Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

about relative addressing

I develop on my localhost server.  So to access the site I'm working on I type this:

http://localhost/Sitename/

But when I publish live, I type this:

http://www.Sitename/

This loop builds my menu links properly if I am including it in articles at the top level.

<ul id="leftMenu">
{$ foreach x in (folder "/")$}
<li><A href="{$x.filename$}.html">{$x.headline$}</A> {$next$}</li>
</ul>

  But when I use it with articles in a <em>folder</em> I end up with links like this on my localhost:

http://localhost/sitename/foldername/<linkfilename>

If I make a small change like so:

<li><A href="/{$x.filename$}.html">{$x.headline$}</A>

all works well on the web,  but my localhost gives me this:

http://localhost/<linkfile>

what to do, what to do?

Joel Goldstick
Tuesday, June 03, 2003

<li><A href="{$x.filename$}.html">{$x.headline$}</A> {$next$}</li>

that should be {$x.link$} and it'll append the .html for you.

Or {$x.abslink$} if you want the links to be absolute from the server.

www.MarkTAW.com
Tuesday, June 03, 2003

<a href="{$x.link$}">{$x.headline$}</a>

www.MarkTAW.com
Tuesday, June 03, 2003

thanks mark.  I guess i should have rtfm!

Joel Goldstick
Tuesday, June 03, 2003

lol

www.MarkTAW.com
Tuesday, June 03, 2003

*  Recent Topics

*  Fog Creek Home