Dear everyone,

I'm still relatively new to the views module and still didn't quite get the hang of it. I've been trying to do something for days, and I can't seem to get it. I'm using Drupal 7 and I am trying to make a page where the user can see all his friends in one list, with name and picture.

For instance a user has two approved friends David and John (created by user relationships). I go and create a view, and under "Fields" I choose "User relationships: Requestee user" and under"FILTER CRITERIA" I choose "User relationships: Relationship status (= 1)". I can now see the names under content, but the weird thing is if I have no content created under "Administration>content" I have no names. If I have 1 content created I see David and John names twice. If I have 2 contents created I see David and Johns name twice repeated !

I don't understand why this happens. There seems to be a connections with the contents, but how ?

Comments

Shashwat Purav’s picture

Export the view and paste it here with for better understanding.

Thank You,
Shashwat Purav

Amjad_dokhan’s picture

Hi. Here is the exported view:

$view = new view();
$view->name = 'connections';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Connections';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Connections';
$handler->display->display_options['use_more_always'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['pager']['options']['items_per_page'] = '5';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Relationship: User relationships: Requestee user */
$handler->display->display_options['relationships']['requestee_id']['id'] = 'requestee_id';
$handler->display->display_options['relationships']['requestee_id']['table'] = 'user_relationships';
$handler->display->display_options['relationships']['requestee_id']['field'] = 'requestee_id';
/* Field: User relationships: Requestee user */
$handler->display->display_options['fields']['requestee_id']['id'] = 'requestee_id';
$handler->display->display_options['fields']['requestee_id']['table'] = 'user_relationships';
$handler->display->display_options['fields']['requestee_id']['field'] = 'requestee_id';
$handler->display->display_options['fields']['requestee_id']['relationship'] = 'requestee_id';
$handler->display->display_options['fields']['requestee_id']['label'] = '';
$handler->display->display_options['fields']['requestee_id']['element_label_colon'] = FALSE;
/* Filter criterion: User relationships: Relationship status */
$handler->display->display_options['filters']['approved']['id'] = 'approved';
$handler->display->display_options['filters']['approved']['table'] = 'user_relationships';
$handler->display->display_options['filters']['approved']['field'] = 'approved';
$handler->display->display_options['filters']['approved']['relationship'] = 'requestee_id';
$handler->display->display_options['filters']['approved']['value'] = '1';

/* Display: Block */
$handler = $view->new_display('block', 'Block', 'block');

adam91’s picture

Hye Shaswat, can you help me about views, I'm really2 stuck right now, Right now i working on views for Drupal 7, what i try to do right now is to categories my views based on 14 states without use any filter form, for example when you go to to page you can see all the view already categories based on state already without you need to filter any more..Ist have module that i can use without use coding

for example

State 1

Views-1 View-2 View-3 View-4

State 2

Views-1 views-2 views-3 views-4

until

state 14

views-1 views-2 views-3 views-4