Skip to main content

Conditional Tags for your blogger to make more responsive

Conditional Tags for your blogger to make more responsive

There are a few tricks to hide elements of both the blog on the home page / homepage, posts, static pages or by adding a conditional tag code in each element you want to hide.

Example
<b:if cond='data:blog.pageType != "static_page"'>
..... The contents of the content to be wrapped conditional tags (Content will be hidden in the static pages) .....
</b:if>

Not only hides an element but it could be to display only certain elements in the page that you specify.

Example
<b:if cond='data:blog.url == data:blog.homepageUrl'>
..... The contents of the content to be wrapped in the conditional tag (content will only appear on the home page) .....
</b:if>
for more details please refer to some function conditional tag for widget below: 


1. Widget displays only on the home page:


<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if>
</b:includable>
</b:widget>

2. View the Widgets only on the post page:


<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == "item"'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if>
</b:includable>
</b:widget>

3. View the Widgets only on certain page:


<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url == "Your URL"'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if>
</b:includable>
</b:widget>
Change "Your URL" to your page url.

4. Hiding the Widgets only on certain page:


<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url != "Your URL"'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if>
</b:includable>
</b:widget>
Change "Your URL" to your page url.

5. Display Widgets only on a static page:


<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == "static_page"'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if>
</b:includable>
</b:widget>

6. Hide Widgets on a static page:


<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType != "static_page"'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if>
</b:includable>
</b:widget>

7. Widgets display only on the archive page:


<b:widget id='HTML1' locked='false' title='Recent Posts' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == "archive"'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if>
</b:includable>
</b:widget>

Once you add a tag conditional upon, save the template and see the results. Not limited to the widget, with conditional tags you can wrap other elements such as scripts, CSS, or HTML template for reasons accelerate blog by reducing the script contained in a page or other privacy reasons. May be useful.

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 »