Linking to named anchors on static...

User 2074593 Photo


Registered User
20 posts

The shop is up, it still needs a bit of work like nicer theme, but I would like to be able to link from a word in a product description to a section of text in a static page.

For instance link from the phrase "Camouflage Pattern" to a specific section of the text on a static page describing the fabrics. I know that it would be quite easy to link to the page but the page is quite long so I don't want my user to have to scroll through to the section of interest.

I'm creating the HTML for the static page content using KompoZer and inserting it with the insert HTML function.
Within the limits of the cart software this works most of the time, formatting doesn't work perfectly and I have to manualy edit links to additional images.
If I create a named anchor in the static page HTML (in KonpoZer) then "HTML copy" the code into the cart how do I then refer to that anchor?

An example of the anchor code produced by KompoZer is:-
<a name="Teflon®_Fabric_Protector_by_DuPont®_"></a>Teflon®
Fabric Protector by DuPont®</big>


Regards Alan
User 562592 Photo


Registered User
2,038 posts

I am not sure I am understanding what you are asking correctly. But, from looking at the code you just inserted, the code is incorrect. Three things: first, since you can't insert CSS into the cart, then your Teflon reference will not actually reference anything. Second, your link text is on the other side of the closing tag when it should be in between the two. Third, you have no actual link reference. It should be inserted like this:

<a href="insert static php page location here">Link Text Here</a>

Hope this helps.
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com

User 364143 Photo


Guest
5,410 posts

Like Eric stated, you can insert html into cart pages that you create but you really can't easily modify the code for the products pages that the cart generates.
CoffeeCup... Yeah, they are the best!
User 38401 Photo


Senior Advisor
10,951 posts

I think what he wants is an anchor tag, but I don't know the code for it. He wants the link to not only go to another page (easily done with the linking tool if that were all he needed), but he wants that link to be anchored to a specific spot on the page it is taking his visitors to.

In other words as he says, the page the link will be redirecting to or opening is really long and he doesn't want his visitors to have to scroll down the page and search for the area in question, he wants the page to load right to that spot on the page. Hopefully that made sense?
User 2074593 Photo


Registered User
20 posts

The code

<a name="Teflon®_Fabric_Protector_by_DuPont®_"></a>Teflon®Fabric Protector by DuPont®

is what Kompozer produced when I had it mark "Teflon®_Fabric_Protector_by_DuPont®" as a named anchor.

I would like to link to if from a static page, the code you have shown (<a href="insert static php page location here">Link Text Here</a>) is for an outgoing link. What I want is for the outgoing link to target the named anchor.

At a guess as it's on the same site the code might be something like :-

<a href="/static_pagename/Teflon®_Fabric_Protector_by_DuPont®</a>


Regards Alan

User 38401 Photo


Senior Advisor
10,951 posts

http://www.createafreewebsite.net/html_ … intra.html

http://www.ehow.com/how_4424747_link-an … r-web.html


Those pages might help you do what you're looking for Alan. Let us know if that doesn't cover it.
User 1948478 Photo


Senior Advisor
1,850 posts

If your anchor (on page: static_pagename.pnp) is defined by:

<a name="Teflon®_Fabric_Protector_by_DuPont®_"></a>

Then the link to it will be:

<a href="static_pagename/#Teflon®_Fabric_Protector_by_DuPont®_">

If the link is on the same page as the anchor, it would look like this:

<a href="#Teflon®_Fabric_Protector_by_DuPont®_">

Note that it's the # - symbol that defines a specified location on the page, rather than top of the page.
User 562592 Photo


Registered User
2,038 posts

Per wrote:
If your anchor (on page: static_pagename.pnp) is defined by:

<a name="Teflon®_Fabric_Protector_by_DuPont®_"></a>

Then the link to it will be:

<a href="static_pagename/#Teflon®_Fabric_Protector_by_DuPont®_">

If the link is on the same page as the anchor, it would look like this:

<a href="#Teflon®_Fabric_Protector_by_DuPont®_">

Note that it's the # - symbol that defines a specified location on the page, rather than top of the page.


Good information. I don't think I was aware of this.
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com

User 1948478 Photo


Senior Advisor
1,850 posts

Correction:

I think I forgot the .pnp and I also added a slash that shouldn't be there:

So this is more likely to work:

<a href="static_pagename.pnp#Teflon®_Fabric_Protector_by_DuPont®_">

Sorry about my sloppyness! :/
User 1948478 Photo


Senior Advisor
1,850 posts

It also occurred to me that I have never used those special symbols, like the one for 'Registered Trademark', in an anchor name. Maybe it works, but maybe not. If there's a problem, that may the first thing to remove as a debugger!

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.