List of Blogger Conditional Tags - MR Laboratory

List of Blogger Conditional Tags

    List of Blogger Conditional Tags

    Hello everyone. Today we will learn, conditional tags of Blogger templates. That means you can condition on any one page. Those programmers understand better about conditional tags. In Blogger, if you can put code on a specific page, it means you will only show on that page and not on any other page. Then you have to use the conditional tag. If you've ever seen this HTML code in a Blogger template, you'll find that there are a lot of conditional tags out there. If you ever want to be a blogger template developer then you must know about this conditional tag. Below I have put the name and conditional tag on the page, you can use it if you want. Conditional tags include the start and end tags.......

    List of Conditional tags for page types

    Archive page

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

    <!--archive_Page-->

    </b:if>

    Error Page (404)

    <b:if cond='data:blog.pageType == "error_page"'>

    <!-- all error pages-->

    </b:if>

    Index Page

    <b:if cond='data:blog.pageType == "index"'>

    <!-- all index pages -->

    </b:if>

    Homepage

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

    <!-- only homepage -->

    </b:if>

    Item (post) pages

    <b:if cond='data:blog.pageType == "item"'>

    <!-- all item pages -->

    </b:if>

    Specific Post by URL

    <b:if cond='data:blog.url == data:blog.canonicalHomepageUrl + "2014/08/foo.html"'> 

    <!-- a item page from august 2014 with post-title 'foo'-->

    </b:if>

    Label page

    <b:if cond='data:blog.searchLabel'>

    <!-- all label pages -->

    </b:if>

    Specific Label Page

    <b:if cond='data:blog.searchLabel == "foo"'>

    <!-- for label 'foo' -->

    </b:if>

    Search page

    <b:if cond='data:blog.searchQuery'>

    <!-- all search pages -->

    </b:if>

    The specific Search Query page

    <b:if cond='data:blog.searchQuery == "foo"'>

    <!-- for query 'foo' -->

    </b:if>

    Static page

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

    <!-- all static pages -->

    </b:if>

    Specific Static page by URL

    <b:if cond='data:blog.url == data:blog.canonicalHomepageUrl + "p/foo.html"'> 

    <!-- a specific static page with name 'foo' -->

    </b:if>

    AND/OR/NOT
    AND


    <b:if cond='data:blog.pageType == "index"'>

      <b:if cond='data:blog.searchQuery'>

        <!--search_page AND index_page-->

      </b:if>

    </b:if>

    OR


    <b:if cond='data:blog.url == data:blog.canonicalHomepageUrl + "p/foo.html"'> 

      <!-- static_site foo OR static_site bar -->

          <b:else/>

    <b:if cond='data:blog.url == data:blog.canonicalHomepageUrl + "p/bar.htm"'> 

      <!-- static_site foo OR static_site bar -->

       </b:if>

    </b:if>

    NOT


    <b:if cond='data:blog.pageType != "item"'>

      <!-- all pages except item pages -->

    </b:if>

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

      <!-- all pages but NOT homepage -->

    </b:if>

    How to Use conditional tags

    To apply a conditional tag to some content, simply put the content inside the opening <b:if cond…> and the closing </b:if> like:

    <b:if cond='data:blog.pageType == "item"'>

        # THIS CONTENT WILL BE EXECUTED IF CONDITION IS TRUE

    </b:if>

    In the example above, the content will only appear on post pages.

    The content can be a div, a section, a style tag or another conditional tag, etc.

    If you want to specify an alternate content (when the condition is false), you need to insert a <b: else/> tag followed by the content, like this:

    <b:if cond='data:blog.pageType == "item"'>

        # THIS CONTENT WILL BE EXECUTED IF CONDITION IS TRUE

        # i.e. if current page is post (item) page

    <b:else/>

        # THIS CONTENT WILL BE EXECUTED IF CONDITION IS FALSE

        # i.e. if not post page

    </b:if>

    The <b:else/> also works like an OR operator as explained above.


    conditional formatting,conditional tags,conditional formatting in excel,application of conditional formatting in business,zero conditional,if conditional,vue conditional style,conditional rendering,conditional content,conditional (programming),conditional sentences type 1,conditional sentences type 2,conditional sentences type 3,conditional sentences type 0,conditional sentences,conditional formatting excel,what is conditional formatting, blogger template,blogger template development,blogger,learn blogger template development,blogger template development tutorial,blogger templates,blogger template design tutorial,blogger theme development,blogger theme development tutorial,blogger template design,blogger template design tutorial 2020,blogger template from scratch,develop blogger template,blogger template developer guide,premium blogger template,blogger template design tutorial hindi,template, 

    Copyright © MR Laboratory
    Newer post Older post

    RELATED ARTICLES