product page: a lot of error's from w3c validator

  • Posts: 222
  • Thank you received: 1
10 years 7 months ago #189973

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6

Part of the message is hidden for the guests. Please log in or register to see it.


My product pages have a lot of error's (w3c validator).

"Bad value" very much. Here some of them:

Line 854, column 204: Bad value {handler:'image'} for attribute rel on element a: The string {handler:'image'} is not a registered keyword.
</div>
Line 859, column 463: Bad value {handler:'image'} for attribute rel on element a: The string {handler:'image'} is not a registered keyword.
window.localPage.images = {};
Line 859, column 1123: Bad value {handler:'image'} for attribute rel on element a: The string {handler:'image'} is not a registered keyword.
window.localPage.images = {};
Line 859, column 1814: Bad value {handler:'image'} for attribute rel on element a: The string {handler:'image'} is not a registered keyword.
window.localPage.images = {};

And other kind. Here also some of them:

Line 1293, column 468: Duplicate ID hikashop_first_thumbnail.
window.localPage.images = {};
Line 859, column 463: The first occurrence of ID hikashop_first_thumbnail was here.
window.localPage.images = {};
Line 1362, column 468: Duplicate ID hikashop_first_thumbnail.
window.localPage.images = {};
Line 859, column 463: The first occurrence of ID hikashop_first_thumbnail was here.
window.localPage.images = {};
Line 1431, column 469: Duplicate ID hikashop_first_thumbnail.
window.localPage.images = {};
Line 859, column 463: The first occurrence of ID hikashop_first_thumbnail was here.
window.localPage.images = {};

How can I fix that? Please help me. What I did myself on my site I can fix it, but what is from Hikashop code, I am afraid to change something.

Regards,
Vero

Last edit: 10 years 7 months ago by Vero.

Please Log in or Create an account to join the conversation.

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
10 years 7 months ago #189989

Hi,

1. The handler {handler:'image'}, while not valid strictly speaking in HTML is a normal way of adding parameters to links and that's the method the Joomla popup library uses. It's not a real error. I would recommend to discard it.
But if that really bothers you, try to change the "image popup mode" option of the HikaShop configuration in order to use not use Joomla popups for the images popup and that should avoid the validator displaying that problem.

2. For the duplicate id on hikashop_first_thumbnail, that's real error which should not happen (it actually only happens when you have characteristics added to a product and that each variant has several images).
In order to fix it, change the line:
$id = 'hikashop_first_thumbnail';
to:
$id = 'hikashop_first_thumbnail'.$variant_name;
and the line:
window.localPage.images[id] = document.getElementById('hikashop_first_thumbnail');
to:
window.localPage.images[id] = document.getElementById('hikashop_first_thumbnail<?php echo $variant_name;?>');
in the file show_block_img for your frontend template via the menu Display>Views and that will fix the problem.
We'll add that patch in the next version of HikaShop.

Please Log in or Create an account to join the conversation.

  • Posts: 222
  • Thank you received: 1
10 years 7 months ago #190051

Many Thanks,

I have fixed duplicate id, but all "bad values" are still showing. In "image popup mode" option of the HikaShop configuration I see no option in order to use not use Joomla popups for the images popup. I see: mootools, shadowbox (external) en shadowbox (embedded). Now is an option mootools. If I chose other option I have more error's in w3c validator.

I would recommend to discard it.


I am not goed in English and always translate with google translate. "to discard it" translated as remove it. Is that right? How can I do that?

Regards, Vero

Please Log in or Create an account to join the conversation.

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
10 years 7 months ago #190059

Hi,

I meant that you should ignore that error as it is not a real error.

If you really want a page without the w3c error, it's possible but then you won't get popups on the images.
You can do that by changing the line:

$html = '<a '.$attr.$onClick.$id.' href="'.$url.'" rel="{handler:\'image\'}" target="_blank">'.$content.'</a>';
to:
$html = '<a '.$attr.$id.' href="'.$url.'" target="_blank">'.$content.'</a>';
in the file administrator/components/com_hikashop/helpers/image.php

Please Log in or Create an account to join the conversation.

Time to create page: 0.053 seconds
Powered by Kunena Forum