`
rexcn
  • 浏览: 87372 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

drupal在导航菜单中加上|字符

阅读更多
Copy and paste the theme_links function from theme.inc to your template.php file. change the name of the function to YOURTHEME_links where YOURTHEME is the name of your theme.

Add the following code snippet on the second line of the function, after the "$output=' ';"



<?php
// | delimiter added here.
    if($attributes['class'] == 'links secondary-links') {
    $linklist = array();
    foreach ((array)$links as $key => $link) {
        $linklist[] = l($link['title'], $link['href'], $link);
    }
    // Return the links joined by a '|' character
    return join(' | ', $linklist);
?>
  }


As it is currently setup the secondary links will have the delimiter.


Next go to your page.tpl.php file and insert the following code into where you want the links to show up.

<?php
if(isset($secondary_links)){
        print YOURTHEME_links($secondary_links, array('class' => 'links secondary-links'));
   }
?>


原文:http://drupal.org/node/60341
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics