Hi,

How can I Export or download Search Results as CSV file so that its viewable in a Excel file? Has anyone used the VBO module to do this? The download link will be available to anonymous users.

Thanks

Ceci

Comments

sjugge’s picture

Check out the views data export module http://drupal.org/project/views_data_export

It adds a display to the views ui which allows you to export views data to a path/file. By using some exposed filters for fields etc you can probably achieve what you want. I have played around with the latest 7.x release a bit myself last week and it seems to be really good at what it does.

ceci123’s picture

First of all thank you for your kind response. I downloaded and installed views_data_export module on my dev box and am playing with it right now.

I have a minor problem. I am not using VIEWS which seems this module was built for. Perhaps you can help me some more or point me to the right direction.

I have a custom CONTENT TYPE called drugs and I am using Drupal's CORE SEARCH module to search these drugs on the content type. So there is no views involved.

Take a look at this screenshots and you will know what I mean....

SEE SCREENSHOTS HERE

Do you still think I could somehow be able to use the views_data_export module?

Thank you.

Ceci.

sjugge’s picture

Hey,

first of, let's forget about using search to make your list you want to export to CSV. Search is a good way for finding things but for the customisation you need, you'll want to be using the views module. And yes, to leverage views data export, you'll need views. If you are not familiar with the views module, I realize it can be scary at first so you might want to look up some documentation and/or screencasts on it. Think of it as a tool to create lists of content (and other things) and to customize it's display, whether it needs to be a block, page (path), or data export.

Now, I don't have a D6 install at hand, nor do I have you content type and content so I'll try to explain this as best as I can. Basically we'll be building a custom web app to fit your needs.

- Go to the views interface and create a new view.
- Add a page display and a data export display, set their paths.
- In the data display, under export settings, set to attach to page.
- Under format settings, set to CSV file. In it's settings check of 'provide as file' and 'parent sort'.
- Go back to your page display. You should have a small orange block at the bottom left labeled 'CSV' where you can download the file.
- Add the fields you'll want to display in your CSV file.
- Under 'filter' you'll be able to set limitations to the results in your view (file). Set the node content type to drugs. (Node itle, author list, source, keywords, paper id, medication name and so on), you can optionally tweak these fields to your needs.
You probably want to expose these filters, this enables your users to filter the results in the view by their needs and create customs listings of your content.

Again, I don't have a D6 installation where I can test this out but it works like a charm on D7 if you follow these instructions. Some things might be named slightly different but the basics should be the same.
Hope this gets you on your way, drop a line when you run into some issues or when you managed to get the result you wanted.

sjugge’s picture

Hey, I had some unexpected free time this afternoon so I set up a local D6 site (which I needed if I wanted to give some proper help in the forums and to brush up on my D6 in general) and created a quick view with a page and csv export for you (see code below). It assumes you have views 6.x-2.12 and views data export 6.x-2.0-beta4 installed and enabled.

It creates a page (which displays fields - set to display the node title) at yoursite.com/csv_generator with an exposed filter for the node title. You can add fields to display and (exposed) filters as needed.

There's a data export attached to the page, so that you click the 'csv' link (bottom right in the Garland theme), a csv file will be generated with the search results.

Simply import the views code (preferably on a local or test site) below at yoursite.com/admin/build/views/import and tweak as needed.

$view = new view;
$view->name = 'data_export';
$view->description = 'export view with exposed filters to csv';
$view->tag = 'data_export';
$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' => 'Title',
    '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',
    'table' => 'node',
    'field' => 'title',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'title' => array(
    'operator' => 'contains',
    'value' => '',
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
      'use_operator' => 1,
      'operator' => 'title_op',
      'identifier' => 'title',
      'label' => 'Node: Title',
      'optional' => 1,
      'remember' => 0,
    ),
    'case' => 1,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'csv_generator');
$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('views_data_export', 'Data export', 'views_data_export_1');
$handler->override_option('items_per_page', '0');
$handler->override_option('style_plugin', 'views_data_export_csv');
$handler->override_option('style_options', array(
  'mission_description' => FALSE,
  'description' => '',
));
$handler->override_option('row_plugin', '');
$handler->override_option('path', 'csv_export');
$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->override_option('displays', array(
  'default' => 'default',
  'page_1' => 'page_1',
));
$handler->override_option('sitename_title', FALSE);
$handler->override_option('use_batch', TRUE);
ceci123’s picture

Hi sjugge.

I really appreciate you going the extra mile to help me out. I hope your code will also help someone else in the community as well.

So I imported your code and got a page generated. I searched for a drug name and 10 items were returned. Clicked the 'csv' link and happily generated the 'csv' page. However, the page that was generated returns all the items from the database.

How can I prevent it from returning all the items from the database and only grab the items returned from the search result? In my example above 10 items.

Thanks again.

Ceci

sjugge’s picture

I don't seem to have that issue, I've done quite a few exports with different searches and had the results in CSV which I had on the page. I've tweaked the view a bit so that it displays the search results with a pager so you have an idea of how many results you actually have after a search. I also set the query results to be distinct to ensure there are no double entries and filter out unpublished content (kinda overlooked that one).
I also set a filter per content type which you'll need to set to your custom content type.

Try a few searches with the code below...

$view = new view;
$view->name = 'data_export';
$view->description = 'export view with exposed filters to csv';
$view->tag = 'data_export';
$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' => 'Title',
    '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',
    'table' => 'node',
    'field' => 'title',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'title' => array(
    'operator' => 'contains',
    'value' => '',
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
      'use_operator' => 1,
      'operator' => 'title_op',
      'identifier' => 'title',
      'label' => 'Node: Title',
      'optional' => 1,
      'remember' => 0,
    ),
    'case' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('use_pager', '1');
$handler->override_option('distinct', 1);
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'csv_generator');
$handler->override_option('menu', array(
  'type' => 'normal',
  'title' => 'CSV generator',
  'description' => 'example of a generic csv exporter set up in views',
  'weight' => '0',
  'name' => 'primary-links',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler = $view->new_display('views_data_export', 'Data export', 'views_data_export_1');
$handler->override_option('items_per_page', '0');
$handler->override_option('style_plugin', 'views_data_export_csv');
$handler->override_option('style_options', array(
  'mission_description' => FALSE,
  'description' => '',
));
$handler->override_option('row_plugin', '');
$handler->override_option('path', 'csv_export');
$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->override_option('displays', array(
  'default' => 'default',
  'page_1' => 'page_1',
));
$handler->override_option('sitename_title', FALSE);
$handler->override_option('use_batch', '1');
ceci123’s picture

Hi sjugge,

I think your solution might actually work for me. I would like to compensate for your efforts (am serious). To be honest I really didn't know how I was going to pull this off. Thanks to you I am getting closer.

I have another question. When I click on the csv_generator menu link it lists/shows all the items from the database. Is there a way to NOT show anything by default?

In other words, when a user clicks on the csv_generator link it should only shows the dropdown menu and the text field.

Thanks again

Ceci

sjugge’s picture

well, in D6 there's no way of starting with an empty view. But there's a little workaround.
I added a little text ("enter the title you want to find") in the exposed field for the title which you can tweak as you desire in the field setting of the filter and that will return no result since there is no such item as search result. It is a workaround but it also adds some user friendliness ;)

try this...

$view = new view;
$view->name = 'data_export';
$view->description = 'export view with exposed filters to csv';
$view->tag = 'data_export';
$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' => 'Title',
    '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',
    'table' => 'node',
    'field' => 'title',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'title' => array(
    'operator' => 'contains',
    'value' => 'enter the title you want to find',
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
      'use_operator' => 1,
      'operator' => 'title_op',
      'identifier' => 'title',
      'label' => 'Node: Title',
      'optional' => 1,
      'remember' => 0,
    ),
    'case' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('use_pager', '1');
$handler->override_option('distinct', 1);
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'csv_generator');
$handler->override_option('menu', array(
  'type' => 'normal',
  'title' => 'CSV generator',
  'description' => 'example of a generic csv exporter set up in views',
  'weight' => '0',
  'name' => 'primary-links',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler = $view->new_display('views_data_export', 'Data export', 'views_data_export_1');
$handler->override_option('items_per_page', '0');
$handler->override_option('style_plugin', 'views_data_export_csv');
$handler->override_option('style_options', array(
  'mission_description' => FALSE,
  'description' => '',
));
$handler->override_option('row_plugin', '');
$handler->override_option('path', 'csv_export');
$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->override_option('displays', array(
  'default' => 'default',
  'page_1' => 'page_1',
));
$handler->override_option('sitename_title', FALSE);
$handler->override_option('use_batch', '1');
ceci123’s picture

The user will have to live with it. I will mess with it more tonight.

How hard would it be to turn each result item into a checkbox for the user to check it and export it only CHECKED Items?

Something like this: http://img.skitch.com/20090409-t2ygns7u29mtwq4w36ey4ybdmc.png

Thanks again.

Ceci

sjugge’s picture

Well, it's rather do-able...

You'll need to install/enable the following modules:

Flag 6.x-2.x-dev (6.x-2.0-beta5 might work, not sure)
Views Bulk Operations 6.x-1.x-dev (6.x-1.10 might work, not sure)

import the following code at /admin/build/flags/import

$flags = array();
// Exported flag: "export".
$flags['export'] = array(
  'content_type' => 'node',
  'title' => 'export',
  'global' => '0',
  'types' => array(
    '0' => 'blog',
    '1' => 'book',
    '2' => 'forum',
    '3' => 'page',
    '4' => 'panel',
    '5' => 'poll',
    '6' => 'story',
    '7' => 'features_test',
  ),
  'flag_short' => 'export',
  'flag_long' => 'include this result in csv file export',
  'flag_message' => 'will be exported',
  'unflag_short' => 'do not export',
  'unflag_long' => 'exclude from csv file export',
  'unflag_message' => 'excluded from cvs file export',
  'unflag_denied_text' => '',
  'link_type' => 'toggle',
  'roles' => array(
    'flag' => array(
      '0' => '2',
    ),
    'unflag' => array(
      '0' => '2',
    ),
  ),
  'show_on_page' => 1,
  'show_on_teaser' => 1,
  'show_on_form' => 0,
  'access_author' => '',
  'i18n' => 0,
  'flag_confirmation' => 'result will be exported in the csv file export',
  'unflag_confirmation' => 'exclude this result from cvs file export',
  'api_version' => 2,
);
return $flags;

import the following code at /admin/build/views/import

$view = new view;
$view->name = 'data_export';
$view->description = 'export view with exposed filters to csv';
$view->tag = 'data_export';
$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(
  'flag_content_rel' => array(
    'label' => 'export',
    'required' => 0,
    'flag' => 'export',
    'user_scope' => 'current',
    'id' => 'flag_content_rel',
    'table' => 'node',
    'field' => 'flag_content_rel',
    'relationship' => 'none',
  ),
));
$handler->override_option('fields', array(
  'title' => array(
    'label' => 'Title',
    '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',
    'table' => 'node',
    'field' => 'title',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'title' => array(
    'operator' => 'contains',
    'value' => 'enter the title you want to find',
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
      'use_operator' => 1,
      'operator' => 'title_op',
      'identifier' => 'title',
      'label' => 'Node: Title',
      'optional' => 1,
      'remember' => 0,
    ),
    'case' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'flagged' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'flagged',
    'table' => 'flag_content',
    'field' => 'flagged',
    'relationship' => 'flag_content_rel',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('header_format', '1');
$handler->override_option('header_empty', 0);
$handler->override_option('use_pager', '1');
$handler->override_option('distinct', 1);
$handler->override_option('style_plugin', 'bulk');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'title' => 'title',
  ),
  'info' => array(
    'title' => array(
      'sortable' => 0,
      'separator' => '',
    ),
  ),
  'default' => '-1',
  'execution_type' => '1',
  'display_type' => '0',
  'hide_selector' => 0,
  'preserve_selection' => 1,
  'display_result' => 1,
  'merge_single_action' => 1,
  'operations' => array(
    'flag_nodes-1980f2a3af0b5c3577850d4ba2600405' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'node_assign_owner_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'views_bulk_operations_delete_node_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'node_mass_update-a27b9efabcd054685a549378b174ad11' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'system_message_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'token_actions_message_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'flag_nodes-2ff450f78dcf652c3957a558fc901e12' => array(
      'selected' => 1,
      'skip_confirmation' => 0,
      'label' => 'unselect for export to csv file',
    ),
    'views_bulk_operations_ruleset_action_rules_set_1' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'views_bulk_operations_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'views_bulk_operations_script_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'flag_nodes-f2c4e9c11c57ad95d4fef2c7565d33dc' => array(
      'selected' => 1,
      'skip_confirmation' => 0,
      'label' => 'select for export to csv file',
    ),
    'node_make_sticky_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'node_make_unsticky_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'node_mass_update-c4d3b28efb86fd703619a50b74d43794' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'views_bulk_operations_fields_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
      'settings' => array(
        'php_code' => 0,
        'show_tokens' => 0,
        'display_fields' => array(
          '_all_' => '_all_',
        ),
      ),
    ),
    'views_bulk_operations_taxonomy_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'views_bulk_operations_argument_selector_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'node_promote_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'node_mass_update-14de7d028b4bffdf2b4a266562ca18ac' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'node_mass_update-9c585624b9b3af0b4687d5f97f35e047' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'node_publish_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'token_actions_goto_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'system_goto_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'node_unpromote_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'node_mass_update-8ce21b08bb8e773d10018b484fe4815e' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'node_save_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'system_send_email_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'token_actions_send_email_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'flag_nodes-76e4c513dfadc798e2eb84ad0a677401' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'node_mass_update-0ccad85c1ebe4c9ceada1aa64293b080' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'node_unpublish_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'node_unpublish_by_keyword_action' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
    'pathauto_node_update_alias_multiple-620e193b20ba9caa374fea9ca0ad38f0' => array(
      'selected' => 0,
      'skip_confirmation' => 0,
      'label' => '',
    ),
  ),
));
$handler = $view->new_display('page', 'CSV generator by search', 'page_1');
$handler->override_option('filters', array(
  'title' => array(
    'operator' => 'contains',
    'value' => 'enter the title you want to find',
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
      'use_operator' => 1,
      'operator' => 'title_op',
      'identifier' => 'title',
      'label' => 'Node: Title',
      'optional' => 1,
      'remember' => 0,
    ),
    'case' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('footer', '<a href="http://yoursite.com/csv_export_search">export this search to a .csv file</a> or select items to include in <a href="http://yoursite.com/csv_export_selection">your selection</a>');
$handler->override_option('footer_format', '1');
$handler->override_option('footer_empty', 1);
$handler->override_option('path', 'csv_generator');
$handler->override_option('menu', array(
  'type' => 'normal',
  'title' => 'CSV generator by search',
  'description' => 'example of a generic csv exporter set up in views',
  'weight' => '0',
  'name' => 'primary-links',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler = $view->new_display('views_data_export', 'Data export search', 'views_data_export_1');
$handler->override_option('fields', array(
  'title' => array(
    'label' => 'Title',
    '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',
    'table' => 'node',
    'field' => 'title',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'ops' => 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_type' => 'toggle',
    'exclude' => 1,
    'id' => 'ops',
    'table' => 'flag_content',
    'field' => 'ops',
    'relationship' => 'flag_content_rel',
    'override' => array(
      'button' => 'Use default',
    ),
  ),
));
$handler->override_option('filters', array(
  'title' => array(
    'operator' => 'contains',
    'value' => 'enter the title you want to find',
    'group' => '0',
    'exposed' => TRUE,
    'expose' => array(
      'use_operator' => 1,
      'operator' => 'title_op',
      'identifier' => 'title',
      'label' => 'Node: Title',
      'optional' => 1,
      'remember' => 0,
    ),
    'case' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
  'status' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'node',
    'field' => 'status',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('items_per_page', '0');
$handler->override_option('style_plugin', 'views_data_export_csv');
$handler->override_option('style_options', array(
  'mission_description' => FALSE,
  'description' => '',
));
$handler->override_option('row_plugin', '');
$handler->override_option('path', 'csv_export_search');
$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->override_option('displays', array(
  'default' => 0,
  'page_1' => 0,
));
$handler->override_option('sitename_title', FALSE);
$handler->override_option('use_batch', '1');
$handler = $view->new_display('views_data_export', 'Data export selection', 'views_data_export_2');
$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',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'flagged' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'flagged',
    'table' => 'flag_content',
    'field' => 'flagged',
    'relationship' => 'flag_content_rel',
    'override' => array(
      'button' => 'Use default',
    ),
  ),
));
$handler->override_option('items_per_page', '0');
$handler->override_option('style_plugin', 'views_data_export_csv');
$handler->override_option('style_options', array(
  'mission_description' => FALSE,
  'description' => '',
));
$handler->override_option('row_plugin', '');
$handler->override_option('path', 'csv_export_selection');
$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->override_option('displays', array());
$handler->override_option('sitename_title', FALSE);
$handler->override_option('use_batch', TRUE);
$handler = $view->new_display('page', 'CSV generator by selection', 'page_2');
$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',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'type' => array(
    'operator' => 'in',
    'value' => array(),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'type',
    'table' => 'node',
    'field' => 'type',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'flagged' => array(
    'operator' => '=',
    'value' => '1',
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'flagged',
    'table' => 'flag_content',
    'field' => 'flagged',
    'relationship' => 'flag_content_rel',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('title', 'My selection');
$handler->override_option('footer', '<a href="http://yoursite.com/csv_export_selection">export this selection to a .csv file</a>');
$handler->override_option('footer_format', '1');
$handler->override_option('footer_empty', 0);
$handler->override_option('path', 'csv_generator_selection');
$handler->override_option('menu', array(
  'type' => 'normal',
  'title' => 'CSV generator by selection',
  'description' => '',
  'weight' => '0',
  'name' => 'primary-links',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'description' => '',
  'weight' => 0,
  'name' => 'navigation',
));

The first part of code is a flag, this allows users to mark content for export. You'll need to edit it at /admin/build/flags/manage/export to work with your content types and roles.

The view is now 2 pages and 2 data exports, one of each for search exports and one of each for selected exports. You'll need to edit the footer in each page to adjust the link to the data export (written in custom HTML markup), I hid the CSV export buttons (removed them as attachment from the page to prevent end-user confusion). You can adjust the export links by replacing "http://yoursite.com/" in the code or in the footer in the views UI.

'CSV generator by search' is basically the same except that it is now a VBO which allows users to mark items for export, providing a link to the second page where they can review/adjust their selection for export.

You can also have the flags appear on the node/teaser, might be interesting.

There are some other approaches that could be done within views (setting the flag as field along side or instead of vbo) but this should be the most powerful as far as I know. Let me know how that works for you...

ceci123’s picture

Hi sjugge.

If this works you will have to let me send you a few $$ for beer.

So I installed the two required modules and followed your instructions. Clicking the 'CSV generator by search' the search form showed up with its checkboxes and after selecting a few of checkboxes I wanted to export. Unfortunately I got some WARNINGs and there were no items exported.

Have a look at the screenshots. http://www.flickr.com/photos/62910868@N07/5730763456/lightbox/

What can it be? I did go to /admin/build/flags/manage/export and edit it.

Thanks again

Ceci

sjugge’s picture

is there any chance you could provide me with an export of the content type(s) you want to search/export (/admin/content/types/export - or a feature export). It would makes things a bit easier and less abstract for me to set the views/flags/vbo up.

Coincidently I added some links in my signature, among which my amazon.com wish-list ;)

ceci123’s picture

try this

$content['type'] = array (
'name' => 'contribution',
'type' => 'contribution_paper',
'description' => '',
'title_label' => 'Paper Title',
'body_label' => 'Additional Notes',
'min_word_count' => '0',
'help' => '

Please complete and submit the form below.',
'node_options' =>
array (
'revision' => true,
'status' => false,
'promote' => false,
'sticky' => false,
),
'old_type' => 'conference_paper',
'orig_type' => '',
'module' => 'node',
'custom' => '1',
'modified' => '1',
'locked' => '0',
'comment' => '0',
'comment_default_mode' => '4',
'comment_default_order' => '1',
'comment_default_per_page' => '50',
'comment_controls' => '3',
'comment_anonymous' => 0,
'comment_subject_field' => '1',
'comment_preview' => '1',
'comment_form_location' => '0',
'ant' => '0',
'ant_pattern' => '',
'ant_php' => 0,
);
$content['groups'] = array (
0 =>
array (
'label' => 'Interacting Medication Section',
'group_type' => 'standard',
'settings' =>
array (
'form' =>
array (
'style' => 'fieldset_collapsible',
'description' => '',
),
'display' =>
array (
'description' => '',
'teaser' =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
'full' =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
4 =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
2 =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
3 =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
'block' =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
'search' =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
'label' => 'above',
),
),
'weight' => '34',
'group_name' => 'group_interacting_meds',
),
);
$content['fields'] = array (
0 =>
array (
'label' => 'Authors List',
'field_name' => 'field_authors_list',
'type' => 'text',
'widget_type' => 'text_textfield',
'change' => 'Change basic information',
'weight' => '28',
'rows' => 5,
'size' => '80',
'description' => 'Enter the list of Authors',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_authors_list][0][value',
),
),
'default_value_php' => '',
'default_value_widget' => NULL,
'group' => false,
'required' => 0,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '28',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'above',
'exclude' => 0,
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
1 =>
array (
'label' => 'Date',
'field_name' => 'field_date',
'type' => 'text',
'widget_type' => 'text_textfield',
'change' => 'Change basic information',
'weight' => '29',
'rows' => 5,
'size' => '20',
'description' => 'Please write out date ex: January 1, 2010 or January 2010',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_date][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_date' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_date][0][value',
),
),
),
'group' => false,
'required' => 0,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '29',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'above',
'exclude' => 0,
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
2 =>
array (
'label' => 'Source',
'field_name' => 'field_conference_name',
'type' => 'text',
'widget_type' => 'optionwidgets_select',
'change' => 'Change basic information',
'weight' => '30',
'description' => 'Type ',
'default_value' =>
array (
0 =>
array (
'value' => '',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_conference_name' =>
array (
'value' => '',
),
),
'group' => false,
'required' => 0,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => 'Conference Abstract
Journal Article
Manufacturer/Package Insert
Original Table
',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'optionwidgets',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '30',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
3 =>
array (
'label' => 'Paper ID',
'field_name' => 'field_paper_id',
'type' => 'text',
'widget_type' => 'text_textfield',
'change' => 'Change basic information',
'weight' => '31',
'rows' => 5,
'size' => '30',
'description' => 'unique ID every time a new paper is submitted, [prefix][number] is the format. ',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_paper_id][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_paper_id' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_paper_id][0][value',
),
),
),
'group' => false,
'required' => 1,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '31',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'above',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'hidden',
'exclude' => 0,
),
),
),
4 =>
array (
'label' => 'Keywords',
'field_name' => 'field_keywords',
'type' => 'text',
'widget_type' => 'text_textfield',
'change' => 'Change basic information',
'weight' => '32',
'rows' => 5,
'size' => '60',
'description' => 'Please enter 3-5 Keywords ...',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_keywords][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_keywords' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_keywords][0][value',
),
),
),
'group' => false,
'required' => 1,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '32',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
5 =>
array (
'label' => 'Submission Type',
'field_name' => 'field_submission_type',
'type' => 'text',
'widget_type' => 'optionwidgets_buttons',
'change' => 'Change basic information',
'weight' => '33',
'description' => 'Full Paper submission will be allowed only if the Abstract is approved',
'default_value' =>
array (
0 =>
array (
'value' => 'abstract',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_submission_type' =>
array (
'value' => 'abstract',
),
),
'group' => false,
'required' => 1,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => 'abstract|Abstract
full|Full Paper',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'optionwidgets',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '33',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
6 =>
array (
'label' => 'Category',
'field_name' => 'field_category',
'type' => 'text',
'widget_type' => 'optionwidgets_buttons',
'change' => 'Change basic information',
'weight' => '23',
'description' => 'Select a category.',
'default_value' =>
array (
0 =>
array (
'value' => '',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_category' =>
array (
'value' => '',
),
),
'group' => 'group_interacting_meds',
'required' => 1,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => 'ARV
Anti-HBV
Anti-HCV
Anti-TB
Anti-Malarial',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'optionwidgets',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '23',
'parent' => 'group_interacting_meds',
2 =>
array (
'format' => 'default',
'exclude' => 0,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
7 =>
array (
'label' => 'Medication Name',
'field_name' => 'field_medication_name',
'type' => 'text',
'widget_type' => 'text_textfield',
'change' => 'Change basic information',
'weight' => '24',
'rows' => 5,
'size' => '60',
'description' => 'Enter the Medication Name(eg. Atazanavir (Reyataz) ) that corresponds to the above Category.',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_medication_name][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_medication_name' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_medication_name][0][value',
),
),
),
'group' => 'group_interacting_meds',
'required' => 1,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '24',
'parent' => 'group_interacting_meds',
2 =>
array (
'format' => 'default',
'exclude' => 0,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'above',
'exclude' => 0,
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
8 =>
array (
'label' => 'Interacting Medication Name',
'field_name' => 'field_inter_medication_name',
'type' => 'text',
'widget_type' => 'text_textfield',
'change' => 'Change basic information',
'weight' => '25',
'rows' => 5,
'size' => '60',
'description' => 'Enter the NAME of the Interacting Medication(Eg. Lamotrigine). This is the drug that interacts with the "Medication Name" you selected on the previous field.',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_inter_medication_name][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_inter_medication_name' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_inter_medication_name][0][value',
),
),
),
'group' => 'group_interacting_meds',
'required' => 1,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '25',
'parent' => 'group_interacting_meds',
2 =>
array (
'format' => 'default',
'exclude' => 0,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'above',
'exclude' => 0,
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
9 =>
array (
'label' => 'Designation',
'field_name' => 'field_designation',
'type' => 'text',
'widget_type' => 'optionwidgets_buttons',
'change' => 'Change basic information',
'weight' => '26',
'description' => '',
'default_value' =>
array (
0 =>
array (
'value' => '',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_designation' =>
array (
'value' => '',
),
),
'group' => 'group_interacting_meds',
'required' => 1,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => 'Precautionary
Prohibited
',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'optionwidgets',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '26',
'parent' => 'group_interacting_meds',
2 =>
array (
'format' => 'default',
'exclude' => 0,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
10 =>
array (
'label' => 'Status Change (for previously entered interactions)',
'field_name' => 'field_status_change',
'type' => 'text',
'widget_type' => 'optionwidgets_buttons',
'change' => 'Change basic information',
'weight' => '27',
'description' => 'Please tell us if the "Designation" State has been changed or updated.',
'default_value' =>
array (
0 =>
array (
'value' => '',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_status_change' =>
array (
'value' => '',
),
),
'group' => 'group_interacting_meds',
'required' => 1,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => 'Yes, designation was changed.
No, designation has not been changed.',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'optionwidgets',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '27',
'parent' => 'group_interacting_meds',
2 =>
array (
'format' => 'default',
'exclude' => 0,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
11 =>
array (
'label' => 'Effect On ARV Concentration',
'field_name' => 'field_effect_on_arv_conc',
'type' => 'text',
'widget_type' => 'optionwidgets_buttons',
'change' => 'Change basic information',
'weight' => '28',
'description' => 'Enter the effect on ARV concentration. If this information is not available type \'unknown\'. ',
'default_value' =>
array (
0 =>
array (
'value' => NULL,
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_effect_on_arv_conc' =>
array (
'value' =>
array (
'' => 1,
'Increase' => false,
'Decrease' => false,
'No change' => false,
'Unknown' => false,
),
),
),
'group' => 'group_interacting_meds',
'required' => 1,
'multiple' => '1',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => 'Increase
Decrease
No change
Unknown',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'optionwidgets',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '28',
'parent' => 'group_interacting_meds',
2 =>
array (
'format' => 'default',
'exclude' => 0,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
12 =>
array (
'label' => 'Effect On Interacting Medication Concentration',
'field_name' => 'field_effect_on_int_med_conc',
'type' => 'text',
'widget_type' => 'optionwidgets_buttons',
'change' => 'Change basic information',
'weight' => '29',
'description' => 'Enter the effect on Interaction Medication concentration. If this information is not available type \'unknown\'. ',
'default_value' =>
array (
0 =>
array (
'value' => '',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_effect_on_int_med_conc' =>
array (
'value' =>
array (
'' => 1,
'Increase' => false,
'Decrease' => false,
'No change' => false,
'Unknown' => false,
),
),
),
'group' => 'group_interacting_meds',
'required' => 1,
'multiple' => '2',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => 'Increase
Decrease
No change
Unknown',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'optionwidgets',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '29',
'parent' => 'group_interacting_meds',
2 =>
array (
'format' => 'default',
'exclude' => 0,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
13 =>
array (
'label' => 'Study Design ',
'field_name' => 'field_study_design',
'type' => 'text',
'widget_type' => 'text_textarea',
'change' => 'Change basic information',
'weight' => '35',
'rows' => '2',
'size' => 60,
'description' => '',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_study_design][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_study_design' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_study_design][0][value',
),
),
),
'group' => false,
'required' => 0,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '35',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'above',
'exclude' => 0,
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
14 =>
array (
'label' => 'Study Results',
'field_name' => 'field_study_results',
'type' => 'text',
'widget_type' => 'text_textarea',
'change' => 'Change basic information',
'weight' => '36',
'rows' => '2',
'size' => 60,
'description' => '',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_study_results][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_study_results' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_study_results][0][value',
),
),
),
'group' => false,
'required' => 0,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '36',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'above',
'exclude' => 0,
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
15 =>
array (
'label' => 'Reference(s)',
'field_name' => 'field_reference',
'type' => 'text',
'widget_type' => 'text_textarea',
'change' => 'Change basic information',
'weight' => '37',
'rows' => '2',
'size' => 60,
'description' => ' ',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_reference][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_reference' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_reference][0][value',
),
),
),
'group' => false,
'required' => 0,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '37',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
16 =>
array (
'label' => 'Footnotes',
'field_name' => 'field_footnotes',
'type' => 'text',
'widget_type' => 'text_textarea',
'change' => 'Change basic information',
'weight' => '38',
'rows' => '5',
'size' => 60,
'description' => 'Footnotes',
'default_value' =>
array (
0 =>
array (
'value' => '',
'format' => '1',
'_error_element' => 'default_value_widget][field_footnotes][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_footnotes' =>
array (
0 =>
array (
'value' => '',
'format' => '1',
'_error_element' => 'default_value_widget][field_footnotes][0][value',
),
),
),
'group' => false,
'required' => 0,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '38',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 1,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
);
$content['extra'] = array (
'title' => '27',
'body_field' => '39',
'revision_information' => '42',
'author' => '44',
'options' => '40',
'comment_settings' => '43',
'menu' => '41',
);

sjugge’s picture

imported. Quite a content type you got there ;)

Would it be useful to have more search/filter options? If so, could you specify them.

sjugge’s picture

After funnelling down some of the previous views-y and flag-y stuff, I came up with a feature that has a simple and advanced search (based on your content type) which can export to .csv and a way to export a selection of flagged nodes.

you can download the feature and check the dependencies/info at http://lab.heretiksambrosia.net/lab-item/csv-generator

ceci123’s picture

installed and enabled all the dependencies and downloaded the feature you created. Am having some difficulties getting it to work. Not sure if this is causing the problem but I might have given you on older version of my content type. Either way this is one of the errors I am receiving on the csv-generator/advanced-search link on the views page.

Fatal error: Call to a member function get_views_info() on a non-object in /var/www/html/drupal6/sites/all/modules/flag/includes/flag_handler_field_ops.inc on line 67

Would you know what's causing the error or should i send you the current content type...which should not be much different. My apologies.

One more thing. Can the search be made to search on keywords instead searching on title? A nice feature to this search functionality would be to add an Autocomplete feature on keywords.

Thanks

Ceci

sjugge’s picture

daim, forgot to mention you should've probably got rid of all the previous views and flags etc, that's probably causing the error. If it's doable maybe even disable and un-install the dependencies and enable them again.

Another problem might be that if your content type had some work done in the meanwhile, that added fields won't be included in the .csv file... either I hold of the changes until you finished your content type, either you add add the fields yourself.

Search should be easy to swap to keywords, autocomplete? I dunno... we'll see if that works.

ceci123’s picture

Hi sjugge,

Uninstalled and Re-installed all dependencies and the errors are gone.

My only problem is that am not getting any results.

I'm thinking it might have something to do with the fact that the Content Type posted earlier has a different type: 'type' => 'contribution_paper', which is incorrect.

The correct type should be 'type' => 'conference_paper', as shown below. Other than that everything should be the same. Do you have to re-bundle the entire feature or is this something I can change on the views page.

--------------------- CONTENT TYPE ------------
$content['type'] = array (
'name' => 'Conference contribution',
'type' => 'conference_paper',
'description' => '',
'title_label' => 'Paper Title',
'body_label' => 'Additional Notes',
'min_word_count' => '0',
'help' => '',
'node_options' =>
array (
'revision' => true,
'status' => false,
'promote' => false,
'sticky' => false,
),
'old_type' => 'conference_paper',
'orig_type' => '',
'module' => 'node',
'custom' => '1',
'modified' => '1',
'locked' => '0',
'comment' => '0',
'comment_default_mode' => '4',
'comment_default_order' => '1',
'comment_default_per_page' => '50',
'comment_controls' => '3',
'comment_anonymous' => 0,
'comment_subject_field' => '1',
'comment_preview' => '1',
'comment_form_location' => '0',
'ant' => '0',
'ant_pattern' => '',
'ant_php' => 0,
);
$content['groups'] = array (
0 =>
array (
'label' => 'Interacting Medication Section',
'group_type' => 'standard',
'settings' =>
array (
'form' =>
array (
'style' => 'fieldset_collapsible',
'description' => '',
),
'display' =>
array (
'description' => '',
'teaser' =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
'full' =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
4 =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
2 =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
3 =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
'block' =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
'search' =>
array (
'format' => 'fieldset',
'exclude' => 0,
),
'label' => 'above',
),
),
'weight' => '34',
'group_name' => 'group_interacting_meds',
),
);
$content['fields'] = array (
0 =>
array (
'label' => 'Authors List',
'field_name' => 'field_authors_list',
'type' => 'text',
'widget_type' => 'text_textfield',
'change' => 'Change basic information',
'weight' => '28',
'rows' => 5,
'size' => '80',
'description' => 'Enter the list of Authors',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_authors_list][0][value',
),
),
'default_value_php' => '',
'default_value_widget' => NULL,
'group' => false,
'required' => 0,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '28',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'above',
'exclude' => 0,
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
1 =>
array (
'label' => 'Date',
'field_name' => 'field_date',
'type' => 'text',
'widget_type' => 'text_textfield',
'change' => 'Change basic information',
'weight' => '29',
'rows' => 5,
'size' => '20',
'description' => 'Please write out date ex: January 1, 2010 or January 2010',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_date][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_date' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_date][0][value',
),
),
),
'group' => false,
'required' => 0,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '29',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'above',
'exclude' => 0,
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
2 =>
array (
'label' => 'Source',
'field_name' => 'field_conference_name',
'type' => 'text',
'widget_type' => 'optionwidgets_select',
'change' => 'Change basic information',
'weight' => '30',
'description' => 'Type Conference Abstract, Journal Article or Manufacturer/Package Insert. This is also a free text. ',
'default_value' =>
array (
0 =>
array (
'value' => '',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_conference_name' =>
array (
'value' => '',
),
),
'group' => false,
'required' => 0,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => 'Conference Abstract
Journal Article
Manufacturer/Package Insert
Original Table
',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'optionwidgets',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '30',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
3 =>
array (
'label' => 'Paper ID',
'field_name' => 'field_paper_id',
'type' => 'text',
'widget_type' => 'text_textfield',
'change' => 'Change basic information',
'weight' => '31',
'rows' => 5,
'size' => '30',
'description' => 'Leave the default value unchanged. IMPORTANT! This is an automatically generated unique ID every time a new paper is submitted, [prefix][number] is the format.
',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_paper_id][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_paper_id' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_paper_id][0][value',
),
),
),
'group' => false,
'required' => 1,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '31',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'above',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'hidden',
'exclude' => 0,
),
),
),
4 =>
array (
'label' => 'Keywords',
'field_name' => 'field_keywords',
'type' => 'text',
'widget_type' => 'text_textfield',
'change' => 'Change basic information',
'weight' => '32',
'rows' => 5,
'size' => '60',
'description' => 'Please enter 3-5 Keywords separated by semicolons, e.g.: efavirenz; Lipitor (atorvastatin) ...',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_keywords][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_keywords' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_keywords][0][value',
),
),
),
'group' => false,
'required' => 1,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '32',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
5 =>
array (
'label' => 'Submission Type',
'field_name' => 'field_submission_type',
'type' => 'text',
'widget_type' => 'optionwidgets_buttons',
'change' => 'Change basic information',
'weight' => '33',
'description' => 'Full Paper submission will be allowed only if the Abstract is approved',
'default_value' =>
array (
0 =>
array (
'value' => 'abstract',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_submission_type' =>
array (
'value' => 'abstract',
),
),
'group' => false,
'required' => 1,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => 'abstract|Abstract
full|Full Paper',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'optionwidgets',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '33',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
6 =>
array (
'label' => 'Category',
'field_name' => 'field_category',
'type' => 'text',
'widget_type' => 'optionwidgets_buttons',
'change' => 'Change basic information',
'weight' => '23',
'description' => 'Select a category.',
'default_value' =>
array (
0 =>
array (
'value' => '',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_category' =>
array (
'value' => '',
),
),
'group' => 'group_interacting_meds',
'required' => 1,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => 'ARV
Anti-HBV
Anti-HCV
Anti-TB
Anti-Malarial',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'optionwidgets',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '23',
'parent' => 'group_interacting_meds',
2 =>
array (
'format' => 'default',
'exclude' => 0,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
7 =>
array (
'label' => 'Medication Name',
'field_name' => 'field_medication_name',
'type' => 'text',
'widget_type' => 'text_textfield',
'change' => 'Change basic information',
'weight' => '24',
'rows' => 5,
'size' => '60',
'description' => 'Enter the Medication Name(eg. Atazanavir (Reyataz) ) that corresponds to the above Category.',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_medication_name][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_medication_name' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_medication_name][0][value',
),
),
),
'group' => 'group_interacting_meds',
'required' => 1,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '24',
'parent' => 'group_interacting_meds',
2 =>
array (
'format' => 'default',
'exclude' => 0,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'above',
'exclude' => 0,
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
8 =>
array (
'label' => 'Interacting Medication Name',
'field_name' => 'field_inter_medication_name',
'type' => 'text',
'widget_type' => 'text_textfield',
'change' => 'Change basic information',
'weight' => '25',
'rows' => 5,
'size' => '60',
'description' => 'Enter the NAME of the Interacting Medication(Eg. Lamotrigine). This is the drug that interacts with the "Medication Name" you selected on the previous field.',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_inter_medication_name][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_inter_medication_name' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_inter_medication_name][0][value',
),
),
),
'group' => 'group_interacting_meds',
'required' => 1,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '25',
'parent' => 'group_interacting_meds',
2 =>
array (
'format' => 'default',
'exclude' => 0,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'above',
'exclude' => 0,
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
9 =>
array (
'label' => 'Designation',
'field_name' => 'field_designation',
'type' => 'text',
'widget_type' => 'optionwidgets_buttons',
'change' => 'Change basic information',
'weight' => '26',
'description' => '',
'default_value' =>
array (
0 =>
array (
'value' => '',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_designation' =>
array (
'value' => '',
),
),
'group' => 'group_interacting_meds',
'required' => 1,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => 'Precautionary
Prohibited
',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'optionwidgets',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '26',
'parent' => 'group_interacting_meds',
2 =>
array (
'format' => 'default',
'exclude' => 0,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
10 =>
array (
'label' => 'Status Change (for previously entered interactions)',
'field_name' => 'field_status_change',
'type' => 'text',
'widget_type' => 'optionwidgets_buttons',
'change' => 'Change basic information',
'weight' => '27',
'description' => 'Please tell us if the "Designation" State has been changed or updated.',
'default_value' =>
array (
0 =>
array (
'value' => '',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_status_change' =>
array (
'value' => '',
),
),
'group' => 'group_interacting_meds',
'required' => 1,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => 'Yes, designation was changed.
No, designation has not been changed.',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'optionwidgets',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '27',
'parent' => 'group_interacting_meds',
2 =>
array (
'format' => 'default',
'exclude' => 0,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
11 =>
array (
'label' => 'Effect On ARV Concentration',
'field_name' => 'field_effect_on_arv_conc',
'type' => 'text',
'widget_type' => 'optionwidgets_buttons',
'change' => 'Change basic information',
'weight' => '28',
'description' => 'Enter the effect on ARV concentration. If this information is not available type \'unknown\'. ',
'default_value' =>
array (
0 =>
array (
'value' => NULL,
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_effect_on_arv_conc' =>
array (
'value' =>
array (
'' => 1,
'Increase' => false,
'Decrease' => false,
'No change' => false,
'Unknown' => false,
),
),
),
'group' => 'group_interacting_meds',
'required' => 1,
'multiple' => '1',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => 'Increase
Decrease
No change
Unknown',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'optionwidgets',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '28',
'parent' => 'group_interacting_meds',
2 =>
array (
'format' => 'default',
'exclude' => 0,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
12 =>
array (
'label' => 'Effect On Interacting Medication Concentration',
'field_name' => 'field_effect_on_int_med_conc',
'type' => 'text',
'widget_type' => 'optionwidgets_buttons',
'change' => 'Change basic information',
'weight' => '29',
'description' => 'Enter the effect on Interaction Medication concentration. If this information is not available type \'unknown\'. ',
'default_value' =>
array (
0 =>
array (
'value' => '',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_effect_on_int_med_conc' =>
array (
'value' =>
array (
'' => 1,
'Increase' => false,
'Decrease' => false,
'No change' => false,
'Unknown' => false,
),
),
),
'group' => 'group_interacting_meds',
'required' => 1,
'multiple' => '2',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => 'Increase
Decrease
No change
Unknown',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'optionwidgets',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '29',
'parent' => 'group_interacting_meds',
2 =>
array (
'format' => 'default',
'exclude' => 0,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
13 =>
array (
'label' => 'Study Design ',
'field_name' => 'field_study_design',
'type' => 'text',
'widget_type' => 'text_textarea',
'change' => 'Change basic information',
'weight' => '35',
'rows' => '2',
'size' => 60,
'description' => '',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_study_design][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_study_design' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_study_design][0][value',
),
),
),
'group' => false,
'required' => 0,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '35',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'above',
'exclude' => 0,
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
14 =>
array (
'label' => 'Study Results',
'field_name' => 'field_study_results',
'type' => 'text',
'widget_type' => 'text_textarea',
'change' => 'Change basic information',
'weight' => '36',
'rows' => '2',
'size' => 60,
'description' => '',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_study_results][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_study_results' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_study_results][0][value',
),
),
),
'group' => false,
'required' => 0,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '36',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'above',
'exclude' => 0,
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
15 =>
array (
'label' => 'Reference(s)',
'field_name' => 'field_reference',
'type' => 'text',
'widget_type' => 'text_textarea',
'change' => 'Change basic information',
'weight' => '37',
'rows' => '2',
'size' => 60,
'description' => 'Enter reference information regarding this entry. This text area can hold an unlimited number of characters(text). ',
'default_value' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_reference][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_reference' =>
array (
0 =>
array (
'value' => '',
'_error_element' => 'default_value_widget][field_reference][0][value',
),
),
),
'group' => false,
'required' => 0,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '37',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 0,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
'block' =>
array (
'format' => 'default',
'exclude' => 0,
),
'search' =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
16 =>
array (
'label' => 'Footnotes',
'field_name' => 'field_footnotes',
'type' => 'text',
'widget_type' => 'text_textarea',
'change' => 'Change basic information',
'weight' => '38',
'rows' => '5',
'size' => 60,
'description' => 'Footnotes',
'default_value' =>
array (
0 =>
array (
'value' => '',
'format' => '1',
'_error_element' => 'default_value_widget][field_footnotes][0][value',
),
),
'default_value_php' => '',
'default_value_widget' =>
array (
'field_footnotes' =>
array (
0 =>
array (
'value' => '',
'format' => '1',
'_error_element' => 'default_value_widget][field_footnotes][0][value',
),
),
),
'group' => false,
'required' => 0,
'multiple' => '0',
'text_processing' => '0',
'max_length' => '',
'allowed_values' => '',
'allowed_values_php' => '',
'op' => 'Save field settings',
'module' => 'text',
'widget_module' => 'text',
'columns' =>
array (
'value' =>
array (
'type' => 'text',
'size' => 'big',
'not null' => false,
'sortable' => true,
'views' => true,
),
),
'display_settings' =>
array (
'weight' => '38',
'parent' => '',
2 =>
array (
'format' => 'hidden',
'exclude' => 1,
),
3 =>
array (
'format' => 'default',
'exclude' => 1,
),
'label' =>
array (
'format' => 'inline',
),
'teaser' =>
array (
'format' => 'default',
'exclude' => 0,
),
'full' =>
array (
'format' => 'default',
'exclude' => 0,
),
'sticky' =>
array (
'format' => 'default',
'exclude' => 0,
),
4 =>
array (
'format' => 'default',
'exclude' => 0,
),
),
),
);
$content['extra'] = array (
'title' => '27',
'body_field' => '39',
'revision_information' => '42',
'author' => '44',
'options' => '40',
'comment_settings' => '43',
'menu' => '41',
);
--------------------- END OF CONTENT TYPE -----

sjugge’s picture

just a matter of adjusting some settings in the flag and views module. But in the time I had the few tweaks in views & flags explained, I got the feature rebuild so... get the alpha2 here http://lab.heretiksambrosia.net/lab-item/csv-generator

let me know if the exported files has everything you want to export and whether or not you'd like less/more exposed filters.

EDIT: make sure you have the previous version disabled/un-installed and removed from /sites/all/modules... or wherever you keep your modules.

ceci123’s picture

sjugge,

Right now am playing around with the 'simple search' first. I'll test the advance searchlater. For the most part it works great thus far and it just needs few adjustments. If this is something I can do on my end just let me know.

1) The 'simple search' is ignoring the items checked. When file is exported it downloads all the items returned by the search instead of the items checked.

2) The export exported file doesn't have a file extension(eg .csv) and its hard to open b/c this file is not associated with any program on the pc.

2) Can we search it only on keywords? right now its searching on title.

Thanks again.

Ceci

sjugge’s picture

alpha3 download

1) the simple search is intended to be a simple search -> export
Handy for non techy users, large export if you know what you're looking for and a good starting point for us to clone and tweak the view ;)
You can always disable the view if it is of no use for your end-users.

2) Fixed. Forgot to set the data export as file, Mac opens them up anyway. I guess I'll chalk up one cool point for Mac :)

3) Set to Keywords both on simple and advanced

If you need to tweak the search of the simple/advanced page, hover your mouse near the title and click edit.
At the bottom right of the view are the search and exposed filters set up.

ceci123’s picture

Thanks for solving the file extension issue. Yep the Mac gets a fat point for that.

Our users are non-techy users and may actually prefer the 'simple search' in the beginning. It would be nice to get the checkboxes to work on the simple search. I might be wrong but think in the alpha1 download was working.

I wanted to explore the 'advance search' but am having a problem with the latest version. When I try opening the page I get the following error:

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 1706300 bytes) in /var/www/drupal6/includes/form.inc on line 2223

The code seem to be trying to use too much memory! There are currently less than 500 records and it should not need that much memory. The alpha2 download didn't have that problem.

Any ideas what's going on?

Thanks

Ceci

sjugge’s picture

Strange about the memory. I'll try to replicate the issue later tonight or tomorrow.
You could try running the update script, cron, clearing cache and optimizing the database.
There might be some opstruction somewhere. Keyword search might be a bit more intense then the previous search I guess but that should prevent the page from loading.

Making the select thingie work, should be no problem. We'll need to think of a user-friendly way maybe to clear the selection after export or in an easy manner. I guess the search will be used more than once by individual users?

ceci123’s picture

Yes, the user might do more than one search for different or separate items.

On the Simple Search after exporting the file....pressing the back button on the browser it returns this msg:

Building export
Export has encountered an error.
Please continue to the error page
An HTTP error 403 occurred. /drupal6/batch?id=46&op=do

I think its looking for /drupal6/csv-generator/simple-search...since /drupal6/batch?id=46&op=do is not a valid path it returns a 403 error.

Sorry for making you work so much.

Thanks again

ceci

sjugge’s picture

Batch API:

The export uses the batch API, so hitting the back button will take you to the progress indication of that batch process. Just enable the menu block '.csv generator' somewhere, optionally highly visible at /csv-generator/*/export

Testing/performance issues:

Generated about 1500 nodes of the last content type and did some testing...

As for alpha3, a swamphole of performance issues. Loads of overhead on the database (aprox 1MB per search!!!), I guess because of the keyword search. The selection of +20 a 30 something items through vbo (advanced search) gives me a WSOD, flagging is an intensive process. When doing it in bulk and storing that data for each user is not going to be ideal on a production site. Should try to have end-users generate as accurate as possible search results, a good instruction page on how to use advanced search could help a great deal. Not sure how the flagging can be performance optimized though. Possibly through another approach where a user could invoke the batch API to make selections?

Alpha2 seems to hum along slightly smoother, possibly because of the node title vs keyword search?

Thoughts:

I noticed almost all of your fields are text fields, I'd investigate whether or not it's possible to use some less database intensive options where possible. Taxonomy (yay! autocomplete?) for keywords, source, etc perhaps? Some other CCK fields for other fields that are more targeted towards their use probably won't hurt. If it's not a disaster to recreate the data you have stored at the moment that is.

I'd also check into some things to pimp out the performance of your production server, a trigger/rule to clear caches or even a server cronjob or script to optimize the database on regular bases. A custom php.ini, caching layers, ...

Anyways, I'd be willing to do some minor alterations to what I've done so far (combination of alpha2 & 3 in some way), I think it's a nice proof of concept and template for you to build upon. My time is going to be rather limited the next couple of days and I have my own development work lying around that'll consume me next week so... I'd be happy to see you through this and help out but maybe some structural things could use some re-thinking before this thing gets developed stuck into a huge flaggy snail that'll make your site implode after a couple of days.

ceci123’s picture

You were almost there and it's too bad the flagging grabs too much memory making the advance search not useable. :( I don't know much about creating features(the way you created) but ... can creating features be causing the this issue? Can your solution be used without creating a feature? I noticed that things can break if you don't enable & disable certain modules. Just trying to keep it simple.

How is the flag being used in our search anyway? I was reading about it and it was saying something about bookmaks...

Recreating the data won't be possible. We had to pay doctors and nurses to input data and they will be royally upset if we ask them again.

Its weird...the simple search also uses the keywords for searching and does not have any issues.

I know you have your own projects as well and don't want to take too much of your time but I really appreciate your help. about the wishlist... drop me a msg cecilia19801 at live dot com. I think we can still use the 'simple search' IF you can re-enable to the ability to select individual checkbox for export that would work. I can't remember but I think the first version had it working.

Thanks again

Ceci

sjugge’s picture

A features is a way of capturing a bunch of settings in code (like a module).
By doing so you don't need to import code in several places (flags, views, ...) and just drop it in the modules folder where it otherwise would be stored in the database. Since the components of the views and flags live in my database and in code at your end and we both have performance issues, I think it'll make little to no difference.

I've been thinking of a few things that might be worth trying though;

- let's forget about the views and vbo approach and go back to the initial post.
How accurate are your search results when using the Drupal core search?
Would it be an option to export just the search result and give end-users no control over selecting individual nodes.

- If they would need a way of having more control over their export, would it be an option that they can individually mark each node in a Drupal core search result they want to export? We could give them an overview page of selected items before they export.

I think that either one (or both) of those two approaches could eliminate the bottlenecks we've been dealing with. Let me know if that would be sufficient for your end-users, if so I'll set that up. Are you still tweaking your custom content type btw?

ceci123’s picture

At this point I am willing to try anything and I don't really have any other option at this time. One of the major requirements are the damn checkboxes so they can export only items that they are interested in...grrr!! The autocomplete stuff is gravy.

Unfortunately the custom content type is final. I am not allowed to tweaking it.

BTW the only fields of importance which will be show and ultimately exported to the user are:
*Title
*Keywords: (eg Atazanavir; Rosiglitazone; Avandia )
*Drug Name
*Interacting Medication
*Designation

All the other fields are only for internal use.

Drupal core search is very accurate. Users like it b/c it highlights search words. As you know, you can also prevent Drupal core from indexing certain fields which is huge with our users. I am not sure how accurate the results with VIEWS is. You would probably know best.

I still have until the beginning of June to come up with a solution. :)
Thanks again
Ceci

sjugge’s picture

1) "One of the major requirements are the damn checkboxes so they can export only items that they are interested in"
- no worries on that front, we'll just drop the batch selection stuff.

2) "The autocomplete stuff is gravy."
- Gravy is good, might have another module up my sleeve to get this sorted.

3) "Unfortunately the custom content type is final. I am not allowed to tweaking it."
- Good. Can I have an export? Now I'm certain things won't be changing in the content type, thus views' fields. That can't implode anymore :)

4) "the only fields of importance which will be show and ultimately exported to the user are..."
- will adjust the export settings

5) "I still have until the beginning of June to come up with a solution."
- plenty of time!

I'll poke around a bit over the next few days, probably come up with an alpha4 on Monday/Tuesday that you can just drop in.

ceci123’s picture

cool.

I can generate another export but the final content type is the one above Posted on May 18, 2011 at 2:22pm

or just do a Ctrl-F on '--------------------- CONTENT TYPE ------------'

Let me know if you need anything else.

Thanks

Ceci

sjugge’s picture

Cool. Thx

sjugge’s picture

Hey,

A re-write with the lessons learned from the Alpha versions and the specs in mind as given in the last comments. Do remove all files etc from the previous versions!

Full info & download: http://lab.heretiksambrosia.net/lab-item/csv-generator

If this functionality needs to be available to anonymous users, install the Session API and either let me know so I can make some necessary adjustments or enable the view and flag for anonymous users as well. I would not suggest this approach though since my guess is that this functionality might be used by different users working on the same computer.

For autocompletion on keywords, you may want to install the Keyword Autocomplete module, you could optionally set keywords yourself or just let it harvest the input given to the site and save yourself some work ;)

To display the export link on search results, you'll need to add the following code to the search.result.tpl.php at /modules/search or replace it with the file found here. Basically hacking core here but I don't believe there is a clean way of doing this in D6.

<?php
  if (!empty($result['node']->nid)) {
    print flag_create_link('export', $result['node']->nid);
  }
?>
ceci123’s picture

hello sjugge,

Your new solution seem to work! I will demo this next week to the group to get their input.

In the meantime I will move the search-result.tpl.php out of the core and place it in my theme. That way when I upgrade it I don't have to do it all over again.

Will also try the Keyword Autocomplete module you suggested. Hopefully it will do what it says it will do :)

I know I should not ask this but is there a way to turn the text 'export' into a form button or some sexy export image?

I will get back to you as soon as I get input from the group.

Thanks again for all you have done so far.

Ceci

sjugge’s picture

Hey,

I think it'll be the most stable yet functional and user friendly solution at this point. I'll look forward to see how it'll be torn apart next week ;)

I'm sure that some minor changes could be useful at some point, some sorting of some kind or a link to clear out the selection. I haven't figured the later one quite out yet, but there is probably a way of doing this without running into WSOD.

As for the button sexy, check out http://drupal.org/node/304042 & http://drupal.org/node/295373 (get into the child-pages ;)). I guess you're working with a custom theme and I'm far from a theming expert so... note that when you're going to poke around with this, you might want to set the flag link from JavaScript toggle to normal link at /admin/build/flags/manage/export. I'm quite sure the JS could mess up some things when you want to customize the link.

I also noticed the Keyword Autocomplete tends not to respond in the same manner as the core search depending if you hit or click enter... odd and might be frustrating for the end user.

all the best with the demo

ceci123’s picture

Hi sjugge, can't believe the last post was on May 25. Time really goes by fast.

My boss left for a long work/vacation for African and is coming back next week. However, he did have a chance to look at the application you helped me with and although he hasn't tested completely he is happy with it. I hope not but if if anything only minor tweaks will be needed.

Not sure how many times I can say this but I appreciate your help very much and haven't forgotten about your wish list. Where is it again?

Ceci

sjugge’s picture

Hey,

nice to hear it passed, took a little vacation from Drupal myself to focus on some other things, if you should need some help drop me a line through my contact form. It'll reach me there faster. My Amazon wishlist can be found here. Thanks.

ceci123’s picture

Looks like my users are never happy. Now I am asked if it would be possible the search-results can be saved and printed as a PDF?

I am wondering if there is a way I can configure this module http://drupal.org/project/print (Printer, e-mail and PDF versions) to recognize the research results.

Thanks in advance.

C

sjugge’s picture

Are users ever happy then? ;)

Good thing that the Print module can be configured to get the job done though.

- Head over to .../admin/settings/print
- Make sure to enable Show link in system (non-content) pages: as desired, you could enable it for all system pages but that would be overkill I guess, so you may want to try the following.
-> set this option to 'Show on only the listed pages.' and list the following:
- search/*
- my-export-selection/*

This should enable your users to export the pages as-is to .pdf. I assume that they'll require not just an export of the search but an export of the entire nodes in the search. This is probably doable but will probably require a little workaround...

ceci123’s picture

Unfortunately I am getting this error

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 4864 bytes) in /var/www/drupal/sites/all/libraries/dompdf/include/text_frame_reflower.cls.php(381) : runtime-created function on line 1

I am only printing one page shouldn't need that much memory.

sjugge’s picture

This may sound odd, but try it without having the dompdf (or any) pdf library installed.

ceci123’s picture

Tried it but without the dompdf library the site breaks :(
I'll just use the printer-friendly version for now.

Thanks for your help

sjugge’s picture

it was worth a try, it oddly enough kept on working on a D7 instance of mine without a pdf lib.

Not sure what else you could try for this... I suspect somewhere along the line there must be some bottleneck causing the error you mentioned earlier. Maybe you can try getting some feedback on the print module pages?

ceci123’s picture

How do I sort the drupal search results?? My Content-Type contains a field called 'designation' and would like to sort by this as it will group the results nicely. As shown below search.module page contains a function that 'ORDER BY score DESC' by default but not sure how I can get it to sort by designation field. Any ideas?

function do_search($keywords, $type, $join1 = '', $where1 = '1 = 1', $arguments1 = array(), $columns2 = 'i.relevance AS score', $join2 = '', $arguments2 = array(), $sort_parameters = 'ORDER BY score DESC') {
  $query = search_parse_query($keywords);

  if ($query[2] == '') {
    form_set_error('keys', t('You must include at least one positive keyword with @count characters or more.', array('@count' => variable_get('minimum_word_size', 3))));
  }
  if ($query[6]) {
    if ($query[6] == 'or') {
      drupal_set_message(t('Search for either of the two terms with uppercase <strong>OR</strong>. For example, <strong>cats OR dogs</strong>.'));
    }
  }
  if ($query === NULL || $query[0] == '' || $query[2] == '') {
    return array();
  }

  // Build query for keyword normalization.
  $conditions = "$where1 AND ($query[2]) AND i.type = '%s'";
  $arguments1 = array_merge($arguments1, $query[3], array($type));
  $join = "INNER JOIN {search_total} t ON i.word = t.word $join1";
  if (!$query[5]) {
    $conditions .= " AND ($query[0])";
    $arguments1 = array_merge($arguments1, $query[1]);
    $join .= " INNER JOIN {search_dataset} d ON i.sid = d.sid AND i.type = d.type";
  }

  // Calculate maximum keyword relevance, to normalize it.
  $select = "SELECT SUM(i.score * t.count) AS score FROM {search_index} i $join WHERE $conditions GROUP BY i.type, i.sid HAVING COUNT(*) >= %d ORDER BY score DESC";
  $arguments = array_merge($arguments1, array($query[4]));
  $normalize = db_result(db_query_range($select, $arguments, 0, 1));
  if (!$normalize) {
    return array();
  }
  $columns2 = str_replace('i.relevance', '('. (1.0 / $normalize) .' * SUM(i.score * t.count))', $columns2);

  // Build query to retrieve results.
  $select = "SELECT i.type, i.sid, $columns2 FROM {search_index} i $join $join2 WHERE $conditions GROUP BY i.type, i.sid HAVING COUNT(*) >= %d";
  $count_select =  "SELECT COUNT(*) FROM ($select) n1";
  $arguments = array_merge($arguments2, $arguments1, array($query[4]));

  // Do actual search query
  $result = pager_query("$select $sort_parameters", 100, 0, $count_select, $arguments);
  $results = array();
  while ($item = db_fetch_object($result)) {
    $results[] = $item;
  }
  return $results;
}
giorgaki’s picture

Dear sjugge you said:

- Go to the views interface and create a new view.
- Add a page display and a data export display, set their paths.
- In the data display, under export settings, set to attach to page.
- Under format settings, set to CSV file. In it's settings check of 'provide as file' and 'parent sort'..

I am following your instructions, by adding a "new view", and I don't see any of those you describe over.
I tried with both running versions of "Views data export module" 7.x-3.0-beta5 & 7.x-3.x-dev
What i am doing wrong?

Thank you

dayer4b’s picture

I just finished working on a module that can take ApacheSolr search results and generate a CSV.

http://drupal.org/sandbox/dayer4b/1822412

This isn't for Drupal 6, but maybe somebody can convert it?

kenorb’s picture

You can create view which returns search results (e.g. using Search API module) with separate export view provided by View Data Export module and then by adding Views Bulk Operations operation.
See: #1436726: Add integrations with Views Bulk Operations (sample VBO action to expose selected records to CSV export included herein)