How do I add facebook and google plus share code to HTML5Boilerplate? - html5boilerplate

HTML5Boilerplate has some conditional code for outputting the open < HTML > tag. I'm working on adding the xfbml and google plus sharing code on my site, but not sure where to add the required code to the < HTML > tag.
On Paul Irish's github I see this comment thread which says facebook only needs the code in the open < html > tag for IE browsers:
https://github.com/paulirish/html5-boilerplate/pull/395,
so I could just add that to the conditional IE statements in html5boilerplate.
However I'm not sure about the google plus code. At this page http://www.google.com/webmasters/+1/button/index.html it tells us to add this to the < HTML > tag:
<!-- Update your html tag to include the itemscope and itemtype attributes -->
<html itemscope itemtype="http://schema.org/">
I could use some guidance on how to include the < html > tag by default so I can append information to it for the social sharing tools.
Thanks,
Stacey

Don’t use XFBML. Use this instead: http://www.phpied.com/social-button-bffs/

Related

adding website thumbnail to facebook through css (og:image)

I have standard html files with their own style, and use a common css file for different fonts only. I need to put the FB website thumbnail to all the files through that css.
Is it possible to add the following to the css or .js files? (as there are thousands of html files):
<meta property="og:image" content="http://websitename/image.jpg">
You'll need to add that snippet to the html itself, not the css. Meta tags go into the head of your webpage (between the <head></head> tags). There's no way to insert html into a page via a css file.
OpenGraph is some standard - even if you did put it inside your CSS - nobody would know it's there - so no, it can't be done with CSS.
If some website would process the javascript (but facebook hardly would) you could get lucky but the chances are really low so it is not reliable.
However I suggest you to write a little e.g. PHP skript that would run through all the .html / .htm files and would rewrite <head> with <head> <meta property="og:image" content="http://websitename/image.jpg">
But I suggest that instead of adding only html, it would be much better if you would add an include script that would contain further cross-files changes. So next time you would need to add something to <head> in all your files you would just add it inside your e.g. my_include.php
EDIT:
I would also recommend you to look at the facebook's developer tool that tells you exactly what it sees when it visits your site: https://developers.facebook.com/tools/debug/og/echo?q=YOURSITEURL

Google Plus Share Button not showing description tags... an Unannounced Google Platform change?

OK guys, tell me what I am doing wrong... Is this a new Google Plus issue? Or — to use an old Facebook term I created — an Unannounced Platform Change? (note the date of this question)
Please Note that I'm asking about Google Plus Share Buttons, not the GP+1 like button which is a different beast…
The Description Tag is not passed thru to the share window or to the Google Plus page post. If you inspect the Google window code with Firebug, you will see this:
<div class="Zm"></div>
…which is where the description tag should display.
Demo and source code located here.
Now...
The demo and the more complex script are both HTML5 validated. I have tested this with both schema.org tags and open graph tags:
All Tags work fine in the Google Structured Data Testing Tool here.
Results are the same in both cases: description tag does not display, so that's not the problem.
I have tested this on http:// and https:// with the same results: description tag does not display, so that's not the problem.
I have tested this on FF22.0 with and without AdBlockPlus && Chrome 28.0 and the results are the same: description tag does not display, so that's not the problem.
I have tested different button types with the same results: description does not display, so that's not the problem.
And I have googled for hours… and cannot find any "current links" to this issue that are not simple code errors.
So what part of this am I missing?
Any ideas, comments, suggestions or solutions would be greatly appreciated!
Google+ dropped the shared page's description.
You can find indications of that by looking at the "Basic Page" example at https://developers.google.com/+/web/share/ which used to show a description until several weeks ago. The current status of Google documentation clearly shows that a "description" is not expected or used anymore.
<html>
<head>
<title>Share demo: Basic page</title>
<link rel="canonical" href="http://www.example.com" />
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
</script>
</head>
<body>
<g:plus action="share"></g:plus>
</body>
</html>
So, the only important tags are:
the "page title",
and — optionally — the "canonical link" (for SEO reasons).
That's it!
Obviously, Google downgraded website descriptions to less relevant in Google+ just like they did in their search engine a long time ago.
Most probably this was done for the same reasons Google once started to put less emphasis on the description of pages in their Search Engine product too: to avoid spam and keyword stuffing from polluting their Google Search and Google+ products.
For additional, "official" reference that Google generally marked descriptions to be "less important" a long time ago, check https://support.google.com/webmasters/answer/35624?rd=1 which states in the section "Create good meta descriptions":
...Google will sometimes use the meta description of a page in search results snippets, if we think it gives users a more accurate description than would be possible purely from the on-page content...
Well, "sometimes" obviously does not include Google+ (anymore) and — to be honest — I see their point. After all, you can (and should) "describe" the link in your Google+ post textarea yourself… which would also be the most logic thing to do: tell your users why the linked website is worth visiting instead of relying on a site's description.
You can use Google Snippet via meta tags to inform google what to display when your link is shared... You can view details # https://developers.google.com/+/web/snippet/ (Customize the snippet people see when your page is shared. Using this tool, you can generate code for your page that indicates the images and text that best represent what's being shared.)
<!-- Update your html tag to include the itemscope and itemtype attributes. -->
<html itemscope itemtype="http://schema.org/Article">
<!-- Add the following three tags inside head. -->
<meta itemprop="name" content="Title For Example.com">
<meta itemprop="description" content="Sample Description For The Article..">
<meta itemprop="image" content="http://www.example.com/1.jpg">
Hope this helps.

How to convert .aspx pages and master pages to html pages?

I am doing one project in asp .net.Its completed,then the same project will be done in html5. How to convert the .aspx pages and master pages to html 5? Is it possible?If any one know please tell me.
You can technically make the page HTML5 by changing the doctype...
<!DOCTYPE html>
<html lang="en">
<head runat="server">
<meta charset="utf-8" />
It is also recommended that you specify a lang attribute on the html tag and include the meta tag to define your character set.
This won't give you instant HTML5 semantics, but this is essentially step one. Using the right elements for the right kinds of content will be down to you, for example deciding when to use header, article, section, footer instead of plain div elements and so on.
You should also be able to select "DOCTYPE:HTML5" from the toolbar in Visual Studio - I don't know what version you are using, but I think in the previous version you could download a HTML5 language extension, I'm pretty sure it is included by default in Visual Studio 2012.
what you can do... if I understand your question correctly is, rightclick and say view page source and copy your html or install google chrome and the on each page you can go rightclick and inspect element. you can copy and paste the html of each page including the masterpage content. Its a sloppy way but will work if you only want the html
One of the way that i think you can do is to use http://modernizr.com/ kind of framework to switch between html5 and normal html easily .

Can Schema.org VideoObject tags be applied to iframes?

Can VideoObject tags (Schema.org) be applied to iframes? Their own example and this one on googlewebmastercentral mentions nothing on videos embedded with iframes.
Should it be added to the iframe itself with meta inside the iframe, or a wrapping div?
<iframe itemprop="video" itemscope itemtype="http://schema.org/VideoObject" src="http://player.vimeo.com/video/CLIP_ID" width="400" height="225" frameborder="0">
<meta itemprop="duration" content="T1M33S" />
</iframe>
Yes, the VideoObject tags can be applied to an video embed using an iframe. But if it really helps, given the following post, is the question, check out this post: http://www.reelseo.com/embedded-youtube-indexed-google/.
Also, to give an answer to your (and my) question I used the following Google keywords: https://www.google.com/#q=schema.org+videoobject+iframe.
Are you concerned of Google Snippet (Video Schema Markup)? I this is not possible because Meta tag should be found between head tag and iframe tag is usually embedding another page so this will be not detected through Google Snippet Testing Tool.
More information at http://searchenginewatch.com/article/2278710/Embedded-Video-Schema-Markup-A-7-Step-Checklist-for-Great-Results

Error when using LinkedIn's Share button

I'm attempting to add a LinkedIn Share button to our content-driven website. I've generated the embed code using the button builder, but whenever I try to actually use the button, I get a generic error:
There was a problem performing this action, please try again later.
It's been doing this for several days (since I first added the code), so I don't know if the error is on the LinkedIn side or mine. Is there any way to get a more specific error message? The code they provide is just a script tag that you paste in:
<script src="http://platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share"></script>
Unfortunately LinkedIn's "support" forums are limited to the various API's; there's nowhere available to submit a question regarding the build-a-button functionality. I'm hoping someone else has used this function and can point me in the right direction.
Most likely the page you are trying to share is not web accessible (local, under htaccess password or something). It looks to me like LinkedIn tries to actually look at the page you are sharing, and if it can't reach it, it gives you this message.
Most likely the url which you are sharing is not encoded, try encoding that, also follow this article for more.
The easiest way to ensure the linkedin share button works properly, is to use
<!DOCTYPE html>
instead of other alternatives.
look at the data-url attrbute. Remove the "http://" and only use "www." for your website url. That fixed my issue at least.
I found this way for validate in xhtml:
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
< script src="http://platform.linkedin.com/in.js" type="text/javascript">< /script>
< div id="linkedin">< /div>
< script type="text/javascript">
var po2 = document.createElement('script');
po2.type = 'IN/MemberProfile';
po2.setAttribute("data-id","http://www.linkedin.com/pub/luca-di-lenardo/11/4b7/3b8");
po2.setAttribute("data-format","hover");
po2.setAttribute("data-text","Luca Di Lenardo");
document.getElementById("linkedin").appendChild(po2);
< /script>
Remove the white space and it works!
If anyone is getting this error, and cannot figure out why, I recommend checking the URL of the page you're sharing with: LinkedIn Post Inspector.
So, for instance, if I were to check out how wikipedia.org looks when shared, I would visit and enter that URL, like so...
https://www.linkedin.com/post-inspector/inspect/https:%2F%2Fwww.wikipedia.org%2F
And I see...
But there's a ton of information here, showing how everything is parsed, from the description to the title to the image selection for thumbnail display...
Warning: Add an og:image tag to the page to have control over the content's image on LinkedIn.
Title: Wikipedia
Type: Article
Image: No image found
Description: Wikipedia is a free online encyclopedia, created and edited by volunteers around the world and hosted by the Wikimedia Foundation.
Author: No author found
Publish date: 6/1/2020, 6:39:59 AM
They even give you instructions on how to fix your page! Hey, got some advice for Wikipedia.org here!
Provide a metadata tag for the og:image in the page's head section. For example:
<meta name="image" property="og:image" content="[Image URL here]">

Resources