上篇文檔,我們介紹了指定多個(gè)欄目產(chǎn)生rel="nofollow"或新窗口target="_blank",現(xiàn)在我們介紹指定一個(gè)欄目產(chǎn)生rel="nofollow"或新窗口target="_blank"。
代碼如下:
{dede:channel type='top' row='5'} <a href="[field:typelink/]" [field:id runphp='yes'] if(@me=='9'){ @me="target='_blank'";} else {@me="";}[/field:id]>[field:typename/]</a> {/dede:channel} |
代碼中if(@me=='9') 數(shù)字9位您要指定欄目的ID號(hào),欄目ID號(hào)從后臺(tái)--核心--網(wǎng)站欄目管理中查看。
擴(kuò)展閱讀:
nofollow標(biāo)簽概念,什么時(shí)候使用rel="nofollow"標(biāo)簽織夢DedeCMS實(shí)現(xiàn){dede:channel}標(biāo)簽增加數(shù)字序號(hào)的方法
織夢模板導(dǎo)航循環(huán)指定欄目出現(xiàn) rel="nofollow"或target="_blank"新窗口