Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Generating HTML5 with SilverStripe


Go to End


3 Posts   2652 Views

Avatar
Xurk

Community Member, 50 Posts

16 December 2010 at 2:04am

Our company is testing out the waters in developing websites using HTML5 (supported by Boilerplate) and seeing as we're also trying to move towards developing our high-profile websites using SilverStripe, I'm doing both for a project at the moment.

What I'm wondering - and haven't come across via Google or on the boards here - is if there are any possibilities (for say, the config file) to instruct SilverStripe to produce HTML5 where possible?

I'm not talking about generating whole templates or generating HTML5 tags, but smaller things. For example, in HTML5 it's no longer required to close off certain tags like <br> and <img> anymore, though you're allowed to do so if you wish. Also, tag attributes such as "type" are no longer required for (e.g.) <script>. I've decided to embrace these possibilities and therefore have done my mark-up for the templates in this fashion.
But seeing as I also use Requirements for including my CSS and JavaScript in the template, SilverStripe generates XHTML mark-up for the related tags. It's not a huge deal or anything, but if it's possible (without having to "hack into" the core files to - for example - change the line where <script> elements are outputted), I'd prefer to set the installation up to generate HTML5 for these types of things.

Anyone have any ideas? :)

Avatar
Willr

Forum Moderator, 5523 Posts

16 December 2010 at 11:14am

We're migrating everything to HTML5 slowly bit by bit but most of the core still won't make any changes based on your html5 doctype. At the moment things like ignoring script type is not possible but having a type doesn't make it invalid html5 AFAIK so not a big deal. Next major release should hopefully include support for html5 form types which would be a great step!

Avatar
Xurk

Community Member, 50 Posts

16 December 2010 at 10:34pm

Thanks for your response Willr. It's nice to know that HTML5 support will be gradually creeping into SilverStripe. I agree with you, adding support for the real interesting HTML5 tags (e.g. the form types) would be great :)

You're right about things like the "type" attribute aren't a big deal as it's still valid in HTML5, but I was thinking that if it was as easy as flipping a switch (i.e. adding a line to _config.php) it was worth it ;)