I am wondering what the best practice maybe in regards to creating HTML5 structured websites using tags such as <header>, <section>, <aside>, <footer>, etc.
I can nest in the <aside> tags within the code that's not really a concern but the block level elements such as header, section and footer are a bit of a challenge as Squiz Matrix will allow me to build pages in block elements of divs, not able to choose any other type of block level element.
So what I have done is give the building block div the class of 'section', 'header', 'footer' or whatever else I want it to be then I am nesting the HTML5 tags within the actual page content, for example:
<div class = "section">
<section>
<h1>This is a section</h1>
<p>This is some content for a section</p>
</section>
</div>
I'm kinda thinking that this is overkill and the HTML5 tag does not really need to be there at all but I really want to follow HTML5 semantic markup and the Squiz Matrix version I am currently using does not seem to support that when building page content.
Is there a better way to do this whilst staying true to HTML5 markup?
We're on 5.1 but were serving HTML 5 sites from 4.18 from before the update to 5. We're not heavily using many html5 tags - <header> and <nav> get used but are populated from the design files.
I just realised I 'missed the boat'. Yes I can set it to 'raw html' but I'm fairly sure we avoid this so people with little HTML skills can go in and edit it later on. I will check this for future work where we won't have editors coming in later to update content.
If using all raw html fields to insert HTML5 tags in the future, it wouldn't obviously cause any issues with Easy Edit Suite would it?
I feel real silly. Lack of understanding really. I can still keep whysiwig but set the presentation to "raw html" and leave the content type as whysiwig and not have an extra div inserted into the code.
I feel real silly. Lack of understanding really. I can still keep whysiwig but set the presentation to "raw html" and leave the content type as whysiwig and not have an extra div inserted into the code.
lightbulb just went on.
You can also set this globally, so that you never have to deal with divs being automatically put in your HTML.