I am creating a new bootstrap 3 theme and try to learn drupal 7 php logic a bit

so I added the following to my template.php to theme the read-more butten and the write new comment button


 function mytheme_preprocess_node(&$variables) {
 $variables['content']['links']['node']['#links']['node-readmore']['attributes']['class'][] = 'btn btn-primary';
 $variables['content']['links']['comment']['#links']['comment-add']['attributes']['class'][] = 'btn btn-info';
 }

Now I like to know how to theme the comment count.

Basically my problem is that I am a newbie in php and I have no Idea where to start to gather knowledge enough to know how to concatinate strings like the two above by myself Even the theming tutorials from drupalize.me do not help here. Could some one show me how to add some classes to the comment counter on the node page and mainly how can I get there on my own? Is there a good beginners tutorial when it comes to the drupal api pages. oi do not understand a bit of them and I am a bit frustrated about that.

Comments

refaktor’s picture

Could you be more specific about which comment count output you're referring to? Are you working with a custom node.tpl file?

Joachim Namyslo’s picture

@refactor

Thanks for your Effort.

What i was looking for is something liike


  function mytheme_preprocess_node(&$variables) {
 /*Theming node buttons on /node*/
 $variables['content']['links']['node']['#links']['node-readmore']['attributes']['class'][] = 'btn btn-primary btn-sm';
 $variables['content']['links']['comment']['#links']['comment-add']['attributes']['class'][] = 'btn btn-warning badge';
 $variables['content']['links']['comment']['#links']['comment-comments']['attributes']['class'][] = 'btn btn-info badge';
 }


 function mytheme_preprocess_comment(&$vars){
 /*Theming comment buttons on  /comment form*/
 $vars['content']['links']['comment']['#links']['comment-edit']['attributes']['class'][] = 'btn btn-primary btn-xs ';
 $vars['content']['links']['comment']['#links']['comment-delete']['attributes']['class'][] = 'btn btn-danger btn-xs ';
 $vars['content']['links']['comment']['#links']['comment-reply']['attributes']['class'][] = 'btn btn-info btn-xs ';

 }

for templates.php to get some convenience with bootstrap.