Movable Typeで、値があるかないかを判断

| | カテゴリ : Movable Type , サイト制作 | コメント(10) | トラックバック(0)
このエントリーをはてなブックマークに追加  

Movable Typeで、入力欄に値が入っているか、入っていないかを判断することができる。


これが結構使う場所が多い。


<MTIfNonEmpty>~</MTIfNonEmpty>を利用します。


利用が多いキーワードから導入するといいと思います。


ブログ記事のキーワードが、「値,ある,ない,判断」とし、ブログ全体のキーワードが、「Movable Type」とする。


並びをブログ記事のキーワード、ブログ全体のキーワードの順にする。
「値,ある,ない,判断,Movable Type」このように表示されればよい。
METAのkeywordsの設定だと以下のように表示。
<meta name="keywords" content="値,ある,ない,判断,Movable Type" />


ブログ記事のキーワードは、<$MTEntryKeywords$>で呼び出せます。


「<$MTEntryKeywords$>,Movable Type」といった記述になります。
METAのkeywordsの設定だと以下のようにします。
<meta name="keywords" content="<$MTEntryKeywords$>,Movable Type" />


ここで問題がブログ記事自体に、キーワードを入れなかった場合は以下のようにカンマがある状態で表示に。


「,Movable Type」


METAのkeywordsの設定だと表示は以下のように表示されてしまう。
<meta name="keywords" content=",Movable Type" />


カンマがいらない。


そこで、<MTIfNonEmpty>?</MTIfNonEmpty>を使います。


値が入っているときだけ、カンマを表示、値が入っていないときは、カンマを非表示。


「<MTIfNonEmpty><$MTEntryKeywords$>,</MTIfNonEmpty>Movable Type」


<meta name="keywords" content="<MTIfNonEmpty><$MTEntryKeywords$>,</MTIfNonEmpty>Movable Type" />


ブログ記事のキーワードが、「値,ある,ない,判断」の場合、
<meta name="keywords" content="値,ある,ない,判断,Movable Type" />


ブログ記事のキーワードに値が何も入ってなかったら
<meta name="keywords" content="Movable Type" />


になる。


めでたし、めでたし。

トラックバック(0)

このブログ記事を参照しているブログ一覧: Movable Typeで、値があるかないかを判断

このブログ記事に対するトラックバックURL: http://takot.sakura.ne.jp/mt/mt-tb.cgi/772

コメント(10)

I am extremely impressed with your writing talents as neatly as with the structure in your weblog.
Is this a paid subject or did you customize it yourself?
Anyway keep up the nice high quality writing, it is rare to look a
great blog like this one nowadays..

Hey there! Quick question that's completely off topic.
Do you know how to make your site mobile friendly? My website looks
weird when viewing from my iphone 4. I'm trying to find a
template or plugin that might be able to resolve this problem.
If you have any suggestions, please share. Many thanks!

Feeling especially opportune? Get your tickets out to view iff you're tonight's lottery winner!
The Mega Mllions winning numbers for May 21, 2013 are 2,
15, 17, 48, 55, the Mega Ball number is 11, and allso
the Megaplier iss X 4, New Jersey Lottery officials announced.
Tuesday's Mega Millions results were revealed at 11 p.m.


The largest Powerball jackpot in lottery history was for $590.5 million. One Florida Powerball winner matched all
six Powerball winning numbers, such as red Powerball number for your Saturday,
May 18 slurping. Read the article Florida Powerball lottery winner Gloria MacKenzie claims massive $590M jackpot
for more info.

The most current Mega Millions winning numbers for July 23,
2013, were 25, 32, 35, 50, 51, the Mega Ball number was 46, and the Megaplier was
X or higher. There were nobody jackpot winners for
this drawing. Check the article Mega Millions winning numbers: California lottery winner its massive prise for information.

The mega888 company and so-called services around it can scam get you started of your own. You
can easily avoid mega888 gake list traps once you are aware how.
For the best free mega888 game list tips and techniques see Part 2 from this series.
But first, what are Mega Millions traps?

Lottery Systems - Now obviously iff you're chboose this option, also itt have different
ann initial outlay. However the returns into your investment might
be ten-fold.

Right now, you're wondering iif wish be holdiing the winning
ticket on the drawing from last night's Mega Millions Lottery.
Perhaps you were busy last nght aand not able to tune in the broadcast to search out out if you mighyt
won, and even you prefer to save the results-viewing for your morning shortly after.

In any case, we've got the results below, and
you can find out-- by just reading down a few more paragraphs-- whether not really you won the Mega Millions Lottery jackpot!
Keep reading for the results, my gentle Exzminer readers.


If there is no winner in Tuesday night's drawing, another jackpoot become worth
as much as $190 thousands of. The Mega Millions lottery drawings are shown twice weekly
in Roanoke, hazving a drawing on Tuesday evening,
and anoher on Friday evening. Roanoke residents can see thgese drawings during the 11 p.m.
EST news programs' commercial breaks, with stations such as WDBJ 7 and WSLS 10 showing thhe plans.

of course like your web-site however you have to take a look at the spelling on quite a
few of your posts. Several of them are rife with spelling problems and
I to find it very bothersome to inform the reality then again I'll certainly come again again.

I do trust all the concepts you have presented to your post.

They're really convincing and will certainly work.
Nonetheless, the posts are too short for beginners.
May just you please extend them a little from
subsequent time? Thank you for the post.

Nice post. I learn something new and challenging on websites I stumbleupon on a daily basis.
It's always useful to read content from other authors and practice a little something from their websites.

I know this website presents quality dependent articles
and extra information, is there any other website which provides these things in quality?

I'm truly enjoying the design and layout of
your website. It's a very easy on the eyes which makes it much more pleasant for me to come here and visit more
often. Did you hire out a designer to create your theme?
Exceptional work!

Hey there! I'm at work surfing around your blog from my new iphone!

Just wanted to say I love reading through your
blog and look forward to all your posts! Keep up the excellent work!

Hi! I've been reading your web site for a while now and finally got the courage
to go ahead and give you a shout out from New Caney Texas!
Just wanted to tell you keep up the excellent work!

コメントする

Insert Emoddy tag

画像の中に見える文字を入力してください。

プロフィール

Kamitani79
ニックネーム : Kamitani79
映画鑑賞、音楽、写真、ゲーム。地元・横浜をこよなく愛する( `・∀・´)ノヨロシク
自己紹介 :
このエントリーをはてなブックマークに追加

携帯サイト

つながり

  • ブロガー(ブログ)交流空間 エディタコミュニティ
  • あわせて読みたいブログパーツ
  • フィードメーター - Kamitani79-メロンとバナナとブログ
  • SEO
    loading
Creative Commons License
このブログのライセンスは クリエイティブ・コモンズライセンス.
Powered by Movable Type 6.2.4

最近のアクション

人気のエントリー

最近の写真・画像

空の写真

www.flickr.com
This is a Flickr badge showing public photos and videos from Kamitani79. Make your own badge here.

このブログ記事について

このページは、Kamitani79が2008年9月17日 23:21に書いたブログ記事です。

ひとつ前のブログ記事は「Blu-rayの「レミーのおいしいレストラン」と「カーズ」を購入」です。

次のブログ記事は「今自分に見えていること」です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。