how to theme text format wrapper, put filter wrapper before textarea?

Events happening in the community are now at Drupal community events on www.drupal.org.
funature's picture

how can i theme text format wrapper, like put the filter wrapper before textarea? actually i want make the wysiwyg editor like the drupalgardens.com does.

AttachmentSize
theme_text_format_wrapper.png36.18 KB
drupalgardens.png43.72 KB
drupalgardens2.png36.3 KB

Comments

I'm actually responsible for

james.elliott's picture

I'm actually responsible for the theming of the WYSIWYG for http://www.drupalgardens.com

There are several things that we did to reorganize the text format.

  1. Use hook_element_info_alter() to add a pre_render function for text_format elements
  2. Moved the text filter select list in the pre_render function added in step #1
  3. Added custom javascript to handle the interactions

I realize this is a very top level description of the steps, but it should give you an idea of where to start. Of course the easiest way to have this theming is to use Drupal Gardens. ;)

thank you for your reply.

funature's picture

thank you for your reply. although i don't get it yet, because i'm still a newbie, i'll try to understand. of course it would be better if you could explain something more or share some code. i appreciate it.

regards

is that possible to use the

funature's picture

is that possible to use the theme_text_format_wrapper function? how can i know the items of #children?

/**
* Returns HTML for a text format-enabled form element.
*
* @param $variables
*   An associative array containing:
*   - element: A render element containing #children and #description.
*
* @ingroup themeable
*/
function theme_text_format_wrapper($variables) {
  $element = $variables['element'];
  $output = '<div class="text-format-wrapper">';
  $output .= $element['#children'];
  if (!empty($element['#description'])) {
    $output .= '<div class="description">' . $element['#description'] . '</div>';
  }
  $output .= "</div>\n";

  return $output;
}

Theme development

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: