>--> コンディショナルタグとスタイルシート | クリボウの Blogger Tips

クリボウの Blogger Tips

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

> コンディショナルタグとスタイルシート

コンディショナルタグとスタイルシート

Posted at: 2005-07-28 16

メインページ、記事単独ページ、アーカイブページといったページの種類によって、書き出される HTML を変えるテンプレートタグのことを以前の記事ではページ切替タグと呼んでいましたが、これは正式にはコンディショナルタグと呼ばれるそうです(What are conditional tags? 参照)。

また、こう書きました。

スタイルシートをページの種類ごとにがばっと変えて、ページのデザインを完全に切り替えたら?などと考えてみたれど、スタイルシートの書ける <head> 内には <MainPage> をはじめページ切替タグは使えないとのこと。

これは Blogger HelpTemplate Tag list を見てこう書いたのでしたが、Blogger の標準的なテンプレートの中にも <head> 内でコンディショナルタグを使っている例があり、調べてみると <head> 内でもちゃんと、コンディショナルタグが機能することがわかりました。

<head> 内にコンディショナルタグが書けるとどうなるのか?ですが、これは特に、スタイルシートがページの種類別に書き分けられるようになるということです。

たとえば、<head> 中に
<style type="text/css">
<ItemPage>
div.box {
  border: 1px #ff0000 solid;
}
</ItemPage>
</style>

<body> に
<div class="box">
  KURIBO
</box>
とあれば、記事単独ページでのみ文字列に赤い枠線が出ることになります。つまり <body> 内で実際にパーツを書き分けなくても、スタイルシートを書き分ければ見え方をページごとに変えられる、ということ。

これがどういう場面で役に立つかというと、普通コンディショナルタグによっては書き分けられない部分、投稿の本文の表示をページ種類ごとに書き分けたい時です。

この方法を使い How can I create expandable post summaries? には、メインページで投稿本文を短く表示し、記事単独ページで全文を表示する、いわゆる「続きを読む」機能の導入について説明がされています。

日本語では PrestonCafeBlogger.comにRead More機能を追加する で紹介されていますのでどうぞ。


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

Comments:16



  1. هل انت ممن يريد ان يصبح بيته نظيفا طول الوقت هل تريد ازالة الاتربة والاوساخ من المنزل هل تريد معرفة طرق التنظيف الحديثة من قبل

    شركة تنظيف منازل بالرياض شركة الاوائل التي تعد هي الافضل في الرياض والتي تستخدم افضل الطرق الحديثة والماكينات والالات
    شفط الاتربة وكنسه جيدا
    تلميع الابواب والحوائط والاسقف
    تنظيف الدريش وتلميعه
    غسيل الحمامات والمطابخ وغيرها
    ازالة الاوساخ المتلصقة بالبلاط وتلميعه وتعقيمه جيدا
    رش مبيدات بالمنزل لا ابادة الحشرات جيدا
    في حالة وجود فرشات يتم تنظيف الفرشات جيدا وتجفيفة وتعقيمه
    كل تلك الطرق تعطي نتائج كبرى وكبيرة وكل هذا لن تجده الا بشركة

    شركة تنظيف بالرياض شركة الاوائل الشركة الاكثر طلبا بالرياض
    وايضا تعد شركتنا الاكثر من بين الشركات في الاعتماد علي افضل العمالة المدربة والادوات الحديثة والسيارات المتخصصة لنقل العفش من والي من داخل الرياض الي خارج الرياض والممكلة با افضل النتائج وايضا اسعار معقوله تعد

    شركة نقل اثاث بالرياض
    شركة الاوائل الاكثر نجاحا في مدينة الرياض فك تركيب تغليف اتصل نصل اليك في الحال نتواجد في كافة الانحاء شرق شمال غرب جنوب الرياض ومعظم الاحياء كحي السويدى الملز النسيم الشفا الصحافة وادي لبن
    ولا تتوقف خدمتنا عند تلك الحد في تلك المجالات ولكن انتشرت لتصل الي خدمات
    كشف تسربات المياه
    حيث احدث واكبر الاجهزة التكنولوجية الحديثة التي تكشف عن موقع التهريب دون الجو الي تكسير وايضا تقوم با اعمال الكشف عن المجارى وغيرها وتحدد سبب المشكلة وتقوم بمعالجته با اقل تكلفة بواسطة افضل الفنيون الماهرة

    ReplyDelete
  2. Building Upkeep Models

    Slideshare makes use of cookies to improve functionality and efficiency, and to offer you relevant advertising. consider an administrative individual to handle the records and answer the telephone throughout the day; in spite of everything, when you're working all night, you could شركة تنظيف مجالس شرق الرياض schedule a while to sleep. The place is outdated and imperfect... I knew going into it that it probably would not sparkle

    They're very trustworthy and check out very laborious to do what is asked of them. Others would prefer to purchase their own carpet cleaner that they will use as usually as they like. Others could enable رافعة تنظيف الزجاج such enterprises however place restrictions regarding issues resembling signage, site visitors, staff, commercially marked autos and noise.
    however cleaned with great detail—right down to the cracks and crevices and even floors which are cleaned on hands and knees! Allow us to do what we do finest so you possibly can give attention شركة تنظيف الموكيت بالرياض to the stuff you do best. As our professional home cleaners move through your home, each room is dusted left to proper, prime to backside.

    If you happen to continue shopping the site, you comply with the usage of cookies on this web site. After you have got been cleansing homes for awhile, you شركات تنظيف خزانات المياه may determine to offer extra companies to your cleaning firm. After you have arrange your Fb business web page and have dedicated to writing posts at the very least a few occasions per week,
    Till you determine information to make use of as a information, you may have to estimate the prices تنظيف فلل بالرياض of labor and supplies. Grasp your cleansing flyers in local grocery stores, salons, laundromats, eating places
    Generally it helps to simply get a great night's relaxation and begin with a clean slate within the morning! We achieve this by delivering the very best service experience to your شركة تنظيف موكيت شمال الرياض staff - whether or not it is when they arrive to work or in the office canteen. We've used King of Maids for several months, possibly a 12 months now
    For a Maid Service Enterprise: Your initial staffing needs will depend upon how a lot capital you may have, how giant a enterprise you need to have, and the volume of shoppers you'll be able to reasonably anticipate to service. Here in New York Metropolis there are شركة تنظيف مساجد بالرياض a lot of opportunities in your residence or business to develop into just a little cluttered or dusty. And while Higher Life Maids presently calls St. Louis house, we've grown our company to serve Saint Charles

    ReplyDelete
  3. Attractive section of content. I simply stumbled upon your blog and in accession capital to assert that I acquire in fact enjoyed
    account your blog posts. Anyway I’ll be subscribing
    on your augment or even I success you access constantly quickl

    Also visit my site:휴게텔


    ReplyDelete
  4. I am also commenting to make you understand what a notable experience my friend’s child gained studying your webblog. She realized so many things, with the inclusion of what it is like to have a marvelous giving character to make men and women completely fully grasp some tricky subject matter. You undoubtedly surpassed readers’ expected results 마사지블루. Thank you for offering those great, healthy, educational as well as fun thoughts on your topic to Emily.

    ReplyDelete
  5. Hello There. I found your blog using msn. This is a really well written article. I will be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return.건마탑

    ReplyDelete
  6. GTA Online 우리카지노계열 온라인카지노 카지노사이트 Heist What Optional Preps Should You Do And Avoid? All 3 Approaches

    ReplyDelete
  7. Admiring the time and energy you put into your site and in depth information you offer. It’s awesome to come across a blog every once in a while that isn’t the same outdated rehashed information. 야설

    ReplyDelete


  8. Its like you read my mind! You seem to know a lot about this, like you wrote the book in it or something. I think that you can do with a few pics to drive the message home a bit, but instead of that, this is excellent blog. A great read. I’ll definitely be back. Feel free to visit my website; 한국야동






    ReplyDelete
  9. Having a hard time looking for good and trusted site? I can offer you more and learn more by clicking the link : 릴게임 We have daebak event everyday!!

    ReplyDelete
  10. Here are some links to web pages that we link to simply because we feel they’re really worth visiting. 토토

    ReplyDelete
  11. Amazing Info! Thanks a lot for sharing a piece of wonderful information keep it up and best of luck with your future posts. 스포츠토토

    ReplyDelete
  12. You have touched some pleasant factors here. Any way keep up wrinting. Feel free to visit my website; 카지노사이트

    ReplyDelete
  13. I’ve read this post and if I may I want to suggest you some attention-grabbing things or suggestions. 온라인카지노

    ReplyDelete

Comments on Google+:

© 2005-2014 Kuribo. Powered by Blogger.