I noticed that taxonomy fields are not being displayed in the right column of the node edit form. I have created core taxonomy fields and I expected them to be displayed in the right column, just like they did in 6.x.

Is there some configuration setting to enable this? Or has this feature been left out due to the change in how taxonomy is handled in 7.x?

Comments

ishmael-sanchez’s picture

Category: support » bug
Status: Active » Needs work

The code is in there it's just not working as expected. The problem is this block of code in the template.php around line 202:

  // Default to showing taxonomy in sidebar if nodeformcols is not present.
  elseif (isset($vars['form']['taxonomy']) && empty($vars['sidebar'])) {
    $vars['sidebar']['taxonomy'] = $vars['form']['taxonomy'];
    unset($vars['form']['taxonomy']);
  }

The condition doesn't fire because in that form array there isn't a taxonomy like it used to be in D6 (at the top of the function add a dpm($vars); to see what I'm talking about) if you wanted it to work you can create a sub theme and refine the function and that condition and assign your taxonomy fields to that sidebar variable or you could try just using the nodeformcols module.

ericduran’s picture

I also need this.

For now I just implemented a sub theme.

And in my subtheme template.php added this.

<?php
/** 
 * Implement hook_theme().
 *
 * Need this to add our custom preprocess function to rubik default node_form theming.
 */
function my_sub_rubik_theme() {
  $items = array();

  $items['node_form'] = array(
    'render element' => 'form',
    'path' => drupal_get_path('theme', 'rubik') .'/templates',
    'template' => 'form-default',
    'preprocess functions' => array(
      'rubik_preprocess_form_buttons',
      'rubik_preprocess_form_node',
      'my_sub_rubik_preprocess_form_node', // Make sure our preprocess function is called
    ),
  );

  return $items;
}

/**
 * Preprocessor for theme('node_form').
 */
function my_sub_rubik_preprocess_form_node(&$vars) {
  // I have a custom field group call categories. So I look for $vars['form']['group_categories']
  if (isset($vars['form']['group_categories']) && empty($vars['sidebar'])) {
    $vars['sidebar']['group_categories'] = $vars['form']['group_categories'];
    unset($vars['form']['group_categories']);
  }
}
?>

Solve my issues. Also now I can add anything I want from that form on the sidebar.

kyletaylored’s picture

Issue summary: View changes
Status: Needs work » Closed (fixed)