Imageblock: XML Parsing Error [SOLVED]

geddeth
geddeth's picture

Joined: 2004-05-16
Posts: 52
Posted: Sun, 2007-09-30 15:04

When I use the g2_sidebarimageblock()-function in my WP sidebar template, I get faulty (X)HTML output. The W3C Validator says "XML Parsing Error: attributes construct error".

I get HTML similar to this:

<div class="wpg2sidebarblock-image">
<table class="ImageFrame_shadow" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="LLT">
</td>
<td rowspan="2" colspan="2" class="IMG">
<a href="http://example.com/wpg2" title="Gallery">
<img src="http://example.com/gallery/d/31-2/.jpg" width="150" height="150" id="IFid1" class="ImageFrame_image" alt="Gallery" longdesc="This is the main page of your Gallery"/>
</a> 
</td>
<td class="RRT">
</td>
</tr>
<tr>
<td class="LL"style="height:140px">
<div class="V">&nbsp;
</div>
</td>

Note the missing spaces after class="LL". This happens for all class-attributes followed by a width-attribute in the outputted HTML. I can see the function in g2embed.inc, but cannot figure out where this HTML is generated. What should I do?

I'm using Wordpress 2.3 from SVN, Gallery 2 from the /branches/BRANCH_2_2-branch. I'm using WPG2 RC Final and the WordpressEmbedded theme from here.

Thanks!

 
ozgreg
ozgreg's picture

Joined: 2003-10-18
Posts: 1378
Posted: Sun, 2007-09-30 22:35

Hmm I wonder if it is something in your Gallery2 ImageFrames that is throwing out the XHTML, as I know WPG2 3.0 is XHTML valid output (you are welcome to check my testbed (http://www.blogyourphotos.com/) which is XHTML Valid)

I could be a bug in the frame, what kind of Imageframe are you using??

____________________________________
Wordpress / Gallery2 (WPG2) Author

 
geddeth
geddeth's picture

Joined: 2004-05-16
Posts: 52
Posted: Mon, 2007-10-01 15:34

It does indeed seem to be an Imageframe problem. If I go to the WPG2 > Sidebar Block tab and select Sidebar Item Frame: None, the HTML is not generated and I do not get that error.

And the same HTML error is created in G2 itself, so this is a Gallery problem (probably only in SVN, I'll investigate that). Thanks for putting me on the right track!

G.

 
linickx
linickx's picture

Joined: 2005-11-07
Posts: 5
Posted: Mon, 2007-11-05 17:35

Hi Geddeth,
How did you resolve this? I've got the same problem, but I'm struggling to find the right code/module to change.
Many Thanks :)

 
capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Mon, 2007-11-05 20:37
linickx wrote:
Hi Geddeth,
How did you resolve this? I've got the same problem, but I'm struggling to find the right code/module to change.
Many Thanks :)

There's an error in gallery2/modules/imageframe/templates/containers/ImageFrame.tpl

You need to add spaces between the class declaration and the if statement on the following lines so that they look like this:

29    <td class="TT" {if $data.wHL or $data.wHR}
38    <td class="LL" {if $data.hVT or $data.hVB}
43    <td class="RR" {if $data.hVT or $data.hVB}
48  <td rowspan="{$data.rowspan}" colspan="{$data.colspan}" class="IMG" {if isset($isSquare)}
71    <td class="BB" {if $data.wHL or $data.wHR}

EDIT: This was already fixed in SVN rev 16871. The above fix will work until G2 2.3 comes out.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website

 
linickx
linickx's picture

Joined: 2005-11-07
Posts: 5
Posted: Tue, 2007-11-06 10:20

worked perfectly, thank you :)