dede当前位置各种写法

方法一.Dedecms当前位置{dede:field name='position'/}

方法二.dede:field name='position' runphp='yes'}
          $a=mb_strlen(@me);//计算字符串的长度
          @me=cn_substr(@me,$a-2,-1);//截取字符
         {/dede:field}

(这是去掉“去掉>”得得方法) 方法三.、{dede:field name='position'/} 中去掉 > 并去掉最后一个文本的链接的解决方案
     {dede:field name='position' runphp='yes'}
    $tc=" > ";                  
    $tf=split($tc,@me);                        
    $tn=count($tf);
    for($iij=0;$iij<($tn-1);$iij++){
        if($iij==($tn-2)){$tf[$iij]=strip_tags($tf[$iij]);}
        $tl=$tl.$tf[$iij];
    }
    @me=$tl;
   echo @me;
{/dede:field}
如果还需要分隔符的话,就把$tl=$tl.$tf[$iij]; 换成
$tl=$tl."空格分隔符空格".$tf[$iij];

方法四.

    您当前所在的位置:<a href="/">本站首页</a> >{dede:channel type='top' currentstyle="              <a href='~typelink~'>~typename~</a>               "}               {/dede:channel} >

方法五.dede:channel currentstyle="              <a href='#'>~typename~</a>               "}               {/dede:channel}

posted @   雪莉06  阅读(315)  评论(0编辑  收藏  举报
编辑推荐:
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
阅读排行:
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 单元测试从入门到精通
点击右上角即可分享
微信分享提示