Skip to main content
Commercial Photography

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

New Fifty Shades Darker poster drops

New Fifty Shades Darker poster drops The brand new poster for Fifty Shades Darker , starring Jamie Dornan and Dakota Johnson has just dropped. It comes ahead of the new New Fifty Shades Darker trailer release tomorrow.

Commets, Varialbles & Special Keywords

Comments Javascript supports two types of comments. Double-slashes (//) tell javascript to ignore everything to the end of the line. You will see them used most often to describe what is happening on a particular line. var x=5; // Everything from the // to end of line is ignored(*) var thingamajig=123.45; // 2 times the price of a whatsit. "Blockquotes" begin a comment block with a slash-asterisk (/*) and Javascript will ignore everything from the start of the comment block until it encounters an asterisk-slash (*/). Blockquotes are useful for temporally disabling large areas of code, or describing the purpose of a function, or detailing the purpose and providing credits for the script itself.  function whirlymajig(jabberwocky) {    /* Here we take the jabberwocky and insert it in the gire-gimble, taking great care to observe the ipsum lorum!   For bor-rath-outgrabe! We really should patent this! */    return (jabberwocky*2); } You should note that...

Agile Lock v1.6 for Android

A gile Lock customizable my lock screen and make more attractive. It is the replacement of lock screen, Sense 3.0 like, it gives a COOL lock experience. Whats are Main Features: Sense 3.0 style slider look Customize your lock screen with shortcuts/widgets which are allowed on the lock screen Widget for weather built-in Customize Fonts, supported type .ttf Choose your favorite wallpaper for customization Different ways of wake up the screen, such as volume button or power button This lock support system security More customization available in setting. You may also like these articles. Text Plus Gold 4.5 for Android Astro File Manager for Android Twitter for Android Learn to Run the App: Open the app AgileLock, touch the flashing power button in the middle of the screen. When the yellow circle around appear around the power button, your App starts to run on your phone. Tips & setting for resolving issues: If you have facing issue with the power button, such as light screen canno...