Jump to content

xhtml validation


Guest smallmouse

Recommended Posts

Guest smallmouse

Hi

I am finishing a site for a client and am trying to validate all my pages. I have got them all validating except for two pages:

Product page

view products page

I would be so grateful if anyone can help me with this, im desperate and have searched everywhere to try and get the answers.

There are only 6 errors in one and 1 error in the other, so i'm pretty close now.

Please help if you can?

Thanks

Lisa

Link to comment
Share on other sites

Guest offthehook

On the view products page some urls have an ampersand in them. You need to go into your tpl file and make sure that ampersands are coded thusly:

If you want to use a literal ampersand in your document you must encode it as "&" (even inside URLs!).

I took that from the w3.org validator. If you're not using that to validate your pages then you should give it a try. They will give all the necessary information to help fix your errors.

I think on the product page the six errors are because of the javascript for the dynamic prices mod. You appear to have a reference to an external js file and then immediately after that a javascript function. I'm not familiar with the mod but perhaps the second bit shouldn't be in the page as it is probably in the external file. If it is supposed to be there then you probably need to check the code in the script to make sure its not missing anything like brackets, semi-colons etc.

Link to comment
Share on other sites

Guest smallmouse

On the view products page some urls have an ampersand in them. You need to go into your tpl file and make sure that ampersands are coded thusly:

If you want to use a literal ampersand in your document you must encode it as "&" (even inside URLs!).

I took that from the w3.org validator. If you're not using that to validate your pages then you should give it a try. They will give all the necessary information to help fix your errors.

I think on the product page the six errors are because of the javascript for the dynamic prices mod. You appear to have a reference to an external js file and then immediately after that a javascript function. I'm not familiar with the mod but perhaps the second bit shouldn't be in the page as it is probably in the external file. If it is supposed to be there then you probably need to check the code in the script to make sure its not missing anything like brackets, semi-colons etc.

Hi Thanks for your reply - much appreciated - but I am not sure which tpl file I should be looking for the links in? is it viewprod.tpl?

Thanks again.

Link to comment
Share on other sites

Guest hardnut33

sorry if this is a silly question...i have used the w3.org validator and it has thrown up some errors..

how do i know what page the errors are in, it might be a dumb question but its the first time i have seen the validator thing...

Great site by the way smallmouse

Link to comment
Share on other sites

Guest offthehook

Okay, this is not an error of your making, it is an error (or is it?) within CC. My site was doing the same, and I have tracked the code down.

I am not going to vouch for the safety of doing the following on your store.

Perhaps one of the more experienced coders could come forward to confirm if this code change is okay. All I can say is that I have changed it on my store and it now works, and I have tested a number of links and so far things appear to be working as they should.

Righto

You will need to open the file "db.inc.php" which can be found in your "classes" folder.

Search for this code (around line 120):

	// develop query string minus page vars

	$queryString = "";

		if (!empty($_SERVER['QUERY_STRING'])) {

			$params = explode("&", $_SERVER['QUERY_STRING']);

			$newParams = array();

				foreach ($params as $param) {

					if (stristr($param, $pageVar) == false) {

						array_push($newParams, $param);

					}

				}

			if (count($newParams) != 0) {

				$queryString = "&" . htmlentities(implode("&", $newParams));

			}

		}

Look where there are three ampersands in quotation marks. The second after '$querystring =' is the one you want.

Simply change the "&" to "&", save, upload and voila!

Link to comment
Share on other sites

Guest offthehook

sorry if this is a silly question...i have used the w3.org validator and it has thrown up some errors..

how do i know what page the errors are in, it might be a dumb question but its the first time i have seen the validator thing...

The validator validates one page only. So if you type your url in as "www.mywebsite.com" then the validator checks the home page only.

For a Cubecart site you should individually check the category, product, search results pages as well as a site doc page. You may wish to do a cart page too.

Just copy and paste the url of the page you want to check.

You should also be testing your site for accessibility as well at http://www.contentquality.com/. A section 508 test is usually good enough, but if you're brave try the full Priority 1, 2 and 3 test. If you pass all three then pat yourself on the back!

Link to comment
Share on other sites

Guest hardnut33

thanks for the reply....all was well until an hour ago and now my sites down with some kinda error...

when its up and running again i'll give the validator a proper go...

Thanks

Link to comment
Share on other sites

Guest smallmouse

Hi Offthehook

Thanks so much for that tip, I have now validated the view product page, so I just have those six errors to do now and then the site validates!

Thanks!

Link to comment
Share on other sites

  • 4 months later...
Guest dutchjohn

Hi

I am finishing a site for a client and am trying to validate all my pages. I have got them all validating except for two pages:

Product page

view products page

I would be so grateful if anyone can help me with this, im desperate and have searched everywhere to try and get the answers.

There are only 6 errors in one and 1 error in the other, so i'm pretty close now.

Please help if you can?

Thanks

Lisa

Looking at your site Lisa, it looks like you still need an answer. This post should take care of most of your validation errors.

;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...