How to theme Advanced forum style for Twitter Bootstrap theme?

Currently, I am editing naked style to use bootstrap default classes.
But, unable to theme classes for many units, such as content links.
Is any other way to do?

Comments

TheNet_’s picture

I am also interested in this. If you found a way to do it please tell me how. Or if you made a theme, upload it somewhere? Thanks!

mkrkarthi’s picture

I did most of the things. Now my forum looks awesome and responsive.
Currently my issue is to apply bootstrap btn classes for the edit, delete, reply, post reply links. 'af-button-small' class is currently in theme. How to change it to 'btn btn-primary btn-small'?
Also, How to add image class for profile images?
img tag has no class name, I wish add a class name.

JSurf’s picture

Would you mind sharing your theme ?
Think about doing the same and why reinvent the wheel when someone else already did it ?

fredklopper’s picture

Hi JSurf!

It's not finished yet (after a day work) but it is a good start. Notice: it is based on Bootstrap 3.

Download

Read the README.md file ;-)

Viel Spaß!

Wit best regards,

Fred Klopper

fredklopper’s picture

@ JSurf 'Bootstrapping' the comment links:

/**
 * Implements hook_preprocess_node().
 */
function YOURTHEME_preprocess_node(&$variables) {
  if (isset($variables['content']['links']['comment']['#links']['post-edit'])) {
    $variables['content']['links']['comment']['#links']['post-edit']['attributes']['class'] = "btn btn-default btn-xs";
  }
  if (isset($variables['content']['links']['comment']['#links']['post-delete'])) {
    $variables['content']['links']['comment']['#links']['post-delete']['attributes']['class'] = "btn btn-danger btn-xs";
  }
  if (isset($variables['content']['links']['comment']['#links']['comment-add'])) {
    $variables['content']['links']['comment']['#links']['comment-add']['attributes']['class'] = "btn btn-default btn-xs";
  }
}

/**
 * Implements hook_preprocess_comment().
 */
function YOURTHEME_preprocess_comment(&$variables) {
  if (isset($variables['content']['links']['comment']['#links']['comment-edit'])) {
    $variables['content']['links']['comment']['#links']['comment-edit']['attributes']['class'] = "btn btn-default btn-xs";
  }
  if (isset($variables['content']['links']['comment']['#links']['comment-delete'])) {
    $variables['content']['links']['comment']['#links']['comment-delete']['attributes']['class'] = "btn btn-danger btn-xs";
  }
  if (isset($variables['content']['links']['comment']['#links']['comment-reply'])) {
    $variables['content']['links']['comment']['#links']['comment-reply']['attributes']['class'] = "btn btn-default btn-xs";
  }
}
JSurf’s picture

Great , Thanks for sharing !

Mizpah’s picture

Thanks Again,

I just found this which has given me a great head start on a Bootstrap3 AF implementation!

Media Crumb’s picture

This should almost be its own sub-theme and rolled into the project or maintained on its own. So much great potential here!

mrded’s picture

You can apply views_bootstrap module and change forum view style to bootstrap.

mrded’s picture

Status: Active » Fixed

Just made Advanced Forum Bootstrap module for that.

Media Crumb’s picture

Well done mrded

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.