Skip to main content
Commercial Photography

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…

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 »

Win a double pass to see DON'T BREATHE

Win a double pass to see DON'T BREATHE
To celebrate the release of the US Number 1 Box Office smash, Don't Breathe, I've got double passes to see the film!

About Don't Breathe


A group of friends break into the house of a wealthy blind man, thinking they'll get away with the perfect heist. They're wrong.
Directed by: Fede Alvarez
Written by: Fede Alvarez & Rodo Sayagues Produced by: Sam Raimi, Rob Tapert, Fede Alvarez
Executive Producers: Nathan Kahane, Joe Drake, Erin Westerman, J.R. Young, Mathew Hart
Cast: Jane Levy, Dylan Minnette, Daniel Zovatto and Stephen Lang

Don't Breathe hits cinemas September 22nd

To enter simply email to this address: darrensworldofentertainment@gmail.com - simply CLICK HEREdarrensworldofentertainment@gmail.comand in the subject line put BREATHE 

Please include your name and address and good luck! NB Competition closes 22 September- editor's decision final!