If this is your first visit, check our documentation. To post, register or login.
Forums / Templates, Stylesheets, Page Layout / how do I insert a link without the ampersand in the address?

how do I insert a link without the ampersand in the address?

Locked

Started by aussiesapphire on 30 Oct 2009, 2:26 AM · Views: 2,484

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
30 Oct 2009, 2:26 AM
#1
aussiesapphire avatar

aussiesapphire

Zen Follower

Join Date:
Apr 2006
Posts:
114
Plugin Contributions:
0

how do I insert a link without the ampersand in the address?

I have a question - very newbie so obviously not understanding the issue completely.

I have a lot of added links in my other website where for example, in one category or product, I will link to another which is related by inserting link in the html editor - BUT I am finding this throws up a lot of errors when I validate the site.

for example:

Line 165, Column 46: cannot generate system identifier for general entity "cPath"
href="/index.php?main_page=index&cPath=3_4"

An entity reference was found in the document, but there is no reference by that name defined. Often this is caused by misspelling the reference name, unencoded ampersands, or by leaving off the trailing semicolon (;). The most common cause of this error is unencoded ampersands in URLs as described by the WDG in "Ampersands in URLs".

Entity references start with an ampersand (&) and end with a semicolon (;). If you want to use a literal ampersand in your document you must encode it as "&" (even inside URLs!). Be careful to end entity references with a semicolon or your entity reference may get interpreted in connection with the following text. Also keep in mind that named entity references are case-sensitive; &Aelig; and æ are different characters.

If this error appears in some markup generated by PHP's session handling code, this article has explanations and solutions to your problem.

Note that in most documents, errors related to entity references will trigger up to 5 separate messages from the Validator. Usually these will all disappear when the original problem is fixed.

In my new site, I am trying to keep it clean and correct (just 1 error so far - yay) so how do I insert a link without the ampersand in the address causing these errors.

cheers
Leah

30 Oct 2009, 6:02 PM
#2
peytonrm avatar

peytonrm

New Zenner

Join Date:
Jun 2008
Location:
Morrisville, NC
Posts:
47
Plugin Contributions:
0

Re: how do I insert a link without the ampersand in the address?

You use '&' instead of the ampersand to fix that validation error. So for example instead of
"/index.php?main_page=index&cPath=3_4"
you would use "/index.php?main_page=index&cPath=3_4"

I recommend installing the SEO urls add on. It will eliminate most (maybe even all) of those ampersands from your URLs, so you won't even have to worry with this problem and it has the possible benefit of potentially giving you better search engine rankings.

"Whether you think you can or think you can't, you're right" - Henry Ford

30 Oct 2009, 6:46 PM
#3
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: how do I insert a link without the ampersand in the address?

Zen Cart builds the links on the fly based on what the customer requested, so it shouldn't be an issue.

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

3 Jan 2010, 9:20 PM
#4
stride_r avatar

stride_r

Zen Follower

Join Date:
Aug 2008
Posts:
115
Plugin Contributions:
0

Re: how do I insert a link without the ampersand in the address?

afo:

Zen Cart builds the links on the fly based on what the customer requested, so it shouldn't be an issue.

This is incorrect ...or at least it is a misleading reply.
Yes, zen carts builds internal links on the fly and does so correctly ....but this user's question was about inserting copy/pasted links into a product's description via the admin's HTML editor. Indeed, if copy/pasted urls are inserted via the WYSIWYG editor, then unencoded ampersands are passed into the database and end up in the output html. They look and perform okay via most browsers but do not validate as they are unencoded.

The sad part is - even if one cuts/pastes a validly encoded ampersand url via the PLAIN TEXT editor, it will get saved into the database correctly ....but once that product is re-edited in the future, any properly encoded links are lost again as the editor does not load and re-save the encoded ampersands.

Thus there's no way user-friendly way to enter and save validly encoded urls into a description via the current zen cart (1.3.8a)admin. ....the closest one can get is to use the plain text editor ONLY (not very friendly for most users) and even there, one must remember to re-edit any links in the description when editing a product in the future.