Saturday, March 10, 2018

March 10, 2018

How to Use conditional tags?

How to Display Elements only on specific Pages in Blogger- Conditional tags1?

Hello my friends…!

Have you ever been confusing with like that codes in your Blogger template HTML?

<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<b:if cond='data:blog.pageType != &quot;item&quot;'>

 Or looking for what are they……...?

 Let’s discuss….
Today we discuss about conditional tags.

When you are studying your blog template specially, if you are using professional (third party) template have you ever think that how some certain elements or widgets appear only on certain types of pages?

Some certain widgets or elements of your template appear on the home page, but not on individual post pages also, sometimes side bars appear on homepage but not on individual post pages.
Also, If you are designing your Blogger template, you may prefer certain widgets or elements of your design to appear on certain types
of pages or on the home page & not on individual post pages & you would prefer to display different buttons on different pages, or apply a metatag only to selected pages?

Then that article will help you.

I will explain how you can easily control page elements to display or not on certain types of pages in your Blogger blog.
For do that we use Conditional tags to edit our blog template. Conditional tags are Blogger template tags that allow you to specify parts of your template to appear only under certain conditions. That provide us better control over our templates, allowing us to specify what part of our template appears only under certain conditions.
You may wish to hide a widget or element on one page and display it on the other, need to remove the sidebar on certain pages, or even display buttons on select pages. This is exactly where conditional tags come into play. There are a number of tags available for blogger which, if applied correctly, it will help you modify elements of your blog template.

But remember that Conditional tags work with all of the standard Blogger templates except Dynamic Views, which does not accept customization. Some third party templates may not accept conditional tags, but most do.

Before knowing about the Conditional tags. Let discuss about the different types of pages on blogger.


  1) home page     -   It’s your blogs home page.

  2) Archive Page -  Refers to archive pages. Pages that added by Archive widget that normally has “_archive.html” ending in
                                 its URL belong to Archive page type  (to be displayed when readers view your archive pages)

  3) Item Page       -  Refers to Post Pages that created by clicking new post button (the individual post page)
 
  4) Index Page      -  Includes home page + label page + search results page. (pages readers see when they click the "Older
                                  Posts" and "Newer Posts"  (links at the bottom of the page.)

  5) Static Page       - Blogger Pages that created by clicking new page button.
 
  6) Label Page       - Blogger label-based pages contain similar or related posted articles.

  7) Search Page    - Pages that provides a list of posts that matches the given query terms.



List of conditional tags

There are different conditions to check the page type. You can use these conditions for the selective display. The following are a select few conditional tags you'll require the most:


Home page:
<b:if cond='data:blog.url == data:blog.homepageUrl'>

First post:
<b:if cond='data:post.isFirstPost'>

Archive Pages:
<b:if cond='data:blog.pageType == "archive"'>

Specific page/URL:
<b:if cond='data:blog.url == "ENTER_URL_HERE"'>

Item page(post):
<b:if cond='data:blog.pageType == "item"'>

Static pages:
<b:if cond='data:blog.pageType == "static_page"'>

Index pages (includes homepage, label pages, search result pages and archive pages):
<b:if cond='data:blog.pageType == "index"'>

Archive pages:
<b:if cond='data:blog.pageType == "archive"'>

Posts and static pages:
<b:if cond='data:blog.url == data:post.url'>

Label-search pages:
<b:if cond='data:blog.searchLabel'>

404 Error Page:
<b:if cond='data:blog.pageType == "ERROR_PAGE"'>

Mobile Pages:
<b:if cond='data:blog.pageType == "data:blog.isMobile"'>

Particular url only:
<b:if cond='data:blog.canonicalUrl == &quot; PUT_URL_HERE&quot;'>


Ok. Now i think you have a better idea about conditional tags.
To know how to use conditional tags in your blogger blog please visit below link.


How to Use conditional tags?.......>>>

How to hide side bar in post page?....>>>


For more reading THEWONDERSPOT

........................................................................................................................................................................................................................
EMoneySpot  -  Earn with us..........................................................................................>>>
........................................................................................................................................................................................................................

 How to earn money online.......................................................................................>>>

Improve organic SEO rankings while EARN MONEY (0.05/0.10$) per view.......>>>

How to take screenshots in windows 10 : Different Methods?................................>>>

Free Bandwidth Monitoring Tools For windows PC?.............................................>>>

Abnormally high internet bandwidth usage, c-0001.c-msedge.net of window 10....................>>> 

How to Speed up Internet connection on Windows 10..............................................................>>>

How to Disable Automatic Updates in Microsoft Office 2016?.................................................>>>

How to Disable Automatic Updates in Microsoft Office 2016?..................................................>>>

How to Block Windows 10 "Spying"? ........................................................................................>>>

How to start a Blog?.....................................................................................................................>>>

How to Choose the Best Blogging Platform, advantages & disadvantage.................................>>>

How to make your blog SEO friendly?........................................................................................>>>


All in one SEO pack for Blogger blog.........................................................................................>>>

Thank you for reading.
Good Luck.

Don’t forgot to Subscribe us to get latest news letters and give your feedback in below comment section ;-) ;-)

0 comments:

Post a Comment

Thank you for visit us.
Give your feedback. Don't worry. Your email is safe with us.
Subscribe us to get latest news letters.

amazon

 
Copyright © The WonderSpot All Right Reserved
Powered by Blogger