wildcard for current directory?

S

Steve D.

Is there a wildcard I can use to indicate the current directory on my site?
For example, I'd like to point a button to File.htm in the current directory
without necessarily having to specify the entire URL and subdirectory name in
the code so that I can re-use the same code in other directories without
changing all the URLs in all the hyperlinks.

Thanks!
 
R

Ronx

Use relative links (which is the norm in FrontPage).
A link to file.htm in the current directory would be:

<a href="file.htm">file in current directory</a>


A link to file.htm in the parent directory would be:

<a href="../file.htm">file in parent directory</a>


A link to file.htm in a folder at the same level as the current
directory would be:

<a href="../folder/file.htm">file in another folder</a>

A link to file.htm in a sub folder of the current directory would be:

<a href="folder/file.htm">file in sub folder</a>


The wildcard is ./ but I have noticed this can confuse some programs
(including Perl), and there is no reason to use it that I know of.

Your question can be interpreted two ways - the above is one
interpretation, the other is: Do you need to point a link to a
particular file from pages in other folders? In this case, the answer
is there is no wildcard for this. However, if you use include files for
your link bars the links will be automatically corrected when you insert
the includes in other files, no matter which folder level they go into -
though there are problems with the button rollovers when using
Interactive buttons. FrontPage will not adjust links in JavaScript.
 
S

Steve D.

Thanks for the help. To clarify something... If I want to link a button to a
file (ie File2.htm) that is in the current subdirectory, can I simply assign
the hyperlink "/File2.htm" to the button in Frontpage rather than manually
editing the code and specify the path in the href?

Thanks again.
 
S

Steve D.

P.S. Frontpage won't allow me to put just a file name (without a path) in the
Hyperlink field for a button, but it will allow me to put it in preceded by a
slash, then I notice in the code it adds the path to the href.
 
R

Ronx

I always browse to the files I want to link to - this way FrontPage gets
and applies the correct relative path.

If you use a path such as /folder/file.htm - this is a root-relative
(sometimes known as virtual) path. FrontPage cannot manage these. If
you move the file the link will not be updated.

From your previous post:

Linking to a file in the same directory, do not use a path at all
<a href="file2.htm">
To a file in a subdirectory:
<a href="subdirectory/file3.htm>
To a file in a parent directory:
<a href="../file4.htm>
2 levels up:
<a href="../../file5.htm>
To a file in a different folder off the parent folder:
<a href="../newfolder/file6.htm>

Root relative links have their uses, particularly when using links in
JavaScript or Server Side Includes (SSI), where FrontPage cannot manage
the links anyway.


When you start a new page, save it before adding any content. This way,
links will be accepted as you type them, since FrontPage will know where
the page is in the web. An unsaved page is located in the temporary
files, which of course are not in the website.
 
S

Steve D.

Thanks for the tip. By trial and error I finally figured out what the problem
was... a guirk (or bug) in FrontPage 2003 does not allow me type just the
file name in the Address field in the Edit Hyperlink dialog box... and if I
select the file (in the browse list) without first clicking on a different
file, it usually adds the http:\ and refuses to let me get rid of it (beeps
when I try to delete the path)... but if I click away on another file then
back on the file I want then it will display the file name without any path
.... strange and irritating behavior requiring extra clicks but at least I got
it to work. Thanks again for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top