{dede:channel type='top' row='8'} <a href="[field:typelink/]" [field:id runphp=yes] if(@me == 1){ @me = 'rel="nofollow"'; }else if(@me == 9){ @me = 'rel="nofollow"'; }else if(@me == 5){ @me = 'rel="nofollow"'; }else if(@me == 8){ @me = 'rel="nofollow" '; }else if(@me == 7){ @me = 'rel="nofollow"'; }else{@me = '';} [/field:id] >[field:typename/]</a> {/dede:channel}
if(@me == 9){ @me = 'rel="nofollow") //如果id等于9就会输出rel="nofollow" // 如果想让指定id输出rel="nofollow" 就是添加,反之就不添加
function is_nofollow($id){ switch ($id) { case '1': $nofollow = 'rel="nofollow"'; break; case '2': $nofollow = 'rel="nofollow"'; break; case '3': $nofollow = 'rel="nofollow"'; break; case '4': $nofollow = 'rel="nofollow"'; break; default: $nofollow = ''; break; } return $nofollow; }
{dede:channel type='top' row='8'} <a href="[field:typelink/]" [field:id function="is_nofollow(@me)"/]>[field:typename/]</a> {/dede:channel}
版权声明:本站原创文章,于2020-01-01,由 kira 发表!
转载请注明:dede导航循环指定栏目出现 rel="nofollow" - kiraer个人网站技术博客