Hello

I don't know how to use this module, is there any tutorial ? thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Category: support » task

Feel free to create a readme file. Every other user of this module managed to figure it out.

It's just a field in views.

core44’s picture

Not sure how someone asking how to use the module is able to write a readme?? Good luck with that freelylw.

My quick guide based on my usage would be: create a view (child) and a view (parent). In the child view add the fields you want to display and also add an argument (in my case NID). In the parent view add the fields you want to use and also add 'views field view' (under global category in add fields), select your child view in the drop down for the field settings. You can then choose from the available replacement tokens what data you want to pass back to the child view. In my case it was the data from a hidden field for NID. (EDIT: you have to update the 'views field view' once you've selected the view in the drop down, then edit it again before you get the argument options)

I used the module to display comments from each of the nodes in my parent view, I don't know if what I'm doing is standard usage but it solved my needs. Hope that's more helpful than "create your own readme file".

MBroberg’s picture

I was thinking the same thing, filthypixel, and thanks for the tips. I had written myself some notes since I keep forgetting. Pretty much the same as yours, but I formatted it in steps and there are a few extra notes.

1. Create a Child View.
2. Add arguments to that child view. The parent view will be passing argument values to the child so that the child knows what to display. No other settings are necessary, but validators and "argument not present" could be set.
3. Create a Parent View.
4. Add Child View (Global field). Must be toward the bottom of the field list, or at least underneath the fields that are going to be used as arguments. (e.g "node id" might be used as an match between the parent and child views, so put "node id" before your global view field in the list.)
5. Select which View and Display to use for the child data (will require doing this in 2 steps - the field must be saved before the display selection is available)
6. Type the token replacements, in order, separated by a comma, as the arguments for that view field. These values will be passed to the child. Make sure each field you are passing as an argument is completely clean, as in: no label, no formatting, nothing that would pass into the argument other than the desired text or number.

Avalanche’s picture

Dereine, I respect your contributions to Drupal and the open-source community, but there's no reason to be a dick.

Thanks mbroberg and filthypixel, your advise helped me a lot. I'm working on a deadline and needed to access a field from Feeds to get it to work in Gmap with Location, and this helps tremendously.

dawehner’s picture

Well some days i try to help as much as possible and then there are issues like this.

At least from my perspective regardless whether there is someone provides a solution or not, there will be no response anymore.
Isn't This module allows to embed a view as a field in a view. already quite some information to start and ask a real question instead asking for a tutorial? Drupal is just not the best system to ask for a tutorial because it's so flexible

misterT’s picture

Isn't This module allows to embed a view as a field in a view. already quite some information to start and ask a real question

No, it's not. This provides no information as to what kinds of relationships are allowed between views or how to pass information from one view to another, for example. Documentation would be very helpful, and I'm glad I found this page. Thank you for making this module. From the information on this page, it sounds like it might be what I'm looking for, so I'll go ahead and give it a try.

cdd23’s picture

Well, I hope it's not impolite to kick this issue up again, but I still don't fully understand how to employ this module. This may be in part to my incomplete understanding of Views. I've read through the documentation for Views (Relationships and Arguments trip me up a bit), but I'm still having trouble using this module.

I'm trying to make an events calendar view. There is a limited set of possible speakers for the events.

So I've got an "Event" content type and a "Speaker" content type. Each "Event" has one or more "Speakers" associated with it. I want my listing of Events to display all the Speakers in the same line as the event, e.g.:

Date       Event         Speaker                              City/Town
8/17      Speech       Joe Smith                              Springfield
8/18      Speech2    Joe Smith, Shelly Jones             Capital City

Since Views in Drupal 6 doesn't allow for multiple items, I was directed to this module by other helpful folks. I have set up a child view as directed by the posts above, but I don't get any value displayed in the column for the Speakers. I've tried changing the settings for the Child view (like adding other arguments aside from Node ID) and the settings for the Global View but to no avail. I always get an empty last column, the views_field_view column I've added while I test this. That column should show the same as the "Speaker" column (which only displays the first speaker, since it's a normal field).

I'm wondering if it's my arguments that are the problem. I've set it to the same as the "Speaker" column, like so:

'arguments' => '[title_1]',

Anyone have any helpful ideas as to what I'm missing or doing wrong? Or suggestions to where I might read up more on this? My apologies if this case is too specific to be generally helpful, but it seems like a common enough scenario for this module.

Just to be thorough, here are the exports of the two views.

Child View:

$view = new view;
$view->name = 'event_list_speakers';
$view->description = 'List of Speakers for multiple speaker events';
$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_speaker_nid' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'label_type' => 'none',
    'format' => 'default',
    'multiple' => array(
      'group' => 1,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => 0,
    ),
    'exclude' => 0,
    'id' => 'field_speaker_nid',
    'table' => 'node_data_field_speaker',
    'field' => 'field_speaker_nid',
    'relationship' => 'none',
  ),
));
$handler->override_option('arguments', array(
  'nid' => array(
    'default_action' => 'ignore',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => '',
    'breadcrumb' => '',
    'default_argument_type' => 'fixed',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'not found',
    'break_phrase' => 0,
    'not' => 0,
    'id' => 'nid',
    'table' => 'node',
    'field' => 'nid',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
      '2' => 0,
      '3' => 0,
      '4' => 0,
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_fixed' => '',
    'default_argument_user' => 0,
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'event' => 0,
      'speaker' => 0,
      'location' => 0,
      'page' => 0,
      'story' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '1' => 0,
      '2' => 0,
    ),
    'validate_argument_type' => 'tid',
    'validate_argument_transform' => 0,
    'validate_user_restrict_roles' => 0,
    'validate_argument_php' => '',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));

=============================
Parent View:

$view = new view;
$view->name = 'event_list';
$view->description = 'List of Events';
$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('relationships', array(
  'field_speaker_nid' => array(
    'label' => 'Speaker',
    'required' => 0,
    'delta' => '-1',
    'id' => 'field_speaker_nid',
    'table' => 'node_data_field_speaker',
    'field' => 'field_speaker_nid',
    'relationship' => 'none',
  ),
));
$handler->override_option('fields', array(
  'field_date_value' => array(
    'label' => 'Date',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'label_type' => 'widget',
    'format' => 'short',
    'multiple' => array(
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_to' => '',
      'group' => '',
    ),
    'repeat' => array(
      'show_repeat_rule' => '',
    ),
    'fromto' => array(
      'fromto' => 'both',
    ),
    'exclude' => 0,
    'id' => 'field_date_value',
    'table' => 'node_data_field_date',
    'field' => 'field_date_value',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'title' => array(
    'label' => 'Event',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'title_1' => array(
    'label' => 'Speaker',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_node' => 0,
    'exclude' => 0,
    'id' => 'title_1',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'field_speaker_nid',
  ),
  'city' => array(
    'label' => 'City or Town',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'exclude' => 0,
    'id' => 'city',
    'table' => 'location',
    'field' => 'city',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'name' => array(
    'label' => 'Type of Event',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
      'strip_tags' => 0,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'link_to_taxonomy' => 0,
    'exclude' => 1,
    'id' => 'name',
    'table' => 'term_data',
    'field' => 'name',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'view' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => FALSE,
      'text' => '',
      'make_link' => FALSE,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'target' => '',
      'help' => '',
      'trim' => FALSE,
      'max_length' => '',
      'word_boundary' => TRUE,
      'ellipsis' => TRUE,
      'html' => FALSE,
      'strip_tags' => FALSE,
    ),
    'empty' => '',
    'hide_empty' => 0,
    'empty_zero' => 0,
    'view' => 'event_list_speakers',
    'display' => 'default',
    'arguments' => '[title_1]',
    'exclude' => 0,
    'id' => 'view',
    'table' => 'views',
    'field' => 'view',
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'event' => 'event',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
  'field_date_value' => array(
    'operator' => '>=',
    'value' => array(
      'value' => NULL,
      'min' => NULL,
      'max' => NULL,
      'default_date' => 'now',
      'default_to_date' => '',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'date_fields' => array(
      'node_data_field_date.field_date_value' => 'node_data_field_date.field_date_value',
    ),
    'date_method' => 'OR',
    'granularity' => 'day',
    'form_type' => 'date_select',
    'default_date' => 'now',
    'default_to_date' => '',
    'year_range' => '-3:+3',
    'id' => 'field_date_value',
    'table' => 'node_data_field_date',
    'field' => 'field_date_value',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('title', 'Event List');
$handler->override_option('header', 'A list of events. You can sort by location, speaker, type of event, or date.');
$handler->override_option('header_format', '1');
$handler->override_option('header_empty', 0);
$handler->override_option('items_per_page', 30);
$handler->override_option('use_more', 1);
$handler->override_option('use_more_always', 0);
$handler->override_option('distinct', 1);
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'field_date_value' => 'field_date_value',
    'title' => 'title',
    'title_1' => 'title_1',
    'city' => 'city',
  ),
  'info' => array(
    'field_date_value' => array(
      'sortable' => 1,
      'separator' => '',
    ),
    'title' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'title_1' => array(
      'sortable' => 1,
      'separator' => '',
    ),
    'city' => array(
      'sortable' => 1,
      'separator' => '',
    ),
  ),
  'default' => 'field_date_value',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'events-list');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->override_option('arguments', array(
  'field_speaker_nid' => array(
    'default_action' => 'default',
    'style_plugin' => 'default_summary',
    'style_options' => array(),
    'wildcard' => 'all',
    'wildcard_substitution' => 'All',
    'title' => '',
    'breadcrumb' => '',
    'default_argument_type' => 'node',
    'default_argument' => '',
    'validate_type' => 'none',
    'validate_fail' => 'not found',
    'break_phrase' => 0,
    'not' => 0,
    'id' => 'field_speaker_nid',
    'table' => 'node_data_field_speaker',
    'field' => 'field_speaker_nid',
    'validate_user_argument_type' => 'uid',
    'validate_user_roles' => array(
      '2' => 0,
      '3' => 0,
      '4' => 0,
    ),
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
    'default_options_div_prefix' => '',
    'default_argument_fixed' => '',
    'default_argument_user' => 0,
    'default_argument_php' => '',
    'validate_argument_node_type' => array(
      'event' => 0,
      'speaker' => 0,
      'location' => 0,
      'page' => 0,
      'story' => 0,
    ),
    'validate_argument_node_access' => 0,
    'validate_argument_nid_type' => 'nid',
    'validate_argument_vocabulary' => array(
      '1' => 0,
      '2' => 0,
    ),
    'validate_argument_type' => 'tid',
    'validate_argument_transform' => 0,
    'validate_user_restrict_roles' => 0,
    'validate_argument_php' => '',
  ),
));
$handler->override_option('filters', array(
  'type' => array(
    'operator' => 'in',
    'value' => array(
      'event' => 'event',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'relationship' => 'none',
  ),
  'field_date_value' => array(
    'operator' => '>=',
    'value' => array(
      'value' => NULL,
      'min' => NULL,
      'max' => NULL,
      'default_date' => 'now',
      'default_to_date' => '',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'date_fields' => array(
      'node_data_field_date.field_date_value' => 'node_data_field_date.field_date_value',
    ),
    'date_method' => 'OR',
    'granularity' => 'day',
    'form_type' => 'date_select',
    'default_date' => 'now',
    'default_to_date' => '',
    'year_range' => '-3:+3',
    'id' => 'field_date_value',
    'table' => 'node_data_field_date',
    'field' => 'field_date_value',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'field_speaker_nid' => array(
    'operator' => 'or',
    'value' => array(),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'field_speaker_nid',
    'table' => 'node_data_field_speaker',
    'field' => 'field_speaker_nid',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'field_speaker_nid',
    'reduce_duplicates' => 0,
  ),
));
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
sprice’s picture

@aceinthehole please see: http://drupal.org/dcoc#respect

The module is under heavy development, so please allow the maintainers to maintain before they create the documentation.

dawehner’s picture

Title: how to use this module? no readme file ? » Provide a helpful readme file

This issue is NOT about

  • Complaing about the module
  • Complaining about the missing readme file
  • Support for the module
  • Any other venting about "Everything"

This issue is about providing a good README file, everything else is not productive.

mototribe’s picture

this is a great module. How about using the instructions from #3 and create a simple documentation page from it?

dawehner’s picture

Just do it :)

jvns’s picture

FileSize
162 bytes

Here are the instructions from #3 (more or less) copied into a README file.

damiankloip’s picture

Isn't this the readme file from the sites/al/modules directory?

carvalhar’s picture

version 7 doesn't have a readme...thkz for #2 e #3

beanluc’s picture

Here's a proper patch containing a README substantially from #3 and the project page.

beanluc’s picture

Component: Miscellaneous » Documentation
Assigned: Unassigned » beanluc
Status: Active » Needs review
damiankloip’s picture

@beanluc, thanks! I will check this out later today. I have been refactoring alot of the token functionality, so hopefully, soon, it will be much better!

damiankloip’s picture

Status: Needs review » Fixed

This has been committed to 7.x-1.x and 6.x-1.x branches. The patch wouldn't apply cleanly, so had to make a few adjustments :)

Status: Fixed » Closed (fixed)

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

alibama’s picture