My case: I have a parent cck content "activity" which contains a cck nodereference fields to children nodes "sponsor". I just need to show the children nodes in a block and not in the main content body. Tried to use arguments and field_activity_sponsor as the condition and "provide default argument" => get node ID from url, but there is no way to make my children nodes to appear on the parent content page.

My support request follows some hours already spent looking for an answer to my needs.

Comments

dawehner’s picture

In theory it would be easy:

  • Add the argument
  • Provide the default argument
  • Add a filter for the sponsor nodetype, so that not wanted nodes are not shown

Perhaps you missed to add the filter.

pulpzebra’s picture

no... the filter is okay, and I believe I am missing something obvious.

here's the view:

$view = new view;
$view->name = 'sponsor';
$view->description = 'Sponsor';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'field_sponsor_url_url' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_node' => 0,
    'label_type' => 'none',
    'format' => 'url',
    'multiple' => array(
      'group' => TRUE,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => FALSE,
    ),
    'exclude' => 1,
    'id' => 'field_sponsor_url_url',
    'table' => 'node_data_field_sponsor_url',
    'field' => 'field_sponsor_url_url',
    'relationship' => 'none',
  ),
  'field_sponsor_logo_fid' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 1,
      'path' => '[field_sponsor_url_url]',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_node' => 0,
    'label_type' => 'none',
    'format' => 'thumb_120_default',
    'multiple' => array(
      'group' => TRUE,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => FALSE,
    ),
    'exclude' => 0,
    'id' => 'field_sponsor_logo_fid',
    'table' => 'node_data_field_sponsor_logo',
    'field' => 'field_sponsor_logo_fid',
    'relationship' => 'none',
  ),
  'field_sponsor_url_url_1' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_node' => 0,
    'label_type' => 'none',
    'format' => 'default',
    'multiple' => array(
      'group' => TRUE,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => FALSE,
    ),
    'exclude' => 0,
    'id' => 'field_sponsor_url_url_1',
    'table' => 'node_data_field_sponsor_url',
    'field' => 'field_sponsor_url_url',
    'relationship' => 'none',
  ),
));
$handler->override_option('arguments', array(
  'field_progetto_sponsor_nid' => array(
    'default_action' => 'default',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => '',
    'breadcrumb' => '',
    'default_argument_type' => 'php',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'not found',
    'break_phrase' => 0,
    'not' => 0,
    'id' => 'field_progetto_sponsor_nid',
    'table' => 'node_data_field_progetto_sponsor',
    'field' => 'field_progetto_sponsor_nid',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
      '2' => 0,
      '4' => 0,
      '3' => 0,
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_user' => 0,
    'default_argument_fixed' => '',
    'default_argument_php' => 'list( $a, $b ) = explode( \'/\', $_GET[ \'q\' ] );

if ( is_numeric( $b ) ) {
return $b;
}',
    'validate_argument_node_type' => array(
      'webform' => 0,
      'annunci' => 0,
      'area' => 0,
      'comune' => 0,
      'comunicazione' => 0,
      'download' => 0,
      'page' => 0,
      'progetto' => 0,
      'provincia' => 0,
      'regione' => 0,
      'settori' => 0,
      'simplenews' => 0,
      'sponsor' => 0,
      'story' => 0,
      'struttura' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '3' => 0,
      '1' => 0,
    ),
    'validate_argument_type' => 'tid',
    'validate_argument_transform' => 0,
    'validate_user_restrict_roles' => 0,
    'validate_argument_php' => '',
  ),
));
$handler->override_option('filters', array(
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'sponsor' => 'sponsor',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('header', 'Sponsor');
$handler->override_option('header_format', '3');
$handler->override_option('header_empty', 1);
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);

shane birley’s picture

Status: Active » Postponed (maintainer needs more info)

Closing this ticket due to inactivity. @pulpzebra, please feel free to re-open this issue should you require additional help. Thanks!

esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)