There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Relative and Absolute Addressing


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
cyberwood2004's Avatar
Computer Specs
Junior Member with 7 posts.
 
Join Date: Jan 2007
Experience: Intermediate
24-Mar-2008, 03:17 PM #1
Relative and Absolute Addressing
I'm something of a n00b, so please be gentle. I'm designing a site in Dreamweaver CS3 (free trial), under Win XP. I've made my basic template page on which all pages in the site will be based. The left column is a navigation bar with buttons to "About", "Articles", etc. pages. The links in the navbar are relative. My trouble: I've built a file hierarchy of product classes and products so that pages for Cleaners are in their own directory, pages for Groceries in another, etc. When I'm on a page that lives in /cleaners/handsoap/, clicking the Groceries button on the navbar doesn't go to the root folder for groceries.html, but to /cleaners/handsoap/groceries.html. The only alternative I see is to make the navbar links absolute, fully qualifying the URLs. I can't use /.../ because my directory structure varies. Any thoughts, anyone? Additional note: I'm resisting absolute addresses because I haven't loaded the site to my ISP yet, and I'm testing it on my laptop. So I see absolute addressing as, "I can't demonstrate the site from my PC yet." I guess my real question is, "Can I force a relative link to the root in some way similar to the way /.../.../ links work?"

Thanks, y'all

Edited for "clarity"
tomdkat's Avatar
Computer Specs
Distinguished Member with 3,519 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
24-Mar-2008, 03:25 PM #2
Maybe the base tag would be appropriate for you? You would set "base" in each page. I'm not sure if that would work without having a web server.

Alternatively, you could install a web server on your local computer for testing purposes. I run Apache at home for this purpose.

Here's another idea: have the navigation bar separate from content that will be displayed, like in an iframe or ilayer. The navigation menu would be in a DIV that would remain present and as people clicked the navigation links, the desired page would be loaded in an iframe or ilayer that would be in the body of the page. Understand?

Peace...
Fyzbo's Avatar
Senior Member with 1,767 posts.
 
Join Date: Feb 2002
Location: North Carolina, USA
Experience: Programming-Advanced|EVER
24-Mar-2008, 03:26 PM #3
You can reference the root of the website with a beginning /.

<a href="/groceries.html">Groceries</a>
tomdkat's Avatar
Computer Specs
Distinguished Member with 3,519 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
24-Mar-2008, 03:27 PM #4
He's saying that causes problems for him when testing on his local machine (not using a web server).

Peace...
cyberwood2004's Avatar
Computer Specs
Junior Member with 7 posts.
 
Join Date: Jan 2007
Experience: Intermediate
24-Mar-2008, 03:30 PM #5
Thanks, folks. Fyzbo, that sounds like what I want, and I'll try it first. Tomdkat, your suggestion is my plan b.

Thanks again.
Fyzbo's Avatar
Senior Member with 1,767 posts.
 
Join Date: Feb 2002
Location: North Carolina, USA
Experience: Programming-Advanced|EVER
24-Mar-2008, 03:34 PM #6
yea if you are just opening files in your web browser the / will reference the root of your drive, so tomdkat is right, none of the links will work.

I like tomdkat's suggestions of setting up a local server to test your website. Apache is free. Also some versions of windows come with a limited version of IIS built in.
Sequal7's Avatar
Computer Specs
Distinguished Member with 2,369 posts.
 
Join Date: Apr 2001
Location: Around the corner!
Experience: Including today?
24-Mar-2008, 03:40 PM #7
Yes you can.

In your document root folder use any page with the nav bar on it as your template for the products.

Edit the page's content for the new page your creating (for example "irish spring" belonging in the cleaners/handsoap directory)
When your done editing the product's page, click file > save as > then choose the folder /cleaners/handsoap/ and type in the filename (example of irishspring.htm) and click save.
You will be prompted to "update links?", choose yes. Your page will now be in the cleaners/handsoap/ folder and the nav bar will have relative links back to the root folder.
Do this for each page you create and want the root files to link back. (if your product is supposed to link back to the fodler category in the dropdown nav bar, then you need to perform this first with the category file page, then create the product page off that one.)
__________________
Good Luck on your fix

My real hobby..JoyCo
My real Job..(Second Hobby) IAFF Local 1865
Like the sites? My hobby is the one that created them!
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 11:52 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.