Collection of Blogger Conditional Tags and their Functions - This conditional tag code has a function to display and hide certain widgets that are on blogger. For example, you want to display the popular post widget on the blog homepage but when on the posting page the popular widget is not displayed or hidden. You can do this by adding conditional tag code to the popular post section or other widgets.
Collection Of Blogger Conditional Tags And Their Functions
In the programming world there are many types of conditional tags, but here I will explain a number of conditional tag collections for the blogspot platform. In making blogger templates conditional tag code is very helpful to arrange some elements that will later be displayed or hidden, therefore for those of you who want to create your own blog template or who like to edit blog templates must know the basic functions of this blogger conditional tag.

Conditional Tag Function
Conditional Tags or Conditional Tags are tags that are used to regulate certain elements that function to display or hide elements under certain conditions.

How to Read a Conditional Tag
Conditional tag code always starts with the <b: if> tag and closes with the tag </ b: if>. Each <b: if> tag code has a cond attribute, where this cond attribute has various types of values ​​that function to indicate a condition. We take one example of the most commonly used conditional tags.
  • <b: if cond = 'data: blog.url == data: blog.homepageUrl'> OBJEK </ b: if>
From the example above we see that the cond attribute has a data value: blog.url == data: blog.homepageUrl which shows the desired condition.

Data code: blog.url is a statement to represent the state of a URL page, while the data code: blog.homepageUrl is a representative of your blog's homepage. We take the example again, for example, you have a blog with the URL address https://www.elbongultom.com/, then the data code: blog.homepageUrl can be interpreted as https://www.elbongultom.com/.

Displaying Certain Elements Using Conditional Tags
We take the example from the code above, for example I want to display an object only on the home page or blog homepage and it will disappear or not appear on other pages. Then the conditional tag code used is as below.
  • <b: if cond = 'data: blog.url == data: blog.homepageUrl'> OBJEK </ b: if>
Hiding Certain Elements Using Conditional Tags
The opposite of the previous method, for example I want to remove or hide an object on the home page or blog homepage and will appear or appear on another page. Then the conditional tag code used is as below.
  • <b: if cond = 'data: blog.url! = data: blog.homepageUrl'> OBJEK </ b: if>
Look carefully the two examples above only have a difference between == and! =. Where the meaning of == is the same as or approves conditions. Whereas! = Is not the same as or does not approve the conditions. It's not easy enough, to show or hide an element on your blog you only need to know the condition of the tag and use the two comparators above to set conditions or conditions.

How to Apply a Conditional Tag
There are two ways to implement conditional tag code, the first is by applying it directly to a specific target or object, the second is by applying it indirectly by utilizing CSS capabilities.

Application of Conditions Directly
The application of conditional tags directly is very easy, you can simply surround an object or target with a conditional tag, for example as below.
<b: if cond = 'data: blog.url == data: blog.homepageUrl'>
OBJECT
</ b: if>
Meaning:
If the current state of the page is the same as the homepage page URL, then the OBJECT will be displayed or enabled.

Indirect Application of Conditions
The application of conditional tags can be indirectly done by floating it in the CSS code of the target object. To remove the target object, we use the display: none declaration in the CSS section as below.
<b: if cond = 'data: blog.url! = data: blog.homepageUrl'>
<style type = 'text / css'>
# project {display: none}
</ style>
</ b: if>
...
<div id = 'object'> OBJEK </ div>
Meaning:
All elements that have an object ID will be hidden or not displayed if the current page state is not the same as the homepage page URL.

You need to know:
- In the HTML code to call the css code the selector uses the id or class attribute.
- In the CSS code the id is marked with a fence sign or (hastag) while the class is marked with a dot (dot).
Collection of Blogger Conditional Tags
Here are some conditional tag codes that you can use to display or hide a particular object.

Conditional Homepage Page Tag
The homepage is a pure page that has no branches or folders, for example like this.
https://www.elbongultom.com

The conditional tag is like this:
<b: if cond = 'data: blog.url == data: blog.homepageUrl'>
OBJECT CODE
</ b: if>
Item Page Conditional Tag
Item pages are page types that will always end in file names or folders, for example like this.
https://www.elbongultom.com/2018/02/kumpul-tag-conditional-blogger-dan-fungsinya.html
The conditional tag is like this:
<b: if cond = 'data: blog.pageType == & quot; item & quot;'>
OBJECT CODE
</ b: if>
Conditional Tag Archive Page
A special feature on the archive page is the homepage that is followed by the branch URL year, month, and date, but does not arrive at the page file name of the item, the particular feature is that at the end of the URL has an archive.html branch, such as this.
https://www.elbongultom.com/2018_01_01_archive.html

The conditional tag is like this:
<b: if cond = 'data: blog.pageType == & quot; archive & quot;'>
OBJECT CODE
</ b: if>
Static Conditional Page Tag
Static pages are special types of pages from blogger that end in file names and will not be included in the blog archive list, for example like this.
  • https://www.elbongultom.com/p/about.html
The conditional tag is like this:
<b: if cond = 'data: blog.pageType == & quot; static_page & quot;'>
OBJECT CODE
</ b: if>
Conditional Index Page Tag
Index pages are all types of pages that are not item pages.
  • https://www.elbongultom.com
  • https://www.elbongultom.com/p/about.html
  • https://www.elbongultom.com/2018/02/kumpulan-tag-conditional-blogger-dan-fungsinya.html
The conditional tag is like this:
<b: if cond = 'data: blog.pageType == & quot; index & quot;'>
OBJECT CODE
</ b: if>
Label Page Conditional Tag
A label page is a sorting page type of an item or post label, this page starts with a branch or search / label folder / then ends with a label name, for example like this.
  • https://www.elbongultom.com/search/label/Blogger
The conditional tag is like this:
<b: if cond = 'data: blog.searchLabel'>
OBJECT CODE
</ b: if>
Conditional Tags for Certain Label Pages
It's the same as the label page, it's just that it's more specific to certain label names, for example like this.
  • https://www.elbongultom.com/search/label/Blogger
The conditional tag is like this:
<b: if cond = 'data: blog.searchLabel == & quot; Blogger & quot;'>
OBJECT CODE
</ b: if>
Search Page Conditional Tag
The search page is a type of search or search results page on your blog, the search page starts with search /? Q = and ends with a search keyword, for example like this.
  • https://www.elbongultom.com/search/?q=Blogger
The conditional tag is like this:
<b: if cond = 'data: blog.searchQuery'>
OBJECT CODE
</ b: if>
Conditional Tags for Certain Search Pages
Just like a search page, only Saha is more specific to certain search keywords, for example like this.
  • https://www.elbongultom.com/search/?q=Blogger
The conditional tag is like this:
<b: if cond = 'data: blog.searchQuery == & quot; Blogger & quot;'>
OBJECT CODE
</ b: if>
Specific Page Specific Tags (Custom)
You can distinguish between certain pages and pages in general on your blog by using conditional tags.

The conditional tag is like this:
<b: if cond = 'data: blog.url == & quot; PAGE URL & quot;'>
OBJECT CODE
</ b: if>
Error Page Conditional Tag (Error Page)
The error page or error page is a page that is not found on your blog, this page is marked with an error code 404 not found. This page is caused by writing a wrong URL or it could be caused by an item or post that you made has been deleted.

The conditional tag is like this:
<b: if cond = 'data: blog.pageType == & quot; error_page & quot;'>
OBJECT CODE
</ b: if>
That is a collection of blogger conditional tags and their functions, the conditional tag code above you can customize to your needs, if you have questions or enter please contact us through the contact page or by commenting below.