Closed (fixed)
Project:
Address field for CCK
Version:
5.x-1.0
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
16 Mar 2007 at 10:02 UTC
Updated:
8 Jun 2007 at 21:47 UTC
I have a group that includes fields for name, county, precinct, and an address field. The view that I have created for this group doesn't display the address field.
Is this a problem with something that I am doing or just the way it works?
The address field only displays when I specify full node view, if I specify one of the list views or a table view, the address field shows a blank.
Comments
Comment #1
rconstantine commentedThat's a good question. I've only been using Drupal since January, so I'm not sure what the matter is. When a node isn't viewed in fully, what are the other options; teaser and block? Might I need to define something for them? Are you using my cck_fullname module for your name field? If not, try seeing if it gives you the same problem if you swap it out for the text field you're now using.
I'm going to need more details to try and figure this out.
Comment #2
rconstantine commentedI see that I need to add views support. I was under the impression from the cck docs that if I didn't do anything that cck had defaults that would kick in. Perhaps the defaults don't know what to do and I need to be more specific. I'll look into views since I'm sure I'll need them somewhere else anyway, and then commit any changes I make. I'll post a note here when I'm done. It may be while. Thanks for your patience. If you have any insight on what I need to do, let me know.
Comment #3
rconstantine commentedI added some calls to generic cck views integration functions. I don't know whether that is all I have to do or not. If anyone can test this, that would be great. I haven't gotten into views yet, so don't know how to go about checking my work.
BTW, Drupal.org's cron job will have the latest version up within 12 hours.
Comment #4
joemoraca commentedI'm not much help on why but the address still doesn't show up in a table view. I tried with the 5.x-1.0 and 5.x-1.x-dev
The dev didn't install correctly - I had to install the other first (maybe that was me...)
Don't feel bad the cck_fullname module is the same - doesn't show in views - so it may not be on your side.
Comment #5
joemoraca commentedCCK 5.x-1.5
Views 5.x-1.6-beta4
This is an export of my content type below it is an export of the view) I hope this helps someone
$content[type] = array (
'name' => 'Contact Info',
'type' => 'contact_info',
'description' => 'Use for Contact Info',
'title_label' => 'Company Name',
'body_label' => '',
'min_word_count' => '0',
'help' => '',
'node_options' =>
array (
'status' => true,
'promote' => true,
'sticky' => false,
'revision' => false,
),
'comment' => '0',
'old_type' => 'contact_info',
'orig_type' => '',
'module' => 'node',
'custom' => '1',
'modified' => '1',
'locked' => '0',
);
$content[fields] = array (
0 =>
array (
'widget_type' => 'cck_fullname',
'label' => 'contact_full_name',
'weight' => '-4',
'description' => '',
'group' => false,
'prefix' => '',
'suffix' => '',
'required' => '0',
'multiple' => '',
'middle_initial' => 1,
'max_length_first' => '40',
'max_length_middle' => 1,
'max_length_last' => '40',
'field_name' => 'field_contact_full_name',
'field_type' => 'cck_fullname',
'module' => 'cck_fullname',
),
1 =>
array (
'widget_type' => 'cck_address',
'label' => 'contact_address',
'weight' => '-3',
'description' => '',
'group' => false,
'prefix' => '',
'suffix' => '',
'required' => '0',
'multiple' => '',
'state_abbrv' => 0,
'max_length_street1' => '40',
'max_length_street2' => '40',
'max_length_city' => '40',
'field_name' => 'field_contact_address',
'field_type' => 'cck_address',
'module' => 'cck_address',
),
2 =>
array (
'widget_type' => 'email',
'label' => 'contact_email',
'weight' => '-2',
'size' => '60',
'link_type' => 'mailto',
'description' => '',
'default_value_widget' =>
array (
'field_contact_email' =>
array (
0 =>
array (
'email' => '',
),
),
),
'default_value_php' => '',
'group' => false,
'prefix' => '',
'suffix' => '',
'required' => '0',
'multiple' => '0',
'field_name' => 'field_contact_email',
'field_type' => 'email',
'module' => 'email',
),
3 =>
array (
'widget_type' => 'link',
'label' => 'contact_url',
'weight' => '-1',
'description' => '',
'default_value_widget' =>
array (
'field_contact_url' =>
array (
0 =>
array (
'url' => '',
'title' => '',
),
),
),
'default_value_php' => '',
'group' => false,
'prefix' => '',
'suffix' => '',
'required' => '0',
'multiple' => '0',
'title' => 'optional',
'display' =>
array (
'url_cutoff' => '80',
),
'attributes' =>
array (
'target' => 'default',
'rel' => 0,
'class' => '',
),
'field_name' => 'field_contact_url',
'field_type' => 'link',
'module' => 'link',
),
4 =>
array (
'widget_type' => 'file',
'label' => 'contact_file',
'weight' => '0',
'file_extensions' => 'txt doc sql',
'description' => '',
'field_contact_file_upload' => '',
'update' => 'Upload',
'default_value_php' => '',
'group' => false,
'prefix' => '',
'suffix' => '',
'required' => '0',
'multiple' => '0',
'field_name' => 'field_contact_file',
'field_type' => 'file',
'module' => 'filefield',
),
);
VIEW EXPORT
$view = new stdClass();
$view->name = 'Contact_Info';
$view->description = 'View of Contact Info Type';
$view->access = array (
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'Contact List';
$view->page_header = '';
$view->page_header_format = '1';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'table';
$view->url = 'contact-list';
$view->use_pager = TRUE;
$view->nodes_per_page = '10';
$view->sort = array (
);
$view->argument = array (
);
$view->field = array (
array (
'tablename' => 'node',
'field' => 'title',
'label' => 'Company Name',
'handler' => 'views_handler_field_nodelink',
'sortable' => '1',
'defaultsort' => 'ASC',
'options' => 'link',
),
array (
'tablename' => 'node_data_field_contact_full_name',
'field' => 'field_contact_full_name_first',
'label' => 'Person Name',
'handler' => 'content_views_field_handler_ungroup',
'sortable' => '1',
),
array (
'tablename' => 'node_data_field_contact_address',
'field' => 'field_contact_address_street1',
'label' => 'Address',
'handler' => 'content_views_field_handler_ungroup',
),
array (
'tablename' => 'node_data_field_contact_email',
'field' => 'field_contact_email_email',
'label' => 'E Mail',
'handler' => 'content_views_field_handler_ungroup',
'options' => 'default',
),
array (
'tablename' => 'node_data_field_contact_url',
'field' => 'field_contact_url_url',
'label' => 'Web Site',
'handler' => 'content_views_field_handler_ungroup',
'options' => 'default',
),
);
$view->filter = array (
);
$view->exposed_filter = array (
);
$view->requires = array(node, node_data_field_contact_full_name, node_data_field_contact_address, node_data_field_contact_email, node_data_field_contact_url);
$views[$view->name] = $view;
Comment #6
Torenware commentedI've seen this in a module I'm working on. To debug my issue, I installed your module and tried it out. In table view, Address Field doesn't display anything in table view either. It looks like either content.module's standard view handling does the wrong thing, or documentation of how to set things up right is missing, and folks like you and I haven't figured out yet what the "right" way is.
I'm discussing this with yched in http://drupal.org/node/137933 if you want to chime in.
Comment #7
rconstantine commentedThanks for the heads up, I'll check in with you guys on that thread as soon as I get a chance.
Comment #8
rconstantine commentedI figured out what I was doing wrong. Look for a dev release later today (5/25).
Comment #9
(not verified) commented