Create a list of programs a particular DJ plays using Views
niallhatton - March 22, 2009 - 22:29
| Project: | Station |
| Version: | 6.x-2.x-dev |
| Component: | Programs |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hi, im using the Advanced Profile Kit to override the user profile screen. Station uses Views and APK uses Panels & views. I would to show a list excatly as station does on the standard profile page in a Panel on my APK profile. Can anyone help me out and point me in the right direction. Have not really got into these two modules yet and quite unsure how they work.
Kind regards
Niall

#1
Can anyone shed some light on this what so ever?? Am really getting close to my go live date and would love to get this working :D
Cheers
Niall
#2
Since they're node references you should be able to create a view that takes the user id as an argument on that field and list the referencing programs. You might need a views relationship or two to get it all working. Take a look at http://drewish.blip.tv/#1602091 if you're not familiar with Views relationships.
#3
Automatically closed -- issue fixed for 2 weeks with no activity.
#4
Hey I hate to reopen this, but I having no end of trouble trying to sort this out lol, ive came back to it again and again and still no luck, would you a gentlemen and give me a little bit more info on how to create this view and relationship.
Apoligies for bothering you again
Kind Regards
Niall
#5
#6
First off grab the latest -dev release since the views code has changed quite a bit. The try importing this view to get an idea how to do it:
<?php$view = new view;
$view->name = 'station_djs_programs';
$view->description = 'List a DJs programs';
$view->tag = 'station_schedule';
$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(
'title' => 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' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'title' => array(
'order' => 'ASC',
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'field_station_program_dj_uid' => array(
'default_action' => 'summary asc',
'style_plugin' => 'default_summary',
'style_options' => array(
'count' => 0,
'override' => 0,
'items_per_page' => '25',
),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => 'Programs with %1',
'breadcrumb' => '',
'default_argument_type' => 'user',
'default_argument' => '',
'validate_type' => 'user',
'validate_fail' => 'not found',
'break_phrase' => 0,
'not' => 0,
'id' => 'field_station_program_dj_uid',
'table' => 'node_data_field_station_program_dj',
'field' => 'field_station_program_dj_uid',
'validate_user_argument_type' => 'either',
'validate_user_roles' => array(
'2' => 0,
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_user' => 0,
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'station_album' => 0,
'station_playlist' => 0,
'station_program' => 0,
'station_schedule' => 0,
'page' => 0,
'story' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_php' => '',
'override' => array(
'button' => 'Override',
),
),
));
$handler->override_option('filters', array(
'status_extra' => array(
'operator' => '=',
'value' => '',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status_extra',
'table' => 'node',
'field' => 'status_extra',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'perm',
'perm' => 'view station program content',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('title', 'Programs by DJ');
$handler->override_option('style_options', NULL);
$handler->override_option('row_plugin', 'node');
$handler->override_option('row_options', array(
'relationship' => 'none',
'build_mode' => 'teaser',
'links' => 1,
'comments' => 0,
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'station/dj');
$handler->override_option('menu', array(
'type' => 'normal',
'title' => 'DJ',
'description' => '',
'weight' => '0',
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
?>
#7
actually added this as a disabled default view. you can grab the latest -dev and enable it then make any changes you need.
#8
Automatically closed -- issue fixed for 2 weeks with no activity.