eyoucms首頁列表頁調用文章content內容的方法
2020-05-27
關于首頁、列表頁調用文章content內容的兩種方法,需要注意的是無論是列表還是首頁,要調出具體content內容,都要先在arclist里加addfields='content',方法如下:
1、不過濾HTML的方法
{eyou:arclist titlelen='40' row='4' typeid='5' addfields='content' } <p>{$field.content}</p> {/eyou:arclist}
2、過濾內容的HTML,輸出純文字
{eyou:arclist titlelen='40' row='4' typeid='5' addfields='content' } <p>{$field.content|html_msubstr=###}</p> {/eyou:arclist}
addfields='content' 為調取文章內容的標簽屬性,必加在arclist里
{$field.content} 為調取文章內容不過濾樣式的標簽。
{$field.content|html_msubstr=###} 為調取文章內容過濾樣式的標簽。
{$field.content|html_msubstr=###,0,155} 為調取文章內容過濾樣式并截取155個字符的標簽。
以上方法同樣換成自定義字鍛也可以。