I'm trying to add divs around the links that appear at the bottom of comments ("edit", "reply", "post new comment" and so on). I realize that the function that creates these links is not one that can be themed directly, and I do not want to hack the core code as suggested in this thread so am trying to have a go at the suggestion in the last comment in that thread and use the _phptemplate_variables function in my template.php
But, whilst to date I have managed to do some limited over-riding of themable functions I'm not sure I understand what I need to do when changing/adding to the _phptemplate_variables function.
There is already a case 'comment' statement in there which adds some classes to comments but what I am trying to do is add divs around the links so I can tunr them into CSS based buttons. Can anyone shed any light on what I should do?
I'm guessing - completely in the dark, that I would do something like...
$links = $vars['links']
foreach ($links as $link)
$link = "
";
return $links
...somewhere in the case "comment' section of that function. Would I be right? Or nearly so?
TIA, Jock
Comments
Oops...
It stripped the html of course from this:
$links = $vars['links']
foreach ($links as $link)
$link = "whatever html I want here".$link."close whatever html tag";
return $links
Hi Jockox3, I just came
Hi Jockox3,
I just came across your post and wondered if you've managed to come up with anything to theme these links? I've tried to get tags around them and failed. :O(
Dylunio creadigol. Syniadau dwyieithog. • Creative design. Bilingual ideas. www.hoffi.com
Thanks
Andrew
-------------------
www.hoffi.com
Not yet
I posted before I came out to work this morning so haven't had a chance to put my theory into practice regardless of nobody responding. I'll give it a go this evening and report back.
I put this...
...in my _phptemplate_variables:
...but it didn't do anything, so I guess I'm wrong on the variable $vars['comment']->links and don't know where to look next.
Got it!
It's got nothing to do with trying to theme the comment itself. Justput a general override of the theme_links function in your phptemplate. I followed the api documentation here:
http://api.drupal.org/api/function/theme_links/5
Let me know if you need more info on how to do it - I'm no PHP code-warrior but got it to work.
More details please
Do you mind showing some code? How you managed to change only the comments link and nothing else?