I cobbled this code from this Quote module issue #1167094: "Themeing" the quote text/button. But I don't know how to adapt it for the PM link. Could somebody please lend a hand?

<?php
/**
 * Adds af-button-small class to anchor tab and span tag to link text on nodes.
 */
function harp_preprocess_node(&$vars) {
  if ($vars['type'] == 'forum' && isset($vars['content']['links']['quote']['#links']['quote'])) {
    $vars['content']['links']['quote']['#links']['quote']['html'] = TRUE;
    $vars['content']['links']['quote']['#links']['quote']['title'] = "<span>" . $vars['content']['links']['quote']['#links']['quote']['title'] . "</span>";
    $vars['content']['links']['quote']['#links']['quote']['attributes']['class'] = array('af-button-small');
  }
}

?>

Comments

topdillon’s picture

I also tried the following and it didn't work. What am I doing wrong?

<?php
/**
 * Adds af-button-small class to anchor tab and span tag to link text in comments.
 */
function harp_preprocess_comment(&$vars) {
  if ($vars['node']->type == 'forum' && isset($vars['content']['links']['privatemsg_link']['#links']['privatemsg_link'])) {
    $vars['content']['links']['privatemsg_link']['#links']['privatemsg_link']['html'] = TRUE;
    $vars['content']['links']['privatemsg_link']['#links']['privatemsg_link']['title'] = "<span>" . $vars['content']['links']['privatemsg_link']['#links']['privatemsg_link']['title'] . "</span>";
    $vars['content']['links']['privatemsg_link']['#links']['privatemsg_link']['attributes']['class'] = array('af-button-small');
  }
}

/**
 * Adds af-button-small class to anchor tab and span tag to link text in nodes.
 */
function harp_preprocess_node(&$vars) {
  if ($vars['node']->type == 'forum' && isset($vars['content']['links']['privatemsg_link']['#links']['privatemsg_link'])) {
    $vars['content']['links']['privatemsg_link']['#links']['privatemsg_link']['html'] = TRUE;
    $vars['content']['links']['privatemsg_link']['#links']['privatemsg_link']['title'] = "<span>" . $vars['content']['links']['privatemsg_link']['#links']['privatemsg_link']['title'] . "</span>";
    $vars['content']['links']['privatemsg_link']['#links']['privatemsg_link']['attributes']['class'] = array('af-button-small');
  }
}
?>
ptmkenny’s picture

Category: feature » support
ivnish’s picture

Issue summary: View changes
Status: Active » Closed (outdated)