Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Confusion on file paths

Quote Reply
Confusion on file paths
Alex,

When creating file paths, it's easier in the code to manually place the '/' rather than having it attached to one of the variables.

It makes working with templates and such easier.

Specifically, I'm looking at the
Code:
<a class="link" href="<%build_root_url%>/Detailed/<%detailed_url%>"><%Title%></a></B></FONT>

in the link.html file.

The use of /Detailed/ is very clear, separating the path URL and the file name, but if you look, <%detailed_url%> contains a leading slash. While it doesn't hurt anything, it doesn't need to be there, and it makes using that variable much harder.

It's really a good idea to *not* include trailing slashes and leading slashes inside variables and let the programmer be responsible for keeping track of it.

It makes the code easier to read and understand, and more consistent.

Thanks!
Quote Reply
Re: Confusion on file paths In reply to
Hi,

Don't you want:

<%build_root_url%>/Detailed/<%ID%>.html

as the link? I'm not sure where <%detailed_url%> came from?

Cheers,

Alex
Quote Reply
Re: Confusion on file paths In reply to
I dunno... sometimes you don't see the forest for the trees ... <G>

I've looked at so many of the mods, templates, and other things that it's quite possible that was inserted as a editor bloop, but it works Smile <G>

<%ID%>.html would certainly work much better Smile



------------------
Robert S. Pataki, MD
President, PUGDOG Enterprises, Inc.
http://www.postcards.com