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

クリボウの Blogger Tips

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

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

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

Posted at: 2005-07-28 34

メインページ、記事単独ページ、アーカイブページといったページの種類によって、書き出される 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:34



  1. افضل شركة نقل اثاث بالمدينة المنورة تساعدك على نقل اثاثك بامان فلا داعى للقلق مع افضل شركة نقل اثاث بجدة

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

    لا تقلق مطلقاً الان بشأن نقل اي منقولات خاصة بك طالما استعنت بشركة الاول لـ نقل الأثاث في الرياض وخارج الرياض فنحن ليس الوحيدون ولكننا متميزون عن اى مؤسسة أخرى داخل وخارج الدمام وشهرتنا كافضل شركة نقل عفش بينبع
    نقل اثاث بجدة

    ReplyDelete


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

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

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

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

    ReplyDelete
  3. 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
  4. عزيزى العميل اهلا ومرحبا بك فى موقع مؤسسة الحرمــين للمقاولات العامة والعوازل
    شركه عزل فوم بالاحساء و الرياض
    الموقع الرائد فى عالم الخدمات المنزليه والاول بالمملكه العربيه السعوديه لما يتمتع به من خدمات مميزه ، فالبرغم من اننا مؤسسه ربحيه الا ان مزاولة نشاطتنا

    شركه عزل فوم بجدة

    شركه عزل فوم بمكة

    شركه عزل فوم بالرياض كلها مرتبط على نحو وثيق
    بتلبية طلبات وحاجات عملائنا ولتحقيق ذلك الهدف نقدم لك كافة الخدمات الشامله بالالتزام الصارم وبأرقى المعايير المهنيه المتطوره
    فلدينا خبره طويله فى مجال مكافحة الحشرات والكشف عن التسربات وتسليك المجارى وعزل الاسطح وترميم وصيانه المنازل وتخزينه بكفاءة منقطعة النظير ، لا تتردد واتصل
    بموقع مؤسسة الحرمــين فخدماتنا ليس لها بديل واسعارنا ليس لها مثيل ،ولدينا فريق عمل يتصل مع العملاء على جسور الثقه
    https://www.facebook.com/olaks500/?modal=admin_todo_tour
    والصدق والامانه فى العمل ، وهدفنا هو ارضاؤك وراحتك ، لا تقلق ونحن معك
    لا تجهد نفسك ونحن تحت امرك ورهن اشارتك .
    أبرز خدمات مؤسسة الحرمــين للمقاولات العامة بالدمام والرياض

    شركه عزل فوم بالدمام

    ReplyDelete
  5. I thank you for the information and articles you provided cara menggugurkan kandungan dan mempercepat haid

    ReplyDelete
  6. Thank you for this wonderful post! It has long been extremely helpful. 토토사이트I wish that you will carry on posting your knowledge with us.

    ReplyDelete
  7. We have a site for sports games. 토토사이트 You must be interested. 토토사이트

    ReplyDelete
  8. I saw your article well. You seem to enjoy 바카라사이트 for some reason. We can help you enjoy more fun. Welcome anytime :-)

    ReplyDelete
  9. This is very interesting, You are a very professional blogger. I’ve joined your feed and look ahead to seeking more of your excellent post. Additionally, I’ve shared your web site in my social networks. 먹튀검증

    ReplyDelete
  10. 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
  11. 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
  12. 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
  13. Excellent Blog! I would like to thank you for the efforts you have made in writing this post.
    바카라사이트

    ReplyDelete
  14. This is one of the best website I have seen in a long time thank you so much.
    온라인카지노

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

    ReplyDelete
  16. Many thanks for the article, I have a lot of spray lining knowledge but always learn something new. Keep up the good work and thank you again. 먹튀사이트

    ReplyDelete
  17. We are looking for a lot of data on this item. In the meantime, this is the perfect article I was looking for . Please post a lot about items related to 바카라사이트 !!! I am waiting for your article. And when you are having difficulty writing articles, I think you can get a lot of help by visiting my .

    ReplyDelete
  18. This is the perfect post.안전놀이터 It helped me a lot. If you have time, I hope you come to my site and share your opinions. Have a nice day.

    ReplyDelete
  19. 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


  20. 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
  21. Good write-up, I am normal visitor of one web site. 스포츠토토

    ReplyDelete
  22. 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
  23. Here are some links to web pages that we link to simply because we feel they’re really worth visiting. 토토

    ReplyDelete
  24. Your post is very interesting to me. Reading was so much fun. I think the reason reading is fun is because it is a post related to that I am interested in. Articles related to 메이저사이트순위 you are the best. I would like you to write a similar post about !

    ReplyDelete
  25. I’m very pleased to discover this site. I want to to thank you for ones time for this particularly wonderful read!! I definitely savored every part of it and i also have you saved as a favorite to see new information on your blog. 메이저토토사이트

    ReplyDelete
  26. Do you like the kind of articles related to 바카라사이트 If someone asks, they'll say they like related articles like yours. I think the same thing. Related articles are you the best.

    ReplyDelete
  27. It's amazing. I want to learn your writing skills. In fact, I also have a website. If you are okay, please visit once and leave your opinion. Thank you. 바카라게임사이트

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

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

    ReplyDelete
  30. 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.