Copy link to clipboard
Copied
I am putting together a website from a template and I keep running into the following error.
the value of attribute [ data-vide-bg ] must be in double quotes.
Here is the line of code in question
<section class="video-section overlay" data-vide-bg= '{"mp4": "video/video-calltoaction.mp4", "poster": "video/placeholder.jpg"}' data-vide-options="posterType: jpg, loop: true, muted: true">
I have tried adding double quotes around data-vide-bg but I just get a different error all together. Can someone help me figure out what I'm missing?
Copy link to clipboard
Copied
Sounds like the Linter telling you something that isn't true... again.
DW's Linting program (the error checker) is less than stellar and often gives "errors" where there are none. Use the real validator at http://validator.w3.org/nu if it says you're good, you can ignore DW's chirping.
If you would like not to be told your clean and valid code is wrong, got to Edit > Preferences > Linting and uncheck the box for Enable Linting.
If you don't mind being told your code is wrong, when it is, and you just want the double quote "error" to go away, you can go to Edit > Preferences > Linting > highlight HTML > click Edit & Apply > scroll to "attr-value-double-quotes": true, and change it to "attr-value-double-quotes": false, > Save and close.
Copy link to clipboard
Copied
That's great to hear, thank you! I can quit banging my head against the wall trying to figure out what I am missing.
Copy link to clipboard
Copied
Try reversing the double & single quotes. Expressed this way, no errors are reported.
<section class="video-section overlay" data-vide-bg= "{'mp4': 'video/video-calltoaction.mp4', 'poster': 'video/placeholder.jpg'}" data-vide-options="posterType: jpg, loop: true, muted: true">
</section>
You'll need to test it in production. Failing that, revert to what @Jon Fritz said.
Hope that helps.