Home > 『 LeeTea 的學位是數位內容碩士,但想法卻很アナログ傳統』 > *SetVar GetVar:SetVarBlock

*SetVar GetVar:SetVarBlock

 叫一個 cc外掛
 <div class="widget-creative-commons widget"><mt:BlogCCLicense> <div class="widget-content"> このBLOG<a href ="<$mt:BlogCCLicenseURL$>">Creative Commons</a>でライセンスされています。 </mt:BlogCCLicense>
 其實什麼時候用$$我還是有點猶豫。

 Var就是Variable的意思,那一個就是設定,一個就是取得。我已經Set Var的Value是多少了,我在Get的時候就不用再去想Value是多少了。變數有很多種,

 配列變數:
 <mt:SetVar name="LDope[1]" value="LeeTea"/>
 <mt:SetVar name="LDope[2]" value="Gaspar"/>
 <mt:SetVar name="LDope[3]" value="Iveet"/>
 如果這是總數的話就可以寫成
 <mt:SetVar name="LDope" value="LeeTea","Gaspar","Iveet"/>

 Hash變數:
 另外在name裡面若是有用{}就代表key的標示了。也就是說
 <mt:SetVar name="LDope" key="LeeTea" value="Worker"/>
 省略來寫就可以寫成:
 <mt:SetVar name="LDope{LeeTea}" value="Worker"/>

 預約變數:
 就是不知道怎麼解釋...

 特殊變數:
 記住一下op的變數值,

 制御型
 <MTIf name="想要找李茶">
 <MTElse name="現在外出中">

  雖然說是一年又一年,但是每年還要下去更改,Copyright © 2007 - 20xx,有點麻煩,所以我們讓他自動運算。
 <mt:Entries sort_order="ascend" limit="1" setvar="start_year"> <mt:EntryDate format="%Y" /></mt:Entries> <mt:Entries sort_order="descend" limit="1" setvar="last_year"> <mt:EntryDate format="%Y" /></mt:Entries>從EntryDate裡面去找,short_order就是升降順選擇,用ascend頭和descend尾做決定。limit限量1名,也就是說抓出最早跟最晚(今年)的年份。Copyright &copy;<mt:GetVar name="start_year"/>在這邊召喚出start_year <mt:If name="start_year"ne="$last_year">- <mt:GetVar name="last_year" /></mt:If> 那如果,剛好是2009 - 2009這不就很白痴嗎?所以設定成如果頭跟尾年份一樣,就不要出現。<mt:BlogName encode_html="1"/> All Rights Reserved.</address>
就是這樣。

 我應該把今年最後一天來放才是,這樣才有真實的體會嘛!

Comments:0

Comment Form

Trackbacks:0

TrackBack URL for this entry
http://ldope.com/blog/mt-tb.cgi/590
Listed below are links to weblogs that reference
*SetVar GetVar:SetVarBlock from *LeeTea:GlooMy Someday

Home > 『 LeeTea 的學位是數位內容碩士,但想法卻很アナログ傳統』 > *SetVar GetVar:SetVarBlock

Search
Feeds
Some SNS where i am

Return to page top