开发者

How do I insert a <span> </span> tag inside the <a> </a> tag on my main menu in Drupal7

开发者 https://www.devze.com 2023-02-21 03:33 出处:网络
I\'m trying to make the text between mytag not display by wrapping it in aand then styling that. I\'ve added the following function to my template.php file, but I cannot see any difference on the fro

I'm trying to make the text between my tag not display by wrapping it in a and then styling that.

I've added the following function to my template.php file, but I cannot see any difference on the front end. The span just does not appear. (I have cleared my cache)

Am I using the right function? What am I doing wrong?

    function my_theme_link开发者_运维问答($variables) {
  return '<a href="' . check_plain(url($variables['path'], $variables['options'])) . '"' . drupal_attributes($variables['options']['attributes']) . '><span>' . ($variables['options']['html'] ? $variables['text'] : check_plain($variables['text'])) . '</span></a>';
} 


I asked the same question here on drupal.stackexchange.com and received good answers, if you are interested.

0

精彩评论

暂无评论...
验证码 换一张
取 消