zoukankan      html  css  js  c++  java
  • dedecms 多级栏目时,调用上级栏目名称和链接

    {dede:field name='position' runphp='yes'}
    $tc="-"; //分隔符
    $tw=$GLOBALS['cfg_list_symbol']; //调用位置分隔符
    @me=html2text(@me); //去除html标签 $tf=split($tw,@me); //分解成数组 $ta=1; /1表示一级栏目,2表示二级栏目 $tk=trim($tf[$ta]); $tk=substr($tk,0,-2); @me=$tk; //赋值给@me {/dede:field}
    N级子栏目调用上级栏目名称和链接
    {dede:field name='position' runphp='yes'}
    $tc="-"; //分隔符
    $tw=$GLOBALS['cfg_list_symbol']; //调用位置分隔符
    $tf=split($tw,@me); //分解成数组
    $ta=(count($tf)-3);
    $tk=trim($tf[$ta]);
    @me=$tk; //赋值给@me
    {/dede:field}

    另外附上一条 调用指定栏目

    {dede:type typeid='14'}
    <li><a href="[field:typelink/]">全部</a></li>
    {/dede:type}
    DEDE标题栏:文章标题-2级栏目-1级栏目-网站名”样式显示
     
    
    {dede:field name='title'/}-{dede:field name='position' runphp='yes'}
    $tc="-"; //分隔符
    $tw=$GLOBALS['cfg_list_symbol']; //调用位置分隔符
    @me=html2text(@me); //去除html标签
    $tf=split($tw,@me); //分解成数组
    for($ta=(count($tf)-2);$ta>=1;$ta--){ //循环赋值给$tk
    $tk.=trim($tf[$ta]).$tc;
    }
    $tk=substr($tk,0,-1);
    @me=$tk; //赋值给@me
    {/dede:field}-{dede:global name='cfg_webname'/}
  • 相关阅读:
    51nod 1179 最大的最大公约数 (数论)
    POJ 3685 二分套二分
    POJ 3045 贪心
    LIC
    HDU 1029 Ignatius and the Princess IV
    HDU 1024 Max Sum Plus Plus
    HDU 2389 Rain on your Parade
    HDU 2819 Swap
    HDU 1281 棋盘游戏
    HDU 1083 Courses
  • 原文地址:https://www.cnblogs.com/jizl/p/4672811.html
Copyright © 2011-2022 走看看