Template ini gratis jika anda ingin mendapatkannya unduh disini Download Now!

Kumpulan Conditional Tag Bersyarat Blogger











Conditional Tag Bersyarat Blogger
Conditional Tag Bersyarat Blogger


Conditional Tag atau Tag Bersyarat


Apa itu tag bersyarat dan untuk apa itu?

Suatu tag yang biasanya digunakan untuk membatasi fungsi daripada perintah atau bagian yang ada didalamnya sehingga hanya bekerja pada kondisi tertentu saja.
Tag bersyarat di blogspot sangat membantu Anda mengoptimalkan seo blogspot.



Sintaks tag bersyarat


Tag bersyarat Blogger memiliki sintaks berikut:

<b:if cond='condition'> </b:if>


"cond" adalah singkatan dari Condition yang berarti kondisi, dan properti ini akan mendapatkan nilai kondisi yang ditetapkan.

Cara menggunakan tag bersyarat


Ini sangat sederhana, Anda hanya perlu menerapkan sintaks di atas dan menambahkan konten tambahan pada tag penutup </b:if> , gumumnya antara tag pembuka <b:if> dan tag penutup </b:if> dan masukkan langsung ke Template Anda.

Kumpulan Tag Bersyarat


Berikut adalah beberapa tag bersyarat untuk blogspot versi baru dan lama.

0. Tag kondisi untuk Mode Tata Letak



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


Tag ini berlaku untuk menulis CSS untuk tata letak

1. Tag bersyarat halaman beranda (Beranda)



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

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


2. Tag kondisi halaman indeks (Termasuk : /search, /search/label, /search?q=, MultipleItems...)



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

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


3. Tag bersyarat untuk Posting dan Halaman (Page and Post)



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

Old: <b:if cond='data:blog.pageType in ["item", "static_page"]'> … </b:if>


4. Tag bersyarat untuk posting (Post)



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


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



5. Tag bersyarat untuk halaman statis (Halaman)



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


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


6. Tag bersyarat untuk Label Penelusuran halaman . page



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


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


7. Tag bersyarat untuk Halaman Arsip



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


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


8. Tag bersyarat untuk Halaman Pencarian



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


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


9. Tag bersyarat untuk halaman error (Error 404)



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


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


10. Tag bersyarat untuk halaman pratinjau



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


11. Kondisikan kartu untuk ponsel




New: <b:if cond='data:blog.isMobileRequest'>...</b:if>


Old: <b:if cond='data:blog.isMobile == "true" '>...< /b:if>



12. Jika ada tag bersyarat untuk seluler dan desktop



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

Mobile-only content

<b:else />

Desktop-only content

</b:if>


13. Terapkan untuk 1 label tunggal



<b:if cond='data:view.isLabelSearch == "blogger"'>

Konten hanya ditampilkan saat mencari label nama blogger

</b:if>


14. Terapkan ke semua posting dengan label blogger (put in loop)



<b:if cond='data:post.labels any (l => l.name == "blogger")'>

Untuk label bernama Blogspot

</b:if>


15. Tag bersyarat tidak digunakan untuk halaman label pencarian



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



16. Tag bersyarat bukan untuk beranda



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

Or

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


17. Tag bersyarat untuk 1 tautan tunggal, dapat dipesan sendiri



<b:if cond='data:blog.url == "Unique Link"'> … </b:if>


18. Tag bersyarat untuk 1 label



<b:if cond='data:view.search.label in ["blog", "templalte", "giodienblognet"]'>

Content displayed for the above labels

</b:if>


19. Tag bersyarat tidak digunakan dalam label



<b:if cond='data:view.search.label not in ["blog", "templalte", "giodienblognet"]'>

Content displayed for the above labels

</b:if>



20. Gabungan if else conditional tag untuk labelh3>

<b:if cond='data:view.search.label in ["template", "blog", "adsense"]'>

For labels named

<b:elseif cond='data:view.search.label not in ["theme", "css"]' />

For label without name

<b:else />

Remaining default

</b:if>


21. Tag bersyarat if else lainnya untuk label



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

Content to display when search label blog

<b:elseif cond='data:blog.searchLabel == "thuat-blog"' />

Content displayed for when searching label thu-thuat-blog

<b:else />

Default remains

</b:if>


22. Tag bersyarat untuk penulis tertentu



<b:if cond='data:displayname == "author-name"'>

Display content is only for author 'author-name'

</b:if>


23. Tag istilah pencarian untuk kata kunci tertentu



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

Konten untuk ditampilkan saat mencari kata kunci blogger

</b:if>


24. Menggunakan NOT



<b:if cond='not data:view.isPage'> Not for Page </b:if> <

b:if cond='not data:view.isHomepage'> Not for home page </b:if >

<b:if cond='not data:view.isPost'> Not for posts </b:if>


Same applies to all other tags

25. Gunakan yang lain != (FALSE)




<b:if cond='!data:view.isPage'> Not for Page </b:if> <b:if

cond='!data:view.isHomepage'> Not for home page </b:if >

<b:if cond='!data:view.isPost'> Not for posts </b:if>


Same applies to all other tags

26. Tag bersyarat untuk tautan posting baru dan lama



<b:if cond='data:post.hasOlderLinks'> Old Post </b:if>

<b:if cond='data:post.hasNewerLinks'> New Post </b:if>


27.Jumlah komentar



<b:if cond='data:post.numberOfComments > 0'> Comment Number > 0 </b:if>

<b:if cond='data:post.numberOfComments < 1'> Number of Comments < 1 </b:if>


28. Jika ada komentar



<b:if cond='data:this.messages.blogComment != "&"'>If comments</b:if>


29. Kartu syarat untuk Adsense



<b:if cond='data:post.includeAd'>...</b:if>


30. Tag kondisi tanggal posting



<b:if cond='data:post.dateHeader'>...</b:if>


31. Tag kondisi tanggal posting



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


Dan masih banyak conditional tag bersyarat blogger lainnya di dalam template.

Beberapa operator untuk digunakan dengan tag bersyarat blogspot

== equals, TRUE

> greater than, applies to numbers

< less than, applies to numbers

!= else, FALSE

>= greater than or equals, applies to numbers

<= less than or equals, applies to numbers


NOT covered determined




Some more tags you may not know


Apply to all posts with label blogspot

<b:if cond='data:posts all (p => p.labels any (l => l.name == "blogspot"))'> </b:

if>

Does not apply to posts labeled blogspot

<b:if cond='data:posts none (p => p.labels any (l => l.name == "blogspot"))'> </b:

if>

If the blog title contains the word assignment, same goes for the page, for the post.

<b:if cond='data:blog.title contains "delivered"'> </b:if>

Conditions for post count greater than 5 posts

<b:if cond='data:posts.size gt 5'> </b:if>

Condition for post count less than 5

<b:if cond='data:posts.size lt 5'> </b:if>

Condition for post count is equal to 5

<b:if cond='data:posts.size eq 5'> </b:if>

Conditions apply to all posts with the label

<b:if cond='data:posts all (p => p.labels.any)'> </b:if>

Condition when searching for one of the keywords inside it

<b:if cond='data:view.search.query in ["blogspot", "blogger", "blog"]'> </b:if>

Applies to page /search not search/label

<b:if cond='data:view.isSearch and not data:view.isLabelSearch'> </b:if>

When viewing post or page details

Apply to posts with id = 123456789

<b:if cond='data:view.postId == 123456789'> </b:if>

Apply to page with id = 123456789

<b:if cond='data:view.pageId == 123456789'> </b:if>

Apply to multiple posts with id

<b:if cond='data:view.postId in [11111,22222,33333]'> </b:if>

Apply to multiple pages with id

<b:if cond='data:view.pageId in [11111,22222,33333]'> </b:if>

Apply to widget FEATUREPOST / POPULARPOSTS / BLOG isMultipleItems

Apply to widget with post id 123456

<b:if cond='data:post.id == 123456'> </b:if>

Apply to the widget with the post id below

<b:if cond='data:post.id in [11111,22222,33333]'> </b:if>

Does not apply to posts with id below

<b:if cond='[111111] not contains data:post.id'> </b:if>

Archives

Apply to archives whose year is 2020

<b:if cond='data:view.search.archive.year == 2020'> </b:if>

Applies to archives with a month of 06

<b:if cond='data:view.search.archive.month == 06'> </b:if>

Posting Komentar

tesssssssss
tesssssssss
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.