There is now single occurence of "data:post.body" Tag official Blogger Templates


#1

Recently Blogger has updated the Schema Structured Data Markup of the Official Blogger Templates, Instead of Double Body, which was used till recently, Blogger templates now use a single body.

The New Markup shown below has to be applied to your Blog by reverting - Blog 1 - to default.

<b:includable id=‘post’ var=‘post’>

<a expr:name='data:post.id'/>
<b:if cond='data:post.title'>
  <h3 class='post-title entry-title' itemprop='name'>
  <b:if cond='data:post.link or (data:post.url and data:blog.url != data:post.url)'>
    <a expr:href='data:post.link ? data:post.link : data:post.url'><data:post.title/></a>
  <b:else/>
    <data:post.title/>
  </b:if>
  </h3>
</b:if>

<div class='post-header'>
<div class='post-header-line-1'/>
</div>

<!-- Then use the post body as the schema.org description, for good G+/FB snippeting. -->
<div class='post-body entry-content' expr:id='&quot;post-body-&quot; + data:post.id' expr:itemprop='(data:blog.metaDescription ? &quot;&quot; : &quot;description &quot;) + &quot;articleBody&quot;'>
  <data:post.body/>
  <div style='clear: both;'/> <!-- clear for photos floats -->
</div>

<b:if cond='data:post.hasJumpLink'>
  <div class='jump-link'>
    <a expr:href='data:post.url + &quot;#more&quot;' expr:title='data:post.title'><data:post.jumpText/></a>
  </div>
</b:if>

Problem with new template not saving changes in post body
#2

Now it’s more complicated then before :confounded:

Thanks for telling us :blush:

Soo what’s this " :question: " mark code for:

expr:itemprop='(data:blog.metaDescription ? &quot;&quot; : &quot;description &quot;) + &quot;articleBody&quot;'

<a expr:href='data:post.link ? data:post.link : data:post.url'>

#3

From what I understood, you mean to say blogger has updated the syntax for conditional statements? Am I right.

Like you can now use the OR and AND parameters inside the IF statements

If this is true then it would save a lot of time and better optimize the template code.


#4

This was the Syntax which was previously used for the past few years. It had two different data:post.body/ one each for posts which had a Meta Description and for those posts which did not have one.

One of the problems with it was that if someone wanted to insert an Adsense Unit inside the Post text or below the Post text, he had to insert the Adsense Code [ 4 times] above and below both the data:post.body/, otherwise the ads either became unclickable or did not show up on one one of the data:post.body/.

The new Markup solves this problem and hopefully the one about the Duplicate tags. I would definately like to hear your opinion on this.

<b:includable id=‘post’ var=‘post’>

<a expr:name='data:post.id'/>
<b:if cond='data:post.title'>
  <h3 class='post-title entry-title' itemprop='name'>
  <b:if cond='data:post.link'>
    <a expr:href='data:post.link'><data:post.title/></a>
  <b:else/>
    <b:if cond='data:post.url'>
      <b:if cond='data:blog.url != data:post.url'>
        <a expr:href='data:post.url'><data:post.title/></a>
      <b:else/>
        <data:post.title/>
      </b:if>
    <b:else/>
      <data:post.title/>
    </b:if>
  </b:if>
  </h3>
</b:if>

<div class='post-header'>
<div class='post-header-line-1'/>
</div>

<b:if cond='data:blog.metaDescription == &quot;&quot;'>
  <!-- Then use the post body as the schema.org description,
      for good G+/FB snippeting. -->
  <div class='post-body entry-content' expr:id='&quot;post-body-&quot; + data:post.id' itemprop='description articleBody'>
    <data:post.body/>
    <div style='clear: both;'/> <!-- clear for photos floats -->
  </div>
<b:else/>
  <div class='post-body entry-content' expr:id='&quot;post-body-&quot; + data:post.id' itemprop='articleBody'>
    <data:post.body/>
    <div style='clear: both;'/> <!-- clear for photos floats -->
  </div>
</b:if>

<b:if cond='data:post.hasJumpLink'>
  <div class='jump-link'>
    <a expr:href='data:post.url + &quot;#more&quot;' expr:title='data:post.title'><data:post.jumpText/></a>
  </div>
</b:if>

#5

The two <data:post.body/> tags each has different purpose.

  1. One Is used for Desktop Layout
  2. Second is used for Mobile View Layout

The first occurrence of this tag is for desktop and is located under the Parent tag as shown below

<b:includable id='post' var='post'>

and the second appearance is for Mobile.

<b:includable id='mobile-post' var='post'>

So why would you paste the code twice or 4 times when each tag has its own purpose?

Check where is your code located. There must be a tag for mobile view also.


#6

By 2 Body Tags where ad unit code had to be inserted 4 times, I meant the 2 Body Tags for the Desktop view.

I had tried to find a solution for this for a long time, but could not find one.

This problem disappeared when I replaced the earlier code with the new one which has only 1 Body Tag…


#7

I guess we better close this topic because it can confused users in future. Though I got your point and apreictae that you so deeply observe the codes. Great @Sujata!


#8