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

Confusion on file paths

Quote Reply
Confusion on file paths

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
<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.

Quote Reply
Re: Confusion on file paths In reply to

Don't you want:


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


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.