Hi,

Adding the like button makes the page XHTML invalid. In the meantime I changed the return from theme_fb_social_like_widget from

return '

';

to

return '

'."'".');//-->

';

Comments

agraves’s picture

Forgot to add the code tags. I meant replacing

return '<div class="fb-social-like-widget"><fb:like ' . $attrs . '></fb:like></div>';

with

return '<br/><span class="fb-social-like-widget"><script type="text/javascript"><!--//--><![CDATA[//><!-- 
  document.write('."'".'<fb:like ' . $attrs . '></fb:like>'."'".');//--><!]]></script></span>';
Anonymous’s picture

Wondering if this is going to be fixed in the next release of this module (not beta)? Or has it already been fixed? What is the status of this fix?

ferdi’s picture

If that's the right way to do it, we need to change some code on every sub module; for other widgets too. It needs to be a patch to be tested and reviewed by the community

hansrossel’s picture

I can confirm that #1 fixes both validation issues:

The two errors from the http://validator.w3.org validator that are solved are:

  1. "Element div not allowed as child of element span in this context.", so block elements are not allowed inside inline elements.
  2. Element name fb:like cannot be represented as XML 1.0.
davidnbrett’s picture

Version: 6.x-1.0-beta5 » 6.x-1.0-beta9

Using the social like button in a view, I had to change fb_social_like_handler_field_like.inc from :

return '<fb:like ' . $attrs . '></fb:like>';

to

return '<script type="text/javascript">
<!--//--><![CDATA[//><!-- 
document.write(\'<fb:like ' . $attrs . '></fb:like>\');
//--><!]]>
</script>';

Thanks agraves !