>--> Blogger テンプレートのウィジェットタグに新しい表現方法が登場 | クリボウの Blogger Tips

クリボウの Blogger Tips

Google Blogger の使い方、カスタマイズ方法、各種ツールなど、
Blogger 関連の役立つ情報を紹介しています。

> | > Blogger テンプレートのウィジェットタグに新しい表現方法が登場

Blogger テンプレートのウィジェットタグに新しい表現方法が登場



Blogger のテンプレートには、ウィジェットタグという、一定の条件ごとに出力する HTML コードを変化させるための特別なタグが存在します。今回、このウィジェットタグに新しい表現方法が加わったと、Blogger Buzz が伝えています。

これまで、ウィジェットタグの中では

  • + で値を連結したり
  • - で値を差し引いたり
  • ==!= で値が等しいか等しくないかをチェックしたり
  • <><=>= で値を比較したり
といったことができたんですが、今回それらに加えて、次のような演算子や表現が使えるようになりました。


NOT 演算子

!not を使って、「何かが true(真)ではないとき」という条件を表現する。

<b:if cond='!data:post.allowComments'>...
(コメントが可能でなければ…)

これまでは、<b:else/> を使って表現していたヤツですね。


三項演算子

  • ?: を使った三項演算子。? の前の条件が true(真)の場合は : の前のもの、false(偽)の場合は : の後ろのものを表示します。

    <a expr:class='data:post.allowComments ? "comments" : "no-comments"' ...
    (コメント可能な場合、a 要素の class 属性に comments を指定し、不可能な場合は no-comments を指定する。)

    これまた、<b:if cond='...'><b:else/> を組み合わせて、表現していたものです。


    メンバシップ演算子

    これは、ある値が集合の要素の 1 つであるかどうかをチェックするためのもの。incontains とが使えます。

    <b:if cond='data:blog.pageType in {"index", "archive"}'>...
    (ページタイプがトップページかアーカイブページのときに…)

    <b:if cond='{"item", "static_page"} contains data:blog.pageType'>
    (ページタイプが個別ページか静的ページのときに…)

    incontains で、チェック対象の値と集合(もしくは配列)の記述順が逆になるので要注意。とはいえ、複数の <b:if cond='...'> を併記する必要がないのは、便利です。


    AND 演算子

    and&& を使って、複数の条件をともに満たす場合について、記述可能に。

    <b:if cond='data:blog.pageType == "index" and data:post.allowComments'>...
    (ページタイプがトップページで、かつコメント可能なとき…)

    以前は、<b:if cond='...'> をネスト(入れ子に)して実現していたもの。


    OR 演算子

    or|| を使って、複数の条件のうち、1 つでも満たす場合について、記述可能に。

    <b:if cond='data:blog.pageType == "index" or data:post.allowComments'>...
    (ページタイプがトップページか、またはコメント可能なとき…)

    incontains と同様、これからは <b:if cond='...'> を何回も書かなくて済みます。


    括弧

    ( ) を使って、演算の順序を指定する。

    <div expr:style='"max-width: " + (data:width + 10) + "px;"'>...
    (div 要素 style 属性の最大幅に、現在の横幅プラス 10 ピクセルした値を指定する。)


    これらの新しい演算子や表現を使うと、これまで Blogger テンプレートで条件分岐を記述していた、煩雑な作業が随分と楽になりそうですね。本格的に Blogger テンプレートをいじってみたい!という人は、ぜひ参考にしてください。


    参考:


    スポンサードリンク:
    お願い:
    「この記事役に立った!」と思ったら、ぜひフィード登録をお願いします。 
  • Comments:30

    1. راه بند نیست راهبند است. ارائه قیمت راهبند پارکینگ به صورت آنلاین امکانپذیر نیست بی اف تی برند مشهوری در ساخت راهبده آتلیه یک واژه فرانسوی به معنی کارگاه هنری است . همه آتلیه های عروس ، کودک ، مدلینگ تهران و شهرستان ها را در بانک اطلاعاتی آتلیه عکاسی ما ببینید و انتخاب کنید . ما تو تهران پارس ، من و شوهرم که خیلی راضی بودیم .

      ReplyDelete
    2. that`s great news

      ReplyDelete
    3. https://flipkart-creditcard-offers.blogspot.in/
      https://flipkart-cashback-offers-today.blogspot.in
      https://flipkartdealofthedayindia.blogspot.com/
      https://cash-back-coupons.blogspot.in
      https://flipkart-creditcard-offers.blogspot.in
      https://amazon-cash-backoffers.blogspot.in/
      https://cashbackofferin.blogspot.com/
      https://travel-coupons-offers.blogspot.in
      https://cash-backoffer.blogspot.com/
      https://flipkartcasbackoffers.blogspot.com/

      ReplyDelete
    4. Wonderful site and huge information. The information present here is helpful for the readers I'll come back to this blog for sure!



      Flipkart CashBack Offers-SBI, HDFC, ICICI, Citibank Cards&Flipkart HDFC Cards Offers"
      flipkart bank offers,flipkart cash back coupons,flipkart offers 2018,
      flipkart coupons 2018,flipkart cashback offers 2018,flipkart cashback offers,
      flipkart cash back offers,flipkart cashback coupons,
      flipkart cashback,Flipkart Cashback Offers,Flipkart Bank Offers,Flipkart Deals 2018,
      flipkart upcoming offers on mobiles,
      hdfc credit card offers on flipkart 2018 flipkart sbi offer big billion day,
      flipkart hdfc offer,
      flipkart hdfc offer august 2018 sbi flipkart offer 2018 flipkart icici offer



      FLIPKART CITIBANK OFFER,FLIPKART ICICI OFFER,
      SBI CARD OFFERS ON FLIPKART,
      FLIPKART CASHBACK OFFER TODAY,FLIPKART CREDIT CARD OFFERS,
      ALL BANK CREDIT CARD OFFERS,HDFC CREDIT CARD OFFERS ON FLIPKART,
      AXIS BANK CREDIT CARD OFFERS ON FLIPKART,
      CITIBANK CREDIT CARD OFFERS ON FLIPKART,SBI FLIPKART OFFER



      Flipkart Cashback Offers||Flipkart Bank Offers||Flipkart Deals 2018||flipkart upcoming offers,"
      "Flipkart Cashback Offers || Flipkart Bank Offers || Flipkart Deals 2018 ||"
      "flipkart upcoming offers on mobiles, hdfc credit card offers on flipkart 2018,
      sbi credit card offers on flipkart today, flipkart hdfc offer terms and conditions,
      sbi flipkart offer 2018,
      flipkart cashback phonepe, flipkart hdfc offer august 2018, flipkart icici offer




      "cashback,vouchers,coupons,discounts,offers,deals,promo codes,&Cashback Offers"
      "cash back coupons "Coupons, Discounts & Offers on 1500+ Shopping Sites in India.
      Get Extra Cashback Everytime You Shop Online using Coupons of Amazon, Flipkart,
      Tata CLiQ, Nykaa etc."cashback, vouchers, coupons, discounts, offers, deals,
      promo codes,Coupons, Promo Codes & Cashback Offers



      Offersable - Cash Back Offers | Discount Coupons | Bank Offers | Promo Codes.
      Find best Discount Coupons, Cashback Offers, Hot Deals Bank Offers for
      all major e-commerce stores in the India



      Amazon cashback offers 2018Cashback Deals with sbi,hdfc,icici,axis banks,
      credit&debit card,
      Amazon Cashback Offers 2018 Upto 65% Cashback Deals, AMAZON CASHBACK OFFERS 2018,
      DISCOUNT COUPON OFFERS 2018, Amazon cashback offers with sbi hdfc icici axis banks credit&debit card offers more. amazon cashback offers2018,amazon india cashback,amazon offers on mobiles,
      amazon cashback2018,amazon offers 2018



      flipkart sbi offers, Flipkart Sbi Offer, SBI offers on Flipkart, Sbi offers in Flipkart, Sbi offer flipkart, Sbi discounts flipkart, FLipkart sbi discounts

      MyDealsAndCoupons,flipkart cashback offers,cashbackcoupons,flipkartcashbackoffers,cashbackoffer,cashbackofferscoupons,flipkarthdfcoffer,latestcashbackoffers,flipkartcreditcardoffers,dealsncashbackcashbackoffers

      ReplyDelete



    5. Rahul shivkant the universal post rahul shivkant rahul shivkant the universal post teams
      India's only Digital News Channel with True Voice of India.
      Finding #Championsofchange2018 #rahulshivkant
      the universal post teams
      the universal post youtube
      loksabha election 2018
      top trending news
      top viral news
      best trending news in india


      ReplyDelete
    6. Taruhan Gratis melalui Dealer Kiu-Kiu Online Zlatoust Situs www.pokerrusia.org Melalui BPD Kalsel Syariah Kode Bank 122.

      ReplyDelete
    7. Detail information about the Blogger templates have special tags called widget tags is really a relevant information. Hope that this will be useful for those who have interest in this field. Thanks for this post.

      Web Reference : Best Essay Writing Service

      ReplyDelete
    8. Great insights. I look forward to reading what you're planning on next, because your post is a nice read.
      Lisa-Storie Avenatti

      ReplyDelete
    9. Hey ....thank you this is the great site...you can check all India Govt & Private Jobs updates...........check all University Time Table....
      TMBU Time Tale 2020
      Kota University Time Table 2020
      MDSU Time Table 2020
      MGSU Time Table 2020
      MLSU Time Table 2020

      ReplyDelete
    10. کسب و کار خودتون رو با طراحی اپلیکیشن ارتقا بدید . الو اپلیکیشن با بیش از 6 سال سابقه در این حوزه آماده همکاری با شماست
      منبع: طراحی اپلیکیشن

      ReplyDelete
    11. It's really nice and meaningful. It's really cool blog. Linking is very useful thing. you have really helped lots of people who visit this blog and provide them useful information. Thanks for sharing and please update some more information here.Get best SEO Services Dubai from adwebstudio

      ReplyDelete
    12. Get Assignment Help Scotland, Essay Writing Services, Dissertation Help, Thesis Help in Scotland at Affordable Prices. Our Writers Providing Plagiarism-free Academic Paper Writing Services.For more services : Science Assignment Help | Geography Assignment Help | Academic Help

      ReplyDelete
    13. It's fantastic that you are getting ideas from this post as well as from our discussion made here.
      Augurs Germany

      ReplyDelete
    14. wow this is fantastic artical i am a fan of you instargram bio for boys attitude

      ReplyDelete

    Comments on Google+:

    © 2005-2014 Kuribo. Powered by Blogger.