實體說明
STL 實體是左大括號({)和右大括號(})以及位于二者之間的所有內(nèi)容。有開始標記和結束標記(例如 {Stl.SiteName})。
STL 實體能夠嵌入到HTML 語言或STL 語言的任何位置,(例如內(nèi)容模版中 <stl:a title="{Content.Title}"></stl:a>)。
STL 其余實體分為通用實體({Stl.開頭)、內(nèi)容實體({Content.開頭)、欄目實體({Channel.開頭)、評論實體({Comment.開頭)以及數(shù)據(jù)庫實體({Sql.開頭)。
通用實體與<stl:value>元素相同,<stl:value type="xyz"></stl:value>等價于{Stl.xyz},請參考<stl:value> 標簽。通用實體能在任何地方解析。
內(nèi)容實體與<stl:content>元素相同,<stl:content type="xyz"></stl:content>等價于{Content.xyz},請參考<stl:content> 標簽。內(nèi)容實體只能在內(nèi)容模板中或<stl:contents> 元素內(nèi)部解析。
欄目實體與<stl:channel>元素相同,<stl:channel type="xyz"></stl:channel>等價于{Channel.xyz},請參考<stl:channel> 標簽。欄目實體能在任何地方解析。
評論實體與<stl:comment>元素相同,<stl:comment type="xyz"></stl:comment>等價于{Comment.xyz},請參考<stl:comment> 標簽。評論實體只能在評論上下文中解析。
數(shù)據(jù)庫實體與<stl:sqlContent>元素相同,<stl:sqlContent type="xyz"></stl:sqlContent>等價于{Sql.xyz},請參考<stl:sqlContent> 標簽。數(shù)據(jù)庫實體只能在數(shù)據(jù)庫查詢上下文中解析。
標簽與實體
所有STL 元素均有對應實體,將元素“<”替換為“{”,“>”替換為“}”即為對應實體,實體中屬性采用單引號或者不帶引號。如內(nèi)容值元素:
<stl:content type="Title" wordNum="20"></stl:content>
對應實體為
{stl:content type='Title' wordNum='20'}
或
{stl:content type=Title wordNum=20}
更多建議: