How can I choose a default for all parents (preferably by a certain node type) for the "embed children view" setting? Right now in order for the children to show up in the node view, the creator of a parent object has to change the "embed children view" from "NONE" to some other view. I've created a view that I always want to use for the "embed children view" of that particular type of parent, but in order for the creator to use it I have to write detailed help instructions on how to expand the "Node Hierarchy" section and choose the view I created. It would be far better if that field could already be pre-filled in based on some default setting that I can choose elsewhere.

Is this currently possible?

Comments

Mac Clemmens’s picture

I had put this under another active issue. I think it addresses what you are talking about:

#4
Digital Deployment - October 5, 2008 - 18:14
Version: 6.x-1.0 » 6.x-1.x-dev

... it would also be great if we could set a default Embed Children View per content type.

It looks like in order to do this, we would need to add a function like
function _nodehierarchy_get_parent_pulldown and _nodehierarchy_views_view_options()

Would adding the lines indicated below accomplish this?

-NOTE-PLEASE DO NOT TRY THIS CODE ON A PRODUCTION SITE- It has not been tested; I'm just writing it off the top of my head for the purposes of illustrating an idea-

function _nodehierarchy_get_node_type_settings_form($key, $append_key = FALSE) {
  $form = array();
  $form[($append_key ? ('nh_parent_'. $key) : 'nh_parent')] = array(
    '#type' => 'checkbox',
    '#title' => t('Can be parent'),
    '#default_value' => variable_get('nh_parent_'. $key, FALSE),
    '#description' => t('Other nodes can be created as child nodes of this node type.')
  );
  $form[($append_key ? ('nh_child_'. $key) : 'nh_child')] = array(
    '#type' => 'checkbox',
    '#title' => t('Can be child'),
    '#default_value' => variable_get('nh_child_'. $key, FALSE),
    '#description' => t('This node type can be created as a child of other nodes.')
  );
  $form[($append_key ? ('nh_defaultparent_'. $key) : 'nh_defaultparent')] = _nodehierarchy_get_parent_pulldown($key, variable_get('nh_defaultparent_'. $key, 0), t('Default Parent'));

/*
----------------BEGIN ADDED CODE----------------------
*/

  $form[($append_key ? ('nh_children_view_']. $key) : 'nh_children_view')] = array(
  '#type'           => 'select',
  '#title'          => "Embed Children View",
  '#multiple'       => FALSE,
  '#options'        => _nodehierarchy_views_view_options(),
  '#required'       => FALSE,
  '#default_value' => variable_get('nodehierarchy_children_view_' . $key),
  '#description'    => t("Embed a view containing this node's children into the node's page view"),
);

*/
-----------------END----------------------
*/
 
  return $form;
}
ronan’s picture

Status: Active » Fixed

This is now in dev.

Thanks
R

Status: Fixed » Closed (fixed)

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

aimevp’s picture

Component: Miscellaneous » User interface
Category: support » feature

Hi,

Wouldn't it be also a good idea to provide a select box per language? I use the insert_view module to show a view within a page. In that case if only one possible selection per content type is possible i would be in a bit of a trouble.

If i'm not mistaken you have the same ability when using the Auto menu or Pathauto modules.

Grtzzz,
Hatznie.