Recent Topics

b2evolution seems to create invalid XHTML for empty bloglist

Started by on Feb 09, 2007 – Contents updated: Feb 09, 2007

Feb 09, 2007 13:10    

It looks to me like when a skin generates an empty bloglist, the b2evolution engine (or something that it uses) generates invalid XHTML:

Code

<ul id="bloglist"></ul>

The XHTML validator complained about this:

Error Line 32 column 22: end tag for "ul" which is not finished.
<ul id="bloglist"></ul>
Most likely, You nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, <head> generally requires a <title>, lists (ul, ol, dl) require list items (li, or dt, dd), and so on.

Feb 09, 2007 14:16

Crack open /skins/_bloglist.php and change this bit of code :-

PHP

// Output:
echo $blog_list_start;
echo implode$blog_list_separator$blog_links );
echo $blog_list_end;

to this :-

PHP

// Output:
if( !empty( $blog_links ) )
{
  echo $blog_list_start;
  echo implode$blog_list_separator$blog_links );
  echo $blog_list_end;
}

¥

Feb 09, 2007 18:52

Thanks!

Is this fix in the default skins in the next version of b2evolution? If not it might be worth applying so that those skins don't generate invalid XHTML.

Feb 09, 2007 23:51

If I remember, I'll make the changes to cvs ;)

¥


Form is loading...

Secure CMS – This forum is powered by b2evolution CMS, a complete engine for your website.