close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Power Gallery and W3C Validation

Thread began 3/30/2011 11:08 am by alistair316863 | Last modified 4/07/2011 1:56 pm by Jason Byrnes | 2751 views | 9 replies |

alistair316863

Power Gallery and W3C Validation

Hi I have numerous galleries on a website I have created and the only thing which is stopping the page/s from passing validation is the gallery I get this error:

Bad value <strong></strong> for attribute name on element a: An ID must not contain whitespace.

Is there anything I can do to fix this? Also you get this warning:

The name attribute is obsolete. Consider putting an id attribute on the nearest container instead.

If I remove the gallery then it passes so this is quite annoying thanks in advance Alistair

Sign in to reply to this post

Jason ByrnesWebAssist

The image title that you enter in the gallery is used inside the strong tag.

to prevent this issue with the validation, make sure to add an image title in the gallery admin.


The name attribute is used by the lightbox components to display the image title and description and cannot be replaced.

Sign in to reply to this post

alistair316863

Originally Said By: Jason Byrnes
  The image title that you enter in the gallery is used inside the strong tag.

to prevent this issue with the validation, make sure to add an image title in the gallery admin.


The name attribute is used by the lightbox components to display the image title and description and cannot be replaced.  



That dosent do anything see below:
Bad value <strong>Large Patio Canopy:</strong> for attribute name on element a: An ID must not contain whitespace.

…<strong>Large Patio Canopy:</strong> "><img alt="" title="0##Large Patio Canop…

and it is not the spacing between the wording as i have galleries that have no spacing and are a single word any other ideas cheers Alistair

Sign in to reply to this post

Jason ByrnesWebAssist

please post a link to the page you are experiencing this on.

Sign in to reply to this post

alistair316863

Hi Jason here is one of the pages:

index.php

Sign in to reply to this post

Jason ByrnesWebAssist

in the /gallery/galleries/ribbon_lightbox/index.php file, change line 60:

php:
echo '<a href="' . $gallery['images'][$i]['fullsize']['url'] . '" rel="lightbox-pg' . $random . '" name="<strong>' . str_replace('"', '\"', $gallery['images'][$i]['title']) . (strlen($gallery['images'][$i]['title']) > 0 ? ':' : '') . '</strong> ' . str_replace('"', '\"', $gallery['images'][$i]['description']) . '"><img alt="" title="' . $i . '##' . str_replace('"', '\"', $gallery['images'][$i]['title']) . '##' . str_replace('"', '\"', $gallery['images'][$i]['description']) . '"  src="' . $gallery['images'][$i]['thumb']['url'] . '" width="62" height="62" /></a>';




to:

php:
echo '<a href="' . $gallery['images'][$i]['fullsize']['url'] . '" rel="lightbox-pg' . $random . '" name="' . str_replace('"', '\"', $gallery['images'][$i]['title']) . (strlen($gallery['images'][$i]['title']) > 0 ? ':' : '') . '' . str_replace('"', '\"', $gallery['images'][$i]['description']) . '"><img alt="" title="' . $i . '##' . str_replace('"', '\"', $gallery['images'][$i]['title']) . '##' . str_replace('"', '\"', $gallery['images'][$i]['description']) . '"  src="' . $gallery['images'][$i]['thumb']['url'] . '" width="62" height="62" /></a>';
Sign in to reply to this post

alistair316863

Thanks Jason that's the strong bit fixed although it now change to a different one see below, as you can probably see I have changed name to id which was another error:

Line 211, Column 132: Bad value Large Patio Canopy: for attribute id on element a: An ID must not contain whitespace.

&#8230;m/gallery/images/1/001_782p.jpg" rel="lightbox-pg419" id="Large Patio Canopy:">

Syntax of id:
An ID consists of at least one character but must not contain any whitespace.


Just a quick note if I take this out of the index file:

id="' . str_replace('"', '\"', $gallery['images'][$i]['title']) . (strlen($gallery['images'][$i]['title']) > 0 ? ':':'') . '' . str_replace('"', '\"', $gallery['images'][$i]['description']) .'"

It validates OK also is there a way to make the image title the alt tag as well

Sign in to reply to this post

Jason ByrnesWebAssist

change:
alt=""

to:
alt="' . str_replace('"', '\"', $gallery['images'][$i]['title']) .'"

Sign in to reply to this post

alistair316863

Thanks Jason this now validates and has the alt tag as requested see below:

echo '<a href="' . $gallery['images'][$i]['fullsize']['url'] . '" rel="lightbox-pg' . $random . '" >
<img alt="' . str_replace('"', '\"', $gallery['images'][$i]['title']) .'" title="' . $i . '##' . str_replace('"', '\"', $gallery['images'][$i]['title']) . '##' . str_replace('"', '\"', $gallery['images'][$i]['description']) . '" src="' . $gallery['images'][$i]['thumb']['url'] . '" width="62" height="62" /></a>';

Although I do get this as a warning:

Line 222, Column 111: Bad value 001_782p.jpg for attribute href on element a: Path component contains a segment /../ not at the beginning of a relative reference, or it contains a /./. These should be removed.

&#8230;p://www.canopiesuk.com/../gallery/images/1/001_782p.jpg" rel="lightbox-pg785" >

Sign in to reply to this post

Jason ByrnesWebAssist

That is caused by the way we are determining paths to the images and wont be able to be "fixed" without breaking the ability to have the gallery on multiple pages in the site.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...