一般是类似于这样:
1
{dede:arclist row=
'10'
}
2
<li><a href=
"[field:arcurl /]"
title=
"[field:fulltitle/]"
>[field:title/]</a></li>
3
{/dede:arclist}
如果需要限制字数,可以增加titlelen=’90′,代码为:
1
{dede:arclist row=
'10'
titlelen=
'90'
}
2
<li><a href=
"[field:arcurl /]"
title=
"[field:fulltitle/]"
>[field:title/]</a></li>
3
{/dede:arclist}
但是,此时显示的文章标题后面直接被截断,不会有省略号,将其中的[field:title]修改成[field:fulltitle runphp='yes']$titlefull = @me;$titleshow =cn_substr($titlefull,90);if($titlefull!=$titleshow){$dot = “…”;}else{$dot=”";}@me = $titleshow.$dot;[/field:fulltitle]即可,代码为:
1
{dede:arclist row=
'10'
}
2
<li><a href=
"[field:arcurl /]"
title=
"[field:fulltitle/]"
>[field:fulltitle runphp=
'yes'
]
$titlefull = @me;$titleshow=cn_substr($titlefull,90);
if
($titlefull!=$titleshow){$dot =
"…"
;}
else
{$dot=
""
;}
@me = $titleshow.$dot;[/field:fulltitle]</a></li>
3
{/dede:arclist}
1
{dede:arclist row=
'10'
}
2
<li><a href=
"[field:arcurl /]"
title=
"[field:fulltitle/]"
>
3
[field:fulltitle
function
=
' ( strlen("@me")>90 ? cn_substr("@me",90)."…" : "@me" )'
/] </a></li>
如果本文对你有帮助,欢迎打赏本站