Skip to main content

Blogger XML Operator and Syntax Updates 2015

Blogger Logo

Recently Blogger has released several new operators for the syntax of XML them. This new syntax allows us to be able to write code templates that better, more logical and more efficient. In addition to reducing the size of the file is XML, the new syntax also allows developers to be able to find new potentials in manipulating the template code Bloggers who used mostly only we can do with JavaScript. Here is a summary ...

And

Before

<b:if cond='data:blog.searchQuery'>
<b:if cond='data:numPosts &gt; 10'>
The search results by the number of posts more than 10 ...
</b:if>
</b:if>

After

<b:if cond='data:blog.searchQuery and data:numPosts &gt; 10'>
The search results by the number of posts more than 10 ...
</b:if>
<b:if cond='data:blog.searchQuery &amp;&amp; data:numPosts &gt; 10'>
The search results by the number of posts more than 10 ...
</b:if>

Or

Before

<b:if cond='data:blog.pageType == &quot;index&quot;'>
Pass the test ...
</b:if>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
Pass the test ...
</b:if>

After

<b:if cond='data:blog.pageType == &quot;index&quot; or data:blog.pageType == &quot;item&quot;'>
Pass the test ...
</b:if>
<b:if cond='data:blog.pageType == &quot;index&quot; || data:blog.pageType == &quot;item&quot;'>
Pass the test ...
</b:if>

Not

Before

<b:if cond='data:comment.isDeleted'>
<b:else/>
Comments are not erased here ...
</b:if>
<b:if cond='data:comment.isDeleted == &quot;false&quot;'>
Comments are not erased here ...
</b:if>

After

<b:if cond='!data:comment.isDeleted'>
Comments are not erased here ...
</b:if>
<b:if cond='not data:comment.isDeleted'>
Comments are not erased here ...
</b:if>
Which can not be:
<!-- TEMPLATE ERROR: 'not' term cannot be used as operator except when preceding 'in' or 'contains' -->
<b:if cond='data:comment.isDeleted not &quot;false&quot;'>
Comments are not erased here ...
</b:if>
<!-- TEMPLATE ERROR: Extra characters at end of string: buf=[!] remainder=["false"] -->
<b:if cond='data:comment.isDeleted ! &quot;false&quot;'>
Comments are not erased here ...
</b:if>
Which can be:
<b:if cond='not data:comment.isDeleted == &quot;false&quot;'>
Comments are not erased here ...
</b:if>
<b:if cond='!data:comment.isDeleted == &quot;false&quot;'>
Comments are not erased here ...
</b:if>

Ternary Selector

Before

&lt;html class=&#39;<b:if cond='data:blog.pageType == &quot;item&quot;'>
page-item
<b:else/>
page-non-item
</b:if>&#39;&gt;

&lt;/html&gt;

After

<html expr:class='data.blog.pageType == &quot;item&quot; ? &quot;page-item&quot; : &quot;page-non-item&quot;'>

</html>
<html expr:class='&quot;page-&quot; + (data.blog.pageType == &quot;item&quot; ? &quot;&quot; : &quot;non-&quot;) + &quot;item&quot;'>

</html>

Membership

Almost the same as the operator or, just that all references must be the same comparison, values ​​are distinguished:

Before

<b:if cond='data:comment.author == &quot;Taufik Nurrohman&quot;'>
Admin comment ...
</b:if>
<b:if cond='data:comment.author == &quot;Taufik&quot;'>
Admin comment ...
</b:if>
<b:if cond='data:comment.author == &quot;Admin&quot;'>
Admin comment ...
</b:if>

After

<b:if cond='data:comment.author in {&quot;Taufik Nurrohman&quot;,&quot;Taufik&quot;,&quot;Admin&quot;}'>
Admin comment ...
</b:if>
<b:if cond='data:comment.author in [&quot;Taufik Nurrohman&quot;,&quot;Taufik&quot;,&quot;Admin&quot;]'>
Admin comment ...
</b:if>
<b:if cond='{&quot;Taufik Nurrohman&quot;,&quot;Taufik&quot;,&quot;Admin&quot;} contains data:comment.author'>
Admin comment ...
</b:if>
<b:if cond='[&quot;Taufik Nurrohman&quot;,&quot;Taufik&quot;,&quot;Admin&quot;] contains data:comment.author'>
Admin comment ...
</b:if>

Else If

Before

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<data:post.body/>
<b:else/>
<b:if cond='data:blog.pageType == &quot;static_page&quot;'>
<data:post.body/>
<b:else/>
<data:post.snippet/>
</b:if>
</b:if>

After

<b:if cond='data:blog.pageType == "item"'>
<data:post.body/>
<b:elseif cond='data:blog.pageType == &quot;static_page&quot;'>
<data:post.body/>
<b:else/>
<data:post.snippet/>
</b:if>
or…
<b:if cond='data:blog.pageType in {&quot;item&quot;,&quot;static_page&quot;}'>
<data:post.body/>
<b:else/>
<data:post.snippet/>
</b:if>

Reference:

Comments

Popular posts from this blog

Sultan 2016 Hindi 480P-720P NR-DvdRip 500MB 700MB 1.5GB

Sultan 2016 Hindi 480P-720P NR-DvdRip 500MB 700MB 1.5GB IMDB Ratings: 8.3/10 Genre(s): Drama, History, Thriller Release Date: 6.July.2016 Director: Pranav Singh, Jitendra Tiwari Star Cast: Salman Khan, Marko Zaror, Anushka Sharma Language: Hindi
Story: Sultan is a story of Sultan Ali Khan – a local wrestling champion with the world at his feet as he dreams of representing India at the Olympics. It’s a story of Aarfa – a feisty young girl from the same small town as Sultan with her own set of dreams. When the 2 local wrestling legends lock horns, romance blossoms and their dreams and aspirations become intertwined and aligned. However, the path to glory is a rocky one and one must fall several times before one stands victorious – More often than not, this journey can take a lifetime. Sultan is a classic underdog tale about a wrestlers journey, looking for a comeback by defeating all odds staked up against him. But when he has nothing to lose and everything to gain in this fight for his life m…

Rams: Film Review

Rams: Film Review
Cast: Sigurour Sigurjonsson, Theodo Juliusson, Charlotte Boving
Director: Grimur Hakonarson

Bucolic and fraternal, Scandi-drama Rams is a look at the devastation a blight can cause both in a relationship and also in a farming community.

Brothers Kiddi and Gummi (bearded grizzled types Sigurjonsson and Juliusson) live side by side and have done for years. But they don't talk, victims of a fall-out never explored but oft mentioned. Tensions are further exacerbated when Kiddi's rams beat Gummi's in a competition, sealing the deal and the drift between the pair.

However, when Gummi finds signs of fatal degenerative disease scrapie in Kiddi's flock, things boil over as the flocks in the valley have to be slaughtered to protect the spread. But Kiddi believes it's Gummi's jealousy that has hit the limit over their flock's lineage, even though vets back Gummi up.

So, with the valley's livelihood and the community ripped asunder by the cull, the bat…

Savdhaan India Ep1591 19 Apr 2016 Lust Leads To Crime

Savdhaan India Ep1591 19 Apr 2016Lust Leads To Crime
Telecast Date: 19.Apr.2016 Running Time: 00:41:51 Language: Hindi
Story:
Read more »