The Latest Blogger Conditional Tags And Their Functions By Invesroc

What are Conditional Tags?. Conditional tags or commonly called Conditional tags are an HTML programming language that gives commands to load or display widgets, CSS, JS or HTML in accordance with the commands in the conditional tags.

Conditional tags make it easy for HTML to load certain files in it. For example, if we want to display a widget only on static pages, the widget will not automatically appear on other pages other than the static page. So in other words, conditional tags are commands that allow and disallow files in HTML to appear.

Conditional tags in HTML when discussed in everyday language can be interpreted as the word " If ". Examples of its application for example<b:if cond='data:view.isHomepage'>,then we can interpret this conditional tag more or less like this, " if the visible data is on the main page ".

For more details, let's review more about some important conditional tags in blogger, their implementation, function and the impact after installing these tag conditions.


The Latest Conditional Tags, Their Functions and Uses

Below are the latest conditional tags that you can apply to your blog if you want to replace the old conditional tags in your template. The new version's conditional tags are simpler. Looks more shortened than the previous conditional tag.


1. Homepage Conditional Tag (Main Page)
Displays CSS, Widget, Js etc data only on the Main page
Example: https://invesroc.blogspot.com/
New version
<b:if cond='data:view.isHomepage'> 
Old Version
<b:if cond='data:blog.url == data:blog.homepageUrl'>

2. Conditional Tag Index Page
Displays widgets, css, html, js only on the index page. Some examples of index pages that are easy to find are the homepage, label page, archive page, and search query page.
New version
<b:if cond='data:view.isMultipleItems'> 
Old Version
<b:if cond='data:blog.pageType == "index"'>

3. Item Page Conditional Tag
Displays widget,css,html,js only on item page, Item page is a page type that will always end in a file name, like this:

its use; refers to the item page type, can be changed to static_page, index, etc.
New Version
<b:if cond='data:view.isSingleItem'> 
Old Version
<b:if cond='data:blog.pageType in ["item", "static_page"]'>

4. Post Page Conditional Tag
Displays widgets, css, html, js only on the posting page
Example: https://invesroc.blogspot.com/
New version
<b:if cond='data:view.isPost'> 
Old Version
<b:if cond='data:blog.pageType == "item"'>

5. Static Page Conditional Tag (Page)
Displays widgets, css, html, js only on static pages only. For general use, static pages are often used to create about pages, privacy policies, terms of service, and so on.
Example: https://invesroc.blogspot.com/p/sitemap.html
New version
<b:if cond='data:view.isPage'> 
Old Version
<b:if cond='data:blog.pageType == "static_page"'>

6. Conditional Tag Label Page
Displays widgets, css, html, js only on the label page,
Example: https://invesroc.blogspot.com/search/label/
New version
<b:if cond='data:view.isLabelSearch'> 
Old Version
<b:if cond='data:blog.searchLabel'>

7. Pages with specific labels

Only shows certain types of labels according to the conditional tags command.
New version
<b:if cond='data:view.search.label == "A-Label"'></b:if> 
Old Version
<b:if cond='data:blog.searchLabel == "A-Label"'></b:if>

8. Conditional Tag Search Page
Displays widgets, css, html, js only on the label page,
Example: https://dewalokis.com/search?q=dewalokis-results=8
New version
<!-- Includes search page labels -->
<b:if cond='data:view.isSearch'>
<!-- Search pages only -->
<b:if cond='data:view.isSearch and !data :view.isLabelSearch'> 
Old Version
<b:if cond='data:blog.searchQuery'>

9. Conditional Tag Archive Page
Displays widgets, css, html, js only on Archive pages
New Version
<b:if cond='data:view.isArchive'> 
Old Version
<b:if cond='data:blog.pageType == "archive"'>

10. Conditional Tag 404 Error Page (Page Not Found)
Displays widgets, css, html, js only on error pages, or usually if a particular page request does not meet it will go directly to the
New Version error page
<b:if cond='data:view.isError'> 
Old Version
<b:if cond='data:blog.pageType == "error_page"'>


11. Conditional Tags Preview Pages (Preview)
Displays widgets, css, html, js only on the preview page, it's no stranger if you often write in the blogger editor with a preview page.
New version
<b:if cond='data:view.isPreview'> 
Old Version
<!-- None yet -->


Out-of-Condition Conditional Tags (Exceptions)


Conditional Tags previously functioned to put element code (HTML, CSS, JS, Widgets etc.) in a condition. In order for tags to be outside of a condition, it is enough to change the code== Becomes != Example:
<b:if cond='data:blog.pageType != "index"'></b:if> 
Index pages are the homepage, search, label and archive pages. So with the tag above, it will be outside the index page. So pages like posts and static pages will appear.

For the latest version, you can use the code! or notewhose code is placed at the front. Example:
<b:if cond='!data:view.isMultipleItems'></b:if> 
OR
<b:if cond='not data:view.isMultipleItems'></b:if>


Combine Conditional Tags - Multi Tags

How to combine 2 tags at once, but the function remains the same. Here's an example:
<b:if cond='data:blog.pageType != "item" or data:blog.pageType != "static_page"'></b:if> 
The tag above means that it will appear on pages outside of items and static_page. The meaning oforis if one of them is true then the condition will be displayed. If you have to under certain conditions then useand.

To concatenate multiple page urls on a specific page tag or for multiple urls:
<b:if cond='data:view.url in {"Page A","Page B","Next page url"}'></b:if>
Notice there is a comma(,). On the other hand can useand,which means if the use of both or more conditions is true it will be displayed. If one is not correct then it will not be displayed.


If not correct show another <b:else>

If displaying differently on different pages do not have to use two conditional tags.
How
<b:if cond='data:blog.pageType == "item"'> 1 <b:else/> 2 </b:if>
will be on the posting page. But if the page is not posted, it will use 2. So the <b:else/> function is for exceptions from the code above.


Tags  <b:else /> that are always placed along with  <b:if>. <b:else> can be interpreted as commands "and also" or "could also". So an example of its implementation could be like this:
<b:if cond='data:view.isHomepage'>  
[...content1...]  
<b:else />  
[...content2...]
</b:if>
Maybe the picture above can give you a little idea about how to place the conditional tags and tag b:else along with their functions.


Conditional Tags for Mobile Pages Or /?m=1

Display CSS, JSS, Special for the mobile version
Example: https://invesroc.blogspot.com/?m=1
New Version
<b:if cond='data:mobile'>
Old Version
<b:if cond='data:blog.isMobileRequest'></b:if>
I added a tag to set the mobile display. What makes the difference between the display on a computer and a smartphone.


Conditional tags with the second version or the latest version, the calling process will be faster even though it looks the same (not felt). In version one that uses==There are 2 processes, namely calling data and comparing data. Whereas in the second (latest) version it only calls. In this blog using the most recent and by minimizing the process as little as possible.


Actually there are some other conditional tags. However, this includes the basics of using conditional tags that are commonly used in blog templates and are HTML5 valid.

Thus a brief review of the latest conditional tags along with their functions and applications on blogs. Hopefully it can be applied properly

Source:
  • https://www.dte.web.id/2017/09/tag-conditional-page-blogger-2017.html
  • https://www.mankoin.com/2017/01/tag-konditional-cara-use.html

Related Posts

Post a Comment