【基礎(chǔ)用法】
名稱:uitype
功能:欄目編輯钞螟,比uitext纵寝、uihtml、uiupload標(biāo)簽多了一個typeid屬性花吟,使用時結(jié)合html一起才能完成可視化布局,只針對具有可視化功能的模板涣脚。
語法:
<div class="eyou-edit" e-id="文件模板里唯一的數(shù)字ID" e-page='文件模板名' e-type="type">
{eyou:uitype typeid='欄目ID' e-id='必須與上面的數(shù)字ID一致' e-page='必須與上面的文件模板名一致' id='field'}
這里嵌套模板標(biāo)簽代碼
{/eyou:uitype}
</div>
參數(shù):
typeid='' 欄目ID
e-id='' 每個模板文件里唯一的數(shù)字ID示辈,必須與uihtml標(biāo)簽外層的html元素標(biāo)簽e-id保持一致
e-page='' 頁面分組,假設(shè)模板文件是index.htm遣蚀,那么e-page的值是index
id='' 可以任意指定循環(huán)里的變量名替代field矾麻,假設(shè)id='field1'纱耻,模板調(diào)用如:{$field.value} 變成 {$field1.value}
底層字段:
無
【更多示例】
-------------------------------示例1--------------------------------
描述:在模板文件index.htm中調(diào)用uitype標(biāo)簽,實(shí)現(xiàn)指定欄目可視化切換的效果险耀。
<!DOCTYPE html>
<html>
<head>
<title>EyouCms企業(yè)建站系統(tǒng)</title>
</head>
<body>
<div>
<div class="eyou-edit" e-id="400" e-page='index' e-type="type">
<!-- uitype可視化標(biāo)簽調(diào)用 start -->
{eyou:uitype typeid='2' e-id='400' e-page='index' id='field'}
{eyou:type type='self' empty='欄目不存在時弄喘,顯示這里的文案'}
<a href="{$field.typeurl}" title="{$field.typename}">{$field.typename}</a>
{/eyou:type}
{/eyou:uitype}
</div>
<!-- 可視化模板必須引入的ui標(biāo)簽 start -->
{eyou:ui open='off' /}
<!-- 可視化模板必須引入的ui標(biāo)簽 end -->
</body>
</html>
-------------------------------示例2--------------------------------
描述:在模板文件lists_article.htm中調(diào)用uitype標(biāo)簽,實(shí)現(xiàn)指定欄目可視化切換的效果甩牺。
<!DOCTYPE html>
<html>
<head>
<title>EyouCms企業(yè)建站系統(tǒng)</title>
</head>
<body>
<div>
<div class="eyou-edit" e-id="400" e-page='lists_article' e-type="type">
<!-- uitype可視化標(biāo)簽調(diào)用 start -->
{eyou:uitype typeid='2' e-id='400' e-page='lists_article' id='field'}
{eyou:type type='self' empty='欄目不存在時蘑志,顯示這里的文案'}
<a href="{$field.typeurl}" title="{$field.typename}">{$field.typename}</a>
{/eyou:type}
{/eyou:uitype}
<!-- uitype可視化標(biāo)簽調(diào)用 end -->
</div>
</div>
<!-- 可視化模板必須引入的ui標(biāo)簽 start -->
{eyou:ui open='off' /}
<!-- 可視化模板必須引入的ui標(biāo)簽 end -->
</body>
</html>
-------------------------------示例3--------------------------------
描述:在模板文件index.htm中,多處調(diào)用uitype標(biāo)簽的寫法贬派。
<!DOCTYPE html>
<html>
<head>
<title>EyouCms企業(yè)建站系統(tǒng)</title>
</head>
<body>
<div>
<!-- 第一次調(diào)用uitype標(biāo)簽 start -->
<div class="eyou-edit" e-id="400" e-page='index' e-type="type">
<!-- uitype可視化標(biāo)簽調(diào)用 start -->
{eyou:uitype typeid='2' e-id='400' e-page='index' id='field'}
{eyou:type type='self' empty='欄目不存在時急但,顯示這里的文案'}
<a href="{$field.typeurl}" title="{$field.typename}">{$field.typename}</a>
{/eyou:type}
{/eyou:uitype}
<!-- uitype可視化標(biāo)簽調(diào)用 end -->
</div>
<!-- 第一次調(diào)用uitype標(biāo)簽 end -->
<!-- 第二次調(diào)用uitype標(biāo)簽 start -->
<div class="eyou-edit" e-id="401" e-page='index' e-type="type">
<!-- uitype可視化標(biāo)簽調(diào)用 start -->
{eyou:uitype e-id='401' e-page='index' id='field'}
{eyou:type type='self' empty='欄目不存在時,顯示這里的文案'}
<a href="{$field.typeurl}" title="{$field.typename}">{$field.typename}</a>
{/eyou:type}
{/eyou:uitype}
<!-- uitype可視化標(biāo)簽調(diào)用 end -->
</div>
<!-- 第二次調(diào)用uitype標(biāo)簽 end -->
</div>
<!-- 可視化模板必須引入的ui標(biāo)簽 start -->
{eyou:ui open='off' /}
<!-- 可視化模板必須引入的ui標(biāo)簽 end -->
</body>
</html>
-------------------------------示例4--------------------------------
描述:在模板文件index.htm中搞乏,多處調(diào)用uitype標(biāo)簽的寫法波桩,只在html最外層元素指定一次e-page屬性值。
<!DOCTYPE html>
<html>
<head>
<title>EyouCms企業(yè)建站系統(tǒng)</title>
</head>
<body>
<div e-page='index'> <!-- 最外層指定e-page屬性值请敦,里面html元素<a>可以不再指定e-page屬性值 -->
<!-- 第一次調(diào)用uitype標(biāo)簽 start -->
<div class="eyou-edit" e-id="400" e-type="type">
<!-- uitype可視化標(biāo)簽調(diào)用 start -->
{eyou:uitype typeid='2' e-id='400' e-page='index' id='field'}
{eyou:type type='self' empty='欄目不存在時镐躲,顯示這里的文案'}
<a href="{$field.typeurl}" title="{$field.typename}">{$field.typename}</a>
{/eyou:type}
{/eyou:uitype}
<!-- uitype可視化標(biāo)簽調(diào)用 end -->
</div>
<!-- 第一次調(diào)用uitype標(biāo)簽 end -->
<!-- 第二次調(diào)用uitype標(biāo)簽 start -->
<div class="eyou-edit" e-id="401" e-type="type">
<!-- uitype可視化標(biāo)簽調(diào)用 start -->
{eyou:uitype typeid='2' e-id='401' e-page='index' id='field'}
{eyou:type type='self' empty='欄目不存在時,顯示這里的文案'}
<a href="{$field.typeurl}" title="{$field.typename}">{$field.typename}</a>
{/eyou:type}
{/eyou:uitype}
<!-- uitype可視化標(biāo)簽調(diào)用 end -->
</div>
<!-- 第二次調(diào)用uitype標(biāo)簽 end -->
</div>
<!-- 可視化模板必須引入的ui標(biāo)簽 start -->
{eyou:ui open='off' /}
<!-- 可視化模板必須引入的ui標(biāo)簽 end -->
</body>
</html>
轉(zhuǎn)自:https://www.eyoucms.com/doc/label/ui/575.html#dt_74