...

View Full Version : Linking page to another page in same website



bIT
02-12-2009, 05:34 PM
I didn't create our website so I am not familiar with how they did it. It was all hand-coded (even though I really wanted it done in Dreamweaver but I am just a worker bee)
Okay, here is my problem. There is a story on one page (EVENTS) of the site and on another page(GIVE-MONEY) in the same website, refers to the other page. I have used the following code but its not working. Can anyone offer some suggestions? Thanks so much!

This was the code I inserted in the EVENTS page:

<a name="A GREAT CHANCE FOR A MATCH GIFT"></a>


This was the code I inserted into the GIVE-MONEY page:

<a href="http://www.midohiofoodbank.org/news-events/events/#A GREAT CHANCE FOR A MATCH GIFT">click here for more information.</a>


When you click on the link on the GIVE-MONEY page to refer you to the EVENTS page, you just get “page not found error.”

Excavator
02-12-2009, 05:52 PM
Hello bIT,
Say your Give Money page is named donations.html your link would read
<a href="http://www.midohiofoodbank.org/news-events/events/donations.html">click here for more information.</a>

That's assuming the path to donations.html is correct, you may need to change that.

BoldUlysses
02-12-2009, 06:15 PM
If I understand correctly, you're trying to make a link that will jump from one page to an anchor tag somewhere in the middle of another page.

If so, this is code you could use to create the anchor on the EVENTS page:


<a id="great_chance"></a>

I would use "id" instead of "name," and note that spaces are not allowed in the value (http://www.w3schools.com/tags/att_standard_id.asp). Modify the id however you like, just keep the rules in mind as per the link.

On your GIVE-MONEY page, put:


<a href="http://www.midohiofoodbank.org/news-events/events/#great_chance">click here for more information.</a>

marilynn.fowler
02-12-2009, 06:27 PM
I'm curious to know what you perceive the difference to be between hand-coding a site and creating it in Dreamweaver.

Pepe, the bull
02-12-2009, 07:32 PM
If I understand correctly, you're trying to make a link that will jump from one page to an anchor tag somewhere in the middle of another page.

If so, this is code you could use to create the anchor on the EVENTS page:


<a id="great_chance"></a>

I would use "id" instead of "name," and note that spaces are not allowed in the value (http://www.w3schools.com/tags/att_standard_id.asp). Modify the id however you like, just keep the rules in mind as per the link.

On your GIVE-MONEY page, put:


<a href="http://www.midohiofoodbank.org/news-events/events/#great_chance">click here for more information.</a>

Wouldn't he need the name of the file before the anchor's name? Something like...


<a href="http://www.midohiofoodbank.org/news-events/events/donations.html#great_chance">click here for more information.</a>

BoldUlysses
02-12-2009, 07:34 PM
Wouldn't he need the name of the file before the anchor's name? Something like...


<a href="http://www.midohiofoodbank.org/news-events/events/donations.html#great_chance">click here for more information.</a>

Good catch. That he/she would.

bazz
02-12-2009, 07:58 PM
hrefs should be absolute to within your site. so,



<a href='http://www.example.com/directory/sub-direcotry/page.html'>link</a>


is better written as



<a href='/directory/sub-directory/page.html'>link</a>


If you move the page to within another directory, the links will still work. indeed, in the case where you may build several sites, the page can become interchangeable from one to another because it doesn't use the absolute path of http://www.....

bazz



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum