Saturday, September 23, 2017

Classic Google and embedding New Google posts on Blogger and HTML pages

Classic Google and embedding New Google posts on Blogger and HTML pages


Users of Google+ have encountered gentle reminders to switch to the new Google+ UI for months now. The earlier version, referred to as classic Google+, will eventually "go away". On the upside, the new Google+ is simpler and more attractive, which was Googles response to criticisms from mainstream users who found it "too complicated". On the downside, Google+ loses some functionality when it comes to sharing and interactivity. With the new Google+, posts are generally encouraged to stay within the Google+ ecosystem.

Sharing options in the new Google+.

Post options in the old Google+ has an Embed post option.

Google+ classic has options to Link to post and Embed post. Link to post provides a hyperlink directly to Google+, while Embed post provides a few lines for copying to HTML markup.



The new Google+, on the other hand, has options to share directly to Twitter, Facebook, and another Google+ account. When using these Share options, a post is directly embedded to Twitter or Facebook along with a corresponding preview or widget. The new Google+ also has the Copy link option to get a Google+ link, which provides the same function as the Link to post in the classic Google+ UI. Unfortunately, the option to get the markup for embedding Google+ is no longer available.



As of this writing, a simple workaround to embedding Google+ posts is to reuse the original markup from classic Google+. Users just need to replace the href value with the Google+ post you want to embed.

To embed a new Google+ post to a Blogger post:

1. In the new Google+, click the Share button, and then click Copy link.

2. In Blogger editor, click HTML.



3. Copy and paste the following lines in the area where you want the Google+ widget to appear:

<!-- Place this tag in your head or just before your close body tag. -->
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>

<!-- Place this tag where you want the widget to render. -->
<div class="g-post" data-href="https://plus.google.com/102384515962394646784/posts/aMyaDcch6Aj"></div>


4. Replace the data-href value with the link from the new Google+.

Note: When you switch to the Compose view in Blogger, the Google+ widget with the Google+ post preview is not shown, but will appear if you click Preview.




As an example, this page uses the procedure outlined to add this Google+ widget post:





No comments:

Post a Comment