X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   4.4.4 Site Won't Validate (https://forum.x-cart.com/showthread.php?t=61705)

JWait 11-19-2011 08:47 AM

4.4.4 Site Won't Validate
 
Using http://validator.w3.org to validate our site and get the following error...

Line 3234, Column 127: document type does not allow element "link" here

http://www.<MYDOMAIN.com/var/cache/_563a0f615810726ac1aabd5fd6575619.css" />


The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error)
---------------------------------------

Line 3234 come just before the closing /body tag.
Line 3233 is "<script type="text/javascript" src="http://www.MYDOMAIN.com/var/cache/_095eb7bcf85d388ba7d7dc34fd64401a.js"></script>"

My question is where are these links normally called? They appear to be part of the "speed-up tool for Javascript" and "speed-up tool for CSS".

elmirage001 11-19-2011 09:18 AM

Re: 4.4.4 Site Won't Validate
 
Quote:

Originally Posted by JWait
Using http://validator.w3.org to validate our site and get the following error...

Line 3234, Column 127: document type does not allow element "link" here

http://www.<MYDOMAIN.com/var/cache/_563a0f615810726ac1aabd5fd6575619.css" />


The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error)
---------------------------------------

Line 3234 come just before the closing /body tag.
Line 3233 is "<script type="text/javascript" src="http://www.MYDOMAIN.com/var/cache/_095eb7bcf85d388ba7d7dc34fd64401a.js"></script>"

My question is where are these links normally called? They appear to be part of the "speed-up tool for Javascript" and "speed-up tool for CSS".

Try un-checking the speed-up tool and then do cleanup.php. Then validate without the speed-up tool on.

JWait 11-19-2011 11:00 AM

Re: 4.4.4 Site Won't Validate
 
It will validate as long as "Use speed-up tool for CSS" is unchecked, but I still need to know where this is called from, what template?

elmirage001 11-19-2011 11:35 AM

Re: 4.4.4 Site Won't Validate
 
Thanks for testing and doing the trailblazing... I still have lots of work to do before I'm where you're at. I'm waiting for Phil's new Ability template :-)

elmirage001 11-19-2011 08:21 PM

Re: 4.4.4 Site Won't Validate
 
/skin/common_files/customer/service_css.tpl

http://help.qtmsoft.com/index.php?title=X-Cart:CSS_and_JavaScript_optimization

Hope this helps...

Paul

JWait 11-20-2011 06:06 AM

Re: 4.4.4 Site Won't Validate
 
I did some checking and found that if I disable the "socialize" module it validates. So it looks like it is another new addon that isn't working correctly. Oh well, at least it isn't something important.

elmirage001 11-20-2011 06:22 AM

Re: 4.4.4 Site Won't Validate
 
Quote:

Originally Posted by JWait
I did some checking and found that if I disable the "socialize" module it validates. So it looks like it is another new addon that isn't working correctly. Oh well, at least it isn't something important.

I just unchecked socialize and the css validation error went away also. Thank you!

JWait 11-21-2011 06:21 AM

Re: 4.4.4 Site Won't Validate
 
Reported issue to bugtracker..

https://bugtracker.qtmsoft.com/view.php?id=40613

cflsystems 11-21-2011 10:17 AM

Re: 4.4.4 Site Won't Validate
 
Quote:

Originally Posted by JWait
Using http://validator.w3.org to validate our site and get the following error...

Line 3234, Column 127: document type does not allow element "link" here

http://www.<MYDOMAIN.com/var/cache/_563a0f615810726ac1aabd5fd6575619.css" />


The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error)
---------------------------------------

Line 3234 come just before the closing /body tag.
Line 3233 is "<script type="text/javascript" src="http://www.MYDOMAIN.com/var/cache/_095eb7bcf85d388ba7d7dc34fd64401a.js"></script>"

My question is where are these links normally called? They appear to be part of the "speed-up tool for Javascript" and "speed-up tool for CSS".


Look in home.tpl - just before </body>. It calles load_defer_code and loads the css and js cached files. Same code is also loaded from service_head.tpl. I would assume the one in home.tpl is there just in case anything is loaded inline in other templates (for different modules) and not in <head>. Technically this code should not be there yes and moving it to head section will validate the page even with speedup tools enabled.

JWait 11-21-2011 12:28 PM

Re: 4.4.4 Site Won't Validate
 
Quote:

Originally Posted by cflsystems
Look in home.tpl - just before </body>. It calles load_defer_code and loads the css and js cached files. Same code is also loaded from service_head.tpl. I would assume the one in home.tpl is there just in case anything is loaded inline in other templates (for different modules) and not in <head>. Technically this code should not be there yes and moving it to head section will validate the page even with speedup tools enabled.


I moved both {load_defer_code type="css"} and {load_defer_code type="js"} from just before the "{if $active_modules.Wibiya}..."
to just after {include file="customer/service_head.tpl"}.

I then enabled the Socialize module, ran cleanup.php and the site validated.

Thanks.

Edit: I just noticed that by moving the load_defer_code that it removes the formatting on the product detail page for "Customers also bought", "Send to a Friend", etc. so it looks like it isn't really a fix. :(

JWait 11-21-2011 12:48 PM

Re: 4.4.4 Site Won't Validate
 
How many of these "load_defer_codes" do we need anyway?

Besides the {load_defer_code type="js"} and {load_defer_code type="css"} in home.tpl they are also in the service_head.tpl as well.

cflsystems 11-21-2011 02:26 PM

Re: 4.4.4 Site Won't Validate
 
Like I said some of the css and js files are loaded if you go to certain page or if certain modules are enabled so they are not loaded in head section but in the body so I think this code is there at the end for cases like this

elmirage001 11-21-2011 06:24 PM

Re: 4.4.4 Site Won't Validate
 
I have modified my Socialize Module to use ShareThis so my visitors have access to over 100 services besides Facebook, Twitter, and Google +1.

With my modification the homepage validates fine with the Socialize module turned on because I've commented out sections and added the ShareThis code as shown below.

Quote:

{*
$Id: service_head.tpl,v 1.1.2.3 2011/09/19 12:08:28 aim Exp $
vim: set ts=2 sw=2 sts=2 et:
*}

{if ($active_modules.Socialize and ($main eq 'product' or $main eq 'catalog')) and (!$ie_ver or $ie_ver gt 6)}

{if $main eq "product" and !$active_modules.Facebook_Tab}
{assign var="prod_descr" value=$product.descr|default:$product.fulldescr}
<meta property="og:title" content="{$product.product|escape}"/>
<meta property="og:description" content="{$prod_descr|truncate:'500':'...':false|e scape|addslashes}" />
<meta property="og:type" content="product"/>
<meta property="og:url" content="{$current_location}/{$canonical_url}" />
<meta property="og:image" content="{if $product.tmbn_url && !$product.default_image}{$product.tmbn_url}{else}{ $current_location}{if $product.default_image}/{$product.default_image|replace:'./':''}{else}/image.php?type={$type|default:'T'}&id={$product.pr oductid}{/if}{/if}" />
<meta property="og:site_name" content="{$lng.lbl_site_name|default:$config.Compa ny.company_name|amp}" />
<meta property="og:street-address" content="{$config.Company.location_address}" />
<meta property="og:locality" content="{$config.Company.location_city}" />
<meta property="og:region" content="{$config.Company.location_state}" />
<meta property="og:postal-code" content="{$config.Company.location_zipcode}" />
<meta property="og:country-name" content="{$config.Company.location_country}" />
{if $config.Socialize.soc_fb_user_id ne ''}
<meta property="fb:admins" content="{$config.Socialize.soc_fb_user_id}" />
{/if}
{/if}

{*
{load_defer file="modules/Socialize/main.css" type="css"}
*}

{*
{if $config.Socialize.soc_ggl_plus_enabled eq "Y"}
<script type="text/javascript" src="{$current_protocol}://apis.google.com/js/plusone.js">
{ldelim}lang: '{$store_language}'{rdelim}
</script>
{/if}
*}

{if $config.Socialize.soc_fb_like_enabled eq "Y" or $config.Socialize.soc_fb_send_enabled eq "Y"}
<script type="text/javascript" src="{$current_protocol}://connect.facebook.net/{$store_language|@func_get_facebook_lang_code}/all.js#xfbml=1"></script>
{/if}

{*
{if $config.Socialize.soc_tw_enabled eq "Y"}
<script type="text/javascript" src="{$current_protocol}://platform.twitter.com/widgets.js"></script>
{/if}
*}

{literal}
<script type="text/javascript">var switchTo5x=false;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({publisher:'***your-number-here***'});</script>
{/literal}


{/if}

I am getting validation errors on the product page related to using the FaceBook Comments part of the Socialize Module and ShareThis. I'll work on Line 97 but I'll live with Line 90 and Line 465.

Line 90, Column 26: there is no attribute "property"
<meta property="og:title" content="xxxxxxxxxxxxxxxxxxxxx...

Line 97, Column 96: general entity "id" not defined and no default entity
Line 97, Column 98: reference to entity "id" for which no system identifier could be generated
┘" content="http://www.mysite-444/image.php?type=T&id=16880" />

Line 465, Column 52: there is no attribute "displayText"
<span class='st_facebook_hcount' displayText='Facebook'></span>


When I finish the mod the way I want my products will list automatically on Twitter and my Facebook Wall. My FB Wall will show thumbnails of the products as well because of the FB code that the x-cart Socialize Module contains.

Access to the other services opens when you hover over the ShareThis icon as shown in the attachment.

Let me know if this is of interest to you and I'll provide more details.

Thanks!

Paul

JWait 11-22-2011 05:38 AM

Re: 4.4.4 Site Won't Validate
 
Looks interesting. LMK how it turns out.

elmirage001 11-22-2011 06:34 AM

Re: 4.4.4 Site Won't Validate
 
Quote:

Originally Posted by JWait
Looks interesting. LMK how it turns out.

I'll PM the URLs to you when done. May take a couple of weeks or so with x-mas orders and waiting for Phil's new Ability template.

steewu 12-30-2011 01:08 PM

Re: 4.4.4 Site Won't Validate
 
Don't go crazy...


Make sure .htaccess change the following line:

From:

RedirectMatch permanent ^.*/var/.*$ http://www.yourdomian.com/x-cart-path/error_message.php

to:

<FilesMatch !"\.(css|js)$">
RedirectMatch permanent ^.*/var/.*$ http://www.yourdomain.com/x-cart-path/error_message.php
</FilesMatch>

Good Luck... It works for me...


All times are GMT -8. The time now is 03:09 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.