Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Is anyone able to tell me how i might make any and all Content Taxonomy field(s) display in the right sidebar during node edits, just as core's Taxonomy displays in the sidebar in Rubik by default?
I am using Node Form Columns and i don't know PHP... but i think i can guess where a solution would be implemented, as seen in the code below.
Any help would be greatly appreciated.
/**
* Preprocessor for theme('node_form').
*/
function rubik_preprocess_form_node(&$vars) {
$vars['sidebar'] = isset($vars['sidebar']) ? $vars['sidebar'] : array();
// Support nodeformcols if present.
if (module_exists('nodeformcols')) {
$map = array(
'nodeformcols_region_right' => 'sidebar',
'nodeformcols_region_footer' => 'footer',
'nodeformcols_region_main' => NULL,
);
foreach ($map as $region => $target) {
if (isset($vars['form'][$region])) {
if (isset($vars['form'][$region]['#prefix'], $vars['form'][$region]['#suffix'])) {
unset($vars['form'][$region]['#prefix']);
unset($vars['form'][$region]['#suffix']);
}
if (isset($vars['form'][$region]['buttons'], $vars['form'][$region]['buttons'])) {
$vars['buttons'] = $vars['form'][$region]['buttons'];
unset($vars['form'][$region]['buttons']);
}
if (isset($target)) {
$vars[$target] = $vars['form'][$region];
unset($vars['form'][$region]);
}
}
}
}
// Default to showing taxonomy in sidebar if nodeformcols is not present.
elseif (isset($vars['form']['taxonomy'])) {
$vars['sidebar']['taxonomy'] = $vars['form']['taxonomy'];
unset($vars['form']['taxonomy']);
}
// Modification showing any and all Content Taxonomy field(s), if present, in sidebar
elseif (module_exists('content_taxonomy')) {
// Here's where the magic happens.
}
}
Comments
Comment #1
stephen Piscura CreditAttribution: stephen Piscura commentedSorry for the unclosed
<em>
tag in the second sentence. My mistake.Comment #2
aramboyajyan CreditAttribution: aramboyajyan commentedAll old and outdated
6.x
issues are being closed.Maintainer support will be provided only for major / blocking issues.
If you feel like this issue should be re-opened, feel free to do so.
Thanks!