TinyMCE config for HTML5 in Concrete 5.5
Some of the footer links on the site I'm building use multiple elements nested within <a> tag links like this (perfectly valid HTML5):
<a class="footBespoke" href="/bespoke/"> <h5>header text</h5> <p>some text here</p> </a>
Trouble is, TinyMCE strips the surrounding <a> tags as it considers them invalid (as was the case in HTML 4.01). My workaround has been to go to Dashboard > System and Settings > Basics > Rich Text Editor. Choose Custom editor and add the line:
This stops the <a> tags being stripped but leaves the editor without a toolbar and the styling is all screwed up (no buttons showing for 'save' etc) - I can use it but it's not good for use by the client when I hand it over...
So instead, to solve this I have tried editing blocks/content/editor-config.php and adding:
verify_html: false, valid_children : "+a[div|h1|h2|h3|h4|h5|h6|p|#text]",
At lines 19 and 20 but for some reason, it doesn't seem to effect anything. Does anyone know why?
Is there any way to keep the simple looking editor but add support for the nested elements within <a> tags?
I don't have an answer for you. But I do want to say that I don't think that is valid HTML (not even HTML5). <a> tags are inline elements, while <h5> and <p> are block-level elements, and as far as I know you can't have block-level elements inside inline elements. This is why TinyMCE is messing with your code.
All that being said, just because it's not valid doesn't mean it won't work in the real world, so I hope there is a solution out there -- but I don't think you're going to find it here in the C5 forums -- instead I'd try whatever TinyMCE forums are out there.
Best of luck.
Trust me, that is valid HTML5 - in fact don't trust me, you can check out the relevant part of the W3C spec here:http://dev.w3.org/html5/spec/Overview.html#the-a-element...
Here's a quote of the relevant part, "The a element may be wrapped around entire paragraphs, lists, tables, and so forth, even entire sections, so long as there is no interactive content within (e.g. buttons or other links)".
Just wondered if anyone else had already cracked getting it to work within the TinyMCE as it's going to be used increasingly...
Thanks for the update. Wish I could help with the TinyMCE issue.
Let us know if you find the solution.
Im Using WPMU 4.1