ব্লগার কন্ডিশনাল ট্যাগস

একটি মন্তব্য পোস্ট করুন

 পাতার ধরণ অনুযায়ী কন্ডিশনাল ট্যাগস

ডিভাইস

  • <b:if cond='data:mobile'>মোবাইল সাইটের জন্য</b:if>
  • <b:if cond!='data:mobile'>ডেস্কটপ সাইটের জন্য</b:if>

হোমপেজ

  • <b:if cond='data:view.isHomepage'>...........</b:if>
  • <b:if cond='data:blog.url == data:blog.homepageUrl'>.................</b:if>

ইনডেক্স/আর্কাইভ/লেবেল সার্চ

  • <b:if cond='data:view.isMultipleItems'>
  • <b:if cond='data:blog.pageType == "index"'>ইনডেক্স মানে হোমপেজ, লেবেল, সার্চ ও আর্কাইভ পেজের জন্য
  • <b:if cond='data:blog.pageType == "archive"'>আর্কাইভ ও লেবেল পেজের জন্য
  • <b:if cond='data:blog.url == data:post.url'>পোস্ট ও স্ট্যাটিক উভয় ধরণের পেজের জন্য

আইটেম/পোস্ট-- পোস্ট পেজের জন্য

  • <b:if cond='data:view.isSingleItem'>
  • <b:if cond='data:view.isPost'> 
  • <b:if cond='data:blog.pageType == "item"'>
  • নির্দিষ্ট কোন পোস্টের জন্য <b:if cond='data:blog.url == data:blog.canonicalHomepageUrl + "2014/08/foo.html"'> 

পেজ/স্ট্যাটিক পেজ/Static page

  • <b:if cond='data:view.isPage'>
  • <b:if cond='data:blog.pageType == "static_page"'> স্ট্যাটিক পেজের জন্য

লেবেল সার্চ

  • <b:if cond='data:view.isLabelSearch'>
  • <b:if cond='data:blog.searchLabel'>লেবেল সার্চ পাতা</b:if>
  • <b:if cond='data:view.isLabelSearch == "খ"'>
  • <b:if cond='data:blog.searchLabel == "খ"'>........</b:if>

Search Result Page (ex: /search?q=blogger)

  • <b:if cond='data:view.isSearch'>........</b:if>
  • <b:if cond='data:blog.searchQuery'>......</b:if>
  • <b:if cond='data:blog.searchQuery == "অগ্নিশর্মা"'>
  • <b:if cond='data:view.isSearch and !data:view.isLabelSearch'> … </b:if>

  • <b:if cond='data:blog.pageType == "ERROR_PAGE"'>এরর ৪০৪ পেজের জন্য
  • <b:if cond='data:blog.canonicalUrl == "/p/ক.html"'/>নির্দিষ্ট করে কোন পেজের জন্য, এখানে ক পাতার জন্য
    • বিকল্প: <b:if cond='data:blog.url == data:blog.canonicalHomepageUrl + "p/ক.html"'>

7. 404 Error Page

<b:if cond='data:view.isError'>
  <!-- The conditional Element To Execute -->
</b:if> 
Old version:
<b:if cond='data:blog.pageType == "error_page"'>
  <!-- The conditional Element To Execute -->
</b:if> 

8. Archive Page

<b:if cond='data:view.isArchive'> 
 <!-- The conditional Element To Execute -->
</b:if> 
Old version:
<b:if cond='data:blog.pageType == "archive"'> 
 <!-- The conditional Element To Execute -->
</b:if> 

9. Mobile Device

<b:if cond="data:blog.isMobile">
<!-- The conditional Element To Execute -->
</b:if> 

10. For multi posts per page, apply for first post

<b:if cond='data:post.isFirstPost'>
 <!-- The conditional Element To Execute -->
</b:if> 

11. Static Page and Item

<b:if cond='data:view.isSingleItem'>
<!-- The conditional Element To Execute -->
</b:if> 
Old version:
<b:if cond='data:blog.url == data:post.url'>
<!-- The conditional Element To Execute -->
</b:if> 

12. Condition for Thumbnail

<b:if cond='data:post.thumbnailUrl'>
  <!-- The conditional Element To Execute -->
</b:if> 

13. Condition for Author

<b:if cond='data:displayname == "author-name"'> 
<!-- The conditional Element To Execute -->
</b:if> 

14. Condition for total of comments

<b:if cond='data:post.numComments == number'>
 <!-- The conditional Element To Execute -->
</b:if> 

15. Preview Page

<b:if cond='data:view.isPreview'> 
… 
</b:if>

16. Condition for last Label

<b:loop values='data:post.labels' var='label'>
    <b:if cond='data:label.isLast != &quot;true&quot;'>
 <!-- Add special character after If it is not last label -->
       ,
    </b:if>   
</b:loop> 

Part 2. Applying Conditional Tags

1. Comparing operators

There are conditions that using double equals (comparing method), and just direct statement. The double equals == means TRUE for non-numeric statement, and equal to for an integer (numeric). Numeral The == operator can be replaced by:
  • != other than that integer.
  • < less than.
  • > greater than.
  • <= less than or equal to.
  • >= greater than or equal to.
Note: We need to escape the less than (<) and the greater than (>) marks. less than (<) is &lt; greater than (>) is &gt;
Example for escaping greater than operator
From this:
<b:if cond='data:post.numComments > 1'>...content...</b:if>
in to this:
<b:if cond='data:post.numComments &gt; 1'>...content...</b:if>
* Reverse Conditional Tags
We have two options for the operator:
== TRUE
!= FALSE

2. Applying Multiple Conditional Tags

By putting <b:else> tag, you can add multiple condition. It means that if first condition not work then execute second condition to all of pages. See example below 
<b:if cond='data:blog.pageType == "item"'> 
           Content-1 EXECUTE IF TRUE 
<b:else/>
           Content-2 EXECUTE IF FALSE 
</b:if> 
Above example means that execute content-1 in post page. If it's not post page then execute content-2.

3. Using IN, OR, AND, NOT Logic Operators

<b:if cond='data:blog.pageType in {"static_page","item"}'>
CONTENT
</b:if> 
<b:if cond='data:blog.pageType not in {"static_page","item"}'>
CONTENT
</b:if> 
<b:if cond='data:view.isPage and data:view.isPost'>
CONTENT
</b:if> 
<b:if cond='data:view.isPage or data:view.isPost'>
CONTENT
</b:if> 

Part 3. More 

When you edit your theme, maybe  will be replace by quot;. Example
from this
<b:if cond='data:blog.pageType == "static_page"'> 
into this
<b:if cond='data:blog.pageType == quot;static_pagequot;'> 

নবীনতম পূর্বতন

Related Posts

There is no other posts in this category.

একটি মন্তব্য পোস্ট করুন

Subscribe Our Newsletter