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
So I started adding rich snippets to Community Plugins and unfortunately it required some code edits. I was hoping that I could keep it all in the templates, but some minor edits were needed.

Here is a link to how Google sees:

Showthread

Profile View

Code edits were needed :

- functions.php : to insert the itemprop="author" in the profile link functions since the templates output a formatted name so i could not wrap without the formating as well.

- functions_post.php : change from itemprop="articleBody" for the first post to itemprop="comment" for all replies

the rest was template edits for
- webpage type, breadcrumb and logo
- article type, author, body, date created and url
- comment type, author, text, date created and url
- person type, name, image, jobtitle (displaygroup), url

only my home page, profiles and showthread are done so far, but i am hopping to get other areas done soon.

so what this is shows me, is that v2.0 needs to get all html of the code and into templates only.....
That is good work Pavemen. I was looking at rich snippets as I think they are definitely a good idea and could not make head nor tail of it, so congrats on figuring it out.

Are you using Google SEO as well? Are you seeing any improvement in rankings as a result of this work you have done?
i am not using google seo other than for 404, meta and sitemap. i am not using redirects or URLs.

i just finished those few pages' rich snippets today, so i will have to see how it goes. its sort of a major task to apply it everywhere needed so it is dynamic enough and not require extra code/output in places.

also, the verified author and publisher stuff requires that you setup a Google+ account (and a page if you dont want your site linked to your account) and then specify those <link rel="xxx".... > bits in your headerinclude. if you do it, you need to pick a subdomain as www.domain.com will not verify if your google+ page is linked as domain.com

best bet is to use htaccess to force www or not and then use the same for the Google+ page

for some reason the profile link i added to the snippets tool is no longer working. strange. guess google decided to block it.
Don't rich snippets require the HTML5 doctype too? In which case you need to modify the format_page function if I remember correctly.

I started doing this at WeDesign anyway. I also did the breadcrumb too using this: https://coderwall.com/p/p0nvjw
i know it does not validate because the doctype is wrong. this is more of a proof of concept for me to see how easy it would be. but given that there are a lot of places HTML is in the code itself, it makes it difficult to apply the microdata tags effectively.

if it was all in the templates, I could work on an HTML5 specific theme/template set and not need code changes.
Yeah. IIRC that's all meant to be fixed in 1.8 so we should see some HTML5 themes then hopefully.
I am looking into the HTML5 stuff further and there is a big change in table attributes. cellspacing and cellpadding is not valid for HTML5 and you need to use CSS instead.

that is a lot of edits to the templates.

<edit> if 1.8 goes table-less then its less of an issue, but it still leaves a ton of old themes that will not validate though they display correctly
Yes, the templates will be great fun to redo from scratch Big Grin
Oh yeah, I forgot about cellpadding and cellspacing. The align and valign attributes are also invalid. As far as I know, 1.8 will not be table-less as it's too big a change for what is supposed to be a relatively minor release.
that is my fear as well. so far the changes have been tolerable (like a SQL query to replace cell padding and spacing with empty strings), now I need to add th, td, tr CSS. the problem is that I am using global templates for some plugins and thus I cant make changes that work with both html4 and html5.
Pages: 1 2