MyBB Community Forums

Full Version: rich snippets
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I think it is XHTML (the MyBB doc type) that is the issue here. Once you set the doc type to HTML5 and go through the pain it is done. I think. I hope.
well if i want to support multiple doctypes like letting users pick a theme, then all the themes available on the site need to NOT use global templates (Global, MyNetwork, etc) or make copies of all of them and edit accordingly. otherwise they all need to be the same doctype.

its just a lot of work, even for a 1.6 to 1.8 upgrade.
Yes, that is true. I know that a couple of plugins add templates to the template sets of the themes rather than as a global template - there are reasons for and against this approach I think. But that is another discussion Big Grin
If you have to edit core files to change the doctype, then what's the doctype template for? D:
Yes, I know what the doc type template is for - but what Pavemen is saying is that the global templates have to match the doctype as set in the theme. I think by a lot of work he was referring to setting all the templates up PER THEME rather than using the Global templates.

At least, I thought that was what he meant.
(2012-11-30, 01:52 AM)Eric J. Wrote: [ -> ]If you have to edit core files to change the doctype, then what's the doctype template for? D:

the doctype template is what sets the doctype on the page. the core file edits are needed to assign things like itemprop="author" to the author of the post since the HTML being output is formatted based on usergroup and that is what the templates uses. So I need to change (off the top of my head)

build_formatted_username($post['user'], $post['usergroup']);

to

build_formatted_username('<span itemprop="author">'.$post['user'].'</span>', $post['usergroup']);

and a few similar edits.

(2012-11-30, 01:59 AM)Leefish Wrote: [ -> ]Yes, I know what the doc type template is for - but what Pavemen is saying is that the global templates have to match the doctype as set in the theme. I think by a lot of work he was referring to setting all the templates up PER THEME rather than using the Global templates.

At least, I thought that was what he meant.

yes that is what I meant. if all themes use a global template and one theme is html4 and another is html5, then you can not add the html5 tags/items wihtout breaking the validation of the html4 theme, since the template is used by all themes.

if you use only one theme and dont allow users to select their own, then its not an issue. just edit the global templates to use html5
Also as I said above, the format_page function uses str_replce to add stuff like the following (which is not valid for HTML5 IIRC):

xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"

Only the lang variable there is valid I believe.
(2012-11-30, 10:00 AM)euantor Wrote: [ -> ]Also as I said above, the format_page function uses str_replce to add stuff like the following (which is not valid for HTML5 IIRC):

xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"

Only the lang variable there is valid I believe.

actually, the W3C validator does not complain about that line at all, though it is beta and not complete according to the site.
I'm pretty sure the xml:lang and xmlns properties should be invalid. HTML5 is, after all, not an XML type doctype unlike XHTML.
Pages: 1 2