WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Validation error when there's a "div" in your droplet
  • Print
Pages: [1]   Go Down

Author Topic: Validation error when there's a "div" in your droplet  (Read 9896 times)

Offline CodeALot

  • Posts: 579
  • Gender: Male
Validation error when there's a "div" in your droplet
« on: May 28, 2015, 12:02:14 PM »
I have a droplet that reads the thumbnail of a Youtube-video, places it in a DIV that 'floats', and in that DIV, under the thumbnail, there is a caption line. Clicking the thumbnail 'fires' a Fancybox containing the video.

So far all is well.

The droplet works, and it contains the following lines:

Code: [Select]
$returnvalue = '<div class="video-thumbnails">';
$returnvalue .= '<a class="variousvideo fancybox.iframe" href="http://www.youtube.com/embed/'.$id.'?rel=0&amp;autoplay=0">';
$returnvalue .= '<img alt="Click to watch video" src="http://img.youtube.com/vi/'.$id.'/0.jpg" /></a>';
$returnvalue .='<br /><div style="min-width:100%; text-align:center;">';
$returnvalue .= $titel.'<br /><small>'.$maker.'</small></div>';
$returnvalue .= '</div>';
return $returnvalue;

The only problem I'm having here is that according to the W3C validator, this is wrong, because in the WYSIWYG-editor there will be P-tags around the droplet. Since a DIV cannot exist within P-tags, this throws an error.
 
Even though the droplet works just fine, I'd like to get rid of the validation errors. For some clients (government-type) this is essential.  Any suggestions?
Logged

instantflorian

  • Guest
Re: Validation error when there's a "div" in your droplet
« Reply #1 on: May 28, 2015, 12:48:27 PM »
You can either use a code2-section and put the droplet call there or format the droplet call in the wysiwyg section as "Normal (Div)" (so there you have nested divs, what is not very good neither, but should not throw any validation error at least).
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Validation error when there's a "div" in your droplet
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2