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

Getting strict HTML compliance.


Go to End


3 Posts   1540 Views

Avatar
bobdobbs

Community Member, 6 Posts

28 October 2009 at 12:56pm

Hi all.

One of the reasons that I'm looking into silverstripe is that it seems that if I set it up properly, I can deliver my documents compliant to strict hmtl 4. Most other cms's make it difficult or nigh impossible to deliver content as anything other then xhtml or tag soup.

The docs for 'content negotiator' states:
"If you have not specified a correct xml header to your root Template file ... then SilverStripe will rewrite the Doctype and your html to confirm to HTML 4 Strict instead of serving it as XHTML"

This seems to have some undocumented limitations.

So far, I've found that I've had to override functions from SiteTree.php in my 'MyOwnPageType.php' in order to make metatags compliant with strict html 4. My next step is to figure out how to do the same for css links in the document head.

My questions are:

If I want to prioritise delivery of content compliant to a strict html doctype, is silverstripe for me?
(I will be wanting to use a blog module to deliver html as well)

If delivering strict html is not an insurmountable challenge, what resources and documentation should I be paying particular attention to? What issues should I be aware of?

Please note that this is not a complaint or a gripe. I've spent a couple of days solidly assessing silverstripe, and I'm really impressed with it. I just have to yet figure out if it suits my particular needs.

Thanks.

Avatar
baba-papa

Community Member, 279 Posts

28 October 2009 at 7:23pm

All html is generated in a method or a template. Feel free to customize any html output.

Avatar
bummzack

Community Member, 904 Posts

28 October 2009 at 9:25pm

Edited: 28/10/2009 9:30pm

From my experience, SilverStripe does a great job delivering valid (X)HTML. Of course it does depend on your templates, but also modules and stuff like forms or the wysiwyg editor seem to be written very well in that aspect. And if you need some other markup you can always override the template for that specific part.

Compared to other CMS I used, getting valid (X)HTML with SilverStripe is a breeze.
Maybe also have a look at this: http://doc.silverstripe.org/doku.php?id=contentnegotiator

Edit Regarding the stylesheet links: Don't use the Requirements class to output stylesheets, simply include the stylesheets you need in the html head (as you would do with a static html page)?