I have a View set up to display featured Article nodes. For each node there are 2 taxonomy vocabs to use. The first is 'Featured' with a term 'Yes'; the second is 'Section' with terms: Home, Info, Blog etc. If a node has the term Yes (Featured vocab) and the term Blog (Section vocab) then if you were to browse to domain.com/blog then you would see that featured content.
The view is set up to accept the first argument in the url to determine which section of the site you are viewing (Views argument: Taxonomy term). This works as expected.
Lastly, I am filtering by node type (Article) and then the taxonomy vocab (Featured) which is where my view is failing to return content. If I remove the taxonomy vocab filter it displays correctly for each section although it is displaying all Article nodes.
Could the issue be that the argument and filter are different taxonomy vocabs?
Here's the SQL query:
SELECT node.nid AS nid,
node.type AS node_type,
node.vid AS node_vid,
node_data_field_article_images.field_article_images_data AS node_data_field_article_images_field_article_images_data,
node.title AS node_title,
node.created AS node_created
FROM node node
LEFT JOIN content_field_article_images node_data_field_article_images ON node.vid = node_data_field_article_images.vid
LEFT JOIN term_node term_node ON node.vid = term_node.vid
LEFT JOIN term_data term_data ON term_node.tid = term_data.tid
WHERE (node.status <> 0) AND (node.type in ('article')) AND (node_data_field_article_images.field_article_images_list <> 0) AND (term_data.vid in ('20')) AND (term_data.name = 'home')
ORDER BY node_created DESC
Here's my view:
$view = new view;
$view->name = 'marquee_slideshow_dev';
$view->description = 'Marquee on homepage and landing pages';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'title' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'html' => 0,
'strip_tags' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
'override' => array(
'button' => 'Override',
),
),
));
$handler->override_option('sorts', array(
'created' => array(
'order' => 'DESC',
'granularity' => 'second',
'id' => 'created',
'table' => 'node',
'field' => 'created',
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'name' => array(
'default_action' => 'default',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'php',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'not found',
'glossary' => 0,
'limit' => '0',
'case' => 'lower',
'path_case' => 'lower',
'transform_dash' => 1,
'add_table' => 0,
'require_value' => 0,
'id' => 'name',
'table' => 'term_data',
'field' => 'name',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
'7' => 0,
'8' => 0,
'4' => 0,
'6' => 0,
'5' => 0,
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_fixed' => '',
'default_argument_user' => 0,
'default_argument_image_size' => '_original',
'default_argument_php' => '$path = explode(\'/\', drupal_get_path_alias($_GET[\'q\']));
$is_front = $_GET[\'q\'] == \'<front>\' || $_GET[\'q\'] == variable_get(\'site_frontpage\', \'<front>\');
$arg0 = arg(0);
if ($is_front) {
return \'home\';
} else if ($arg0 = \'node\' && arg(1) != \'add\' && arg(2) != \'edit\' && arg(2) != \'delete\' && $path[0] != \'\') {
return $path[0];
}
',
'validate_argument_node_type' => array(
'activitystream' => 0,
'image' => 0,
'contenttab' => 0,
'content_about_fedex_content_page' => 0,
'content_about_fedex_home_page' => 0,
'content_about_fedex_landing_page' => 0,
'content_access_article' => 0,
'content_access_article_index' => 0,
'content_access_content_page' => 0,
'content_access_landing_page' => 0,
'content_block' => 0,
'content_case_study' => 0,
'content_document' => 0,
'content_event' => 0,
'content_executive_viewpoint' => 0,
'content_feature' => 0,
'content_fedex_fact' => 0,
'content_fedex_video_page' => 0,
'content_great_place_to_work' => 0,
'content_location' => 0,
'content_opco_overview' => 0,
'content_our_commitment_content_p' => 0,
'content_our_commitment_landing_p' => 0,
'content_region_overview' => 0,
'content_resources' => 0,
'content_sag' => 0,
'content_small_business' => 0,
'page' => 0,
'slideshow_image' => 0,
'story' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'14' => 0,
'18' => 0,
'17' => 0,
'11' => 0,
'10' => 0,
'15' => 0,
'9' => 0,
'3' => 0,
'16' => 0,
'8' => 0,
'5' => 0,
'2' => 0,
'7' => 0,
'19' => 0,
'1' => 0,
'12' => 0,
'13' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'image_size' => array(
'_original' => '_original',
'thumbnail' => 'thumbnail',
'preview' => 'preview',
'icon' => 'icon',
),
'validate_argument_php' => '',
'override' => array(
'button' => 'Override',
),
),
));
$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',
'relationship' => 'none',
),
'type' => array(
'operator' => 'in',
'value' => array(
'article' => 'article',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
'vid' => array(
'operator' => 'in',
'value' => array(
'20' => '20',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'vid',
'table' => 'term_data',
'field' => 'vid',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('empty_format', '3');
$handler->override_option('items_per_page', 0);
$handler->override_option('use_pager', 'mini');
$handler->override_option('distinct', 0);
$handler->override_option('style_options', array(
'grouping' => '',
));
$handler = $view->new_display('block', 'Home Page', 'block_1');
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
hope you have a node which has terms from both the vocabulary ..
its difficult to solve it from exported view..
what you can do is provide the sql query which view is generating check it or post it over here..
i want to create a default view from mymodule. i want to use fields from 2 tables.My base table is users. All the fields from usres are showing. i want the fields from draagabaleviews_structure also. i had a look on hook_views_data. draagabaleviews group is already there in view.then how can i join that table??
function mymodule_views_default_views() {
$view = new view;
$view->name = 'my_view';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'users';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE;
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
));
$handler->override_option('fields', array(
'name' => array(
'label' => 'Username',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_node' => 0,
'exclude' => 0,
'id' => 'name',
'table' => 'users',
'field' => 'name',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'status' => array(
'label' => 'Status',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_user' => 0,
'overwrite_anonymous' => 0,
'anonymous_text' => '',
'exclude' => 0,
'id' => 'status',
'table' => 'users',
'field' => 'status',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'Last access' => array(
'label' => 'Last access',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_user' => 0,
'overwrite_anonymous' => 0,
'anonymous_text' => '',
'exclude' => 0,
'id' => 'Last access',
'table' => 'users',
'field' => 'access',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'order' => array(
'label' => 'Order',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'set_precision' => FALSE,
'precision' => 0,
'decimal' => '.',
'separator' => ',',
'prefix' => '',
'suffix' => '',
'exclude' => 0,
'id' => 'order',
'table' => 'draggableviews_structure',
'field' => 'value',
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'order' => array(
'order' => 'ASC',
'id' => 'Order',
'table' => 'draggableviews_structure',
'field' => 'value',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
));
$handler->override_option('access', array(
'type' => 'perm',
'perm' => 'Allow Reordering',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('empty', 'This book page doesn\'t contain any sub pages.');
$handler->override_option('empty_format', '1');
$handler->override_option('items_per_page', 20);
$handler->override_option('use_pager', '1');
$handler->override_option('style_plugin', 'draggabletable');
$handler->override_option('style_options', array(
'override' => 1,
'sticky' => 0,
'order' => 'asc',
'columns' => array(
'title' => 'title',
'name' => 'name',
),
'info' => array(
'title' => array(
'sortable' => 0,
'separator' => '',
),
'name' => array(
'sortable' => 0,
'separator' => '',
),
),
'tabledrag_order' => array(
'field' => 'order',
'handler' => 'native',
),
'draggableviews_extensions' => array(
'extension_top' => '3',
'extension_bottom' => '3',
),
'tabledrag_order_visible' => array(
'visible' => 1,
),
'tabledrag_hierarchy_visible' => array(
'visible' => 0,
),
'draggableviews_depth_limit' => '0',
'draggableviews_repair' => array(
'repair' => 'repair',
),
'tabledrag_types_add' => 'Add type',
'tabledrag_expand' => array(
'expand_links' => 'expand_links',
'collapsed' => 0,
'by_draggableviews_structure' => 0,
),
'tabledrag_lock' => array(
'lock' => 0,
),
'draggableviews_default_on_top' => '1',
'draggableviews_button_text' => 'Save order',
'draggableviews_arguments' => array(
'use_args' => 0,
),
'draggableviews_book_radios' => '1',
'draggableviews_book_argument' => 'p',
'draggableviews_book_filter' => 'none',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'user/reorder');
$handler->override_option('menu', array(
'type' => 'tab',
'title' => 'Rearrange',
'description' => 'Organize your book pages.',
'weight' => '10',
'name' => 'primary-links',
));
$handler->override_option('tab_options', array(
'type' => 'none',
'title' => '',
'description' => '',
'weight' => 0,
));
$views[$view->name] = $view;
return $views;
}
I was caught with the same issue where i needed to join the two table in view. fortunately i found these links
http://drupalmodules.com/module/reverse-node-reference module enhances views with reverse relationships for node reference fields.
you may also need http://drupal.org/project/noderelationships
These are contributed module. So if you want to do the same thing programmatically then you need to look into reverse-node-reference modules.
Im maintaining this Drupal Site which is using Slideshow Views for displaying the featured posts. Its using Slideshow Thumbnailhover SlideShows contribution of 'Views Slideshow' http://drupal.org/project/views_slideshow Module for Drupal. However, even after scanning through the code and browsing though all settings, I cant figure out how to increase the max -character length of titles. Its currently set to 50. I want to increase it to 70.
Thanks in advance!
The exported view is as follows:
$view = new view;
$view->name = 'SlideShows';
$view->description = 'Various views that display content in slideshows';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'field_upload_image_fid' => 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,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 1,
'empty_zero' => 0,
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'Slideshow_656x400_default',
'multiple' => array(
'group' => 0,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => 0,
),
'exclude' => 0,
'id' => 'field_upload_image_fid',
'table' => 'node_data_field_upload_image',
'field' => 'field_upload_image_fid',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'field_upload_image_data' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 1,
'max_length' => '80',
'word_boundary' => 0,
'ellipsis' => 0,
'strip_tags' => 1,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'data_key' => 'description',
'exclude' => 0,
'id' => 'field_upload_image_data',
'table' => 'node_data_field_upload_image',
'field' => 'field_upload_image_data',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'created' => array(
'order' => 'DESC',
'granularity' => 'second',
'id' => 'created',
'table' => 'node',
'field' => 'created',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'nid' => array(
'default_action' => 'default',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'node',
'default_argument' => '',
'validate_type' => 'node',
'validate_fail' => 'not found',
'break_phrase' => 0,
'not' => 0,
'id' => 'nid',
'table' => 'node',
'field' => 'nid',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
),
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_user' => 0,
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'blogs' => 0,
'industry_focus' => 0,
'market_sectors' => 0,
'page' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'1' => 0,
'6' => 0,
'3' => 0,
'2' => 0,
'5' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_php' => '',
),
));
$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(
'association' => 'association',
'blogs' => 'blogs',
'cars' => 'cars',
'company_reports' => 'company_reports',
'events' => 'events',
'howto' => 'howto',
'news' => 'news',
'press_releases' => 'press_releases',
'testimonial' => 'testimonial',
'travel' => 'travel',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'delta' => array(
'operator' => 'not empty',
'value' => array(
'value' => '',
'min' => '',
'max' => '',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'delta',
'table' => 'node_data_field_upload_image',
'field' => 'delta',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('header_format', '3');
$handler->override_option('header_empty', 0);
$handler->override_option('footer_format', '2');
$handler->override_option('footer_empty', 0);
$handler->override_option('use_ajax', TRUE);
$handler->override_option('distinct', 1);
$handler->override_option('style_plugin', 'slideshow');
$handler->override_option('style_options', array(
'type' => 'ul',
'mode' => 'views_slideshow_thumbnailhover',
'views_slideshow_singleframe-prefix' => '',
'views_slideshow_singleframe' => array(
'timeout' => '6000',
'delay' => '0',
'speed' => '700',
'start_paused' => 0,
'fixed_height' => '1',
'random' => '0',
'pause' => '1',
'pause_on_click' => '0',
'remember_slide' => 0,
'remember_slide_days' => '1',
'controls' => '0',
'pager' => '2',
'pager_type' => 'Numbered',
'pager_hover' => '2',
'pager_click_to_page' => 0,
'image_count' => '0',
'effect' => 'fade',
'sync' => '1',
'nowrap' => '0',
'advanced' => '',
'ie' => array(
'cleartype' => 'true',
'cleartypenobg' => 'false',
),
),
'views_slideshow_thumbnailhover-prefix' => '',
'views_slideshow_thumbnailhover' => array(
'hover_breakout' => 'title',
'teasers_last' => 1,
'timeout' => '5000',
'delay' => '0',
'speed' => '300',
'start_paused' => 0,
'fixed_height' => '1',
'random' => '0',
'pause' => '1',
'pause_on_click' => '0',
'remember_slide' => 0,
'remember_slide_days' => '1',
'pager_event' => 'mouseover',
'controls' => '0',
'image_count' => '0',
'effect' => 'fade',
'sync' => '1',
'nowrap' => '1',
'advanced' => '',
'ie' => array(
'cleartype' => 'true',
'cleartypenobg' => 'false',
),
),
));
$handler->override_option('row_plugin', 'node');
$handler->override_option('row_options', array(
'relationship' => 'none',
'build_mode' => 'full',
'links' => 0,
'comments' => 0,
));
$handler = $view->new_display('block', 'BlockImageSlideshow', 'block_1');
$handler->override_option('use_ajax', FALSE);
$handler->override_option('use_pager', '0');
$handler->override_option('distinct', 0);
$handler->override_option('style_options', array(
'type' => 'ul',
'mode' => 'views_slideshow_singleframe',
'views_slideshow_singleframe-prefix' => '',
'views_slideshow_singleframe' => array(
'timeout' => '5000',
'delay' => '0',
'speed' => '700',
'start_paused' => 0,
'fixed_height' => '1',
'random' => '0',
'pause' => '1',
'pause_on_click' => '0',
'remember_slide' => 0,
'remember_slide_days' => '1',
'controls' => '0',
'pager' => '2',
'pager_type' => 'Numbered',
'pager_hover' => '2',
'pager_click_to_page' => 0,
'image_count' => '0',
'effect' => 'none',
'sync' => '1',
'nowrap' => '0',
'advanced' => '',
'ie' => array(
'cleartype' => 'false',
'cleartypenobg' => 'false',
),
),
'views_slideshow_thumbnailhover-prefix' => '',
'views_slideshow_thumbnailhover' => array(
'main_fields' => array(
'field_upload_image_fid' => 0,
'field_upload_image_data' => 0,
),
'breakout_fields' => array(
'field_upload_image_fid' => 0,
'field_upload_image_data' => 0,
),
'teasers_last' => 1,
'timeout' => '5000',
'delay' => '0',
'speed' => '300',
'start_paused' => 0,
'fixed_height' => '1',
'random' => '0',
'pause' => '1',
'pause_on_click' => '0',
'remember_slide' => 0,
'remember_slide_days' => '1',
'pager_event' => 'mouseover',
'controls' => '0',
'image_count' => '0',
'effect' => 'fade',
'sync' => '1',
'nowrap' => '1',
'advanced' => '',
'ie' => array(
'cleartype' => 'true',
'cleartypenobg' => 'false',
),
),
));
$handler->override_option('row_plugin', 'fields');
$handler->override_option('row_options', array());
$handler->override_option('block_description', 'Block: REFID Image Slideshow');
$handler->override_option('block_caching', -1);
$handler = $view->new_display('block', 'BlockTopStories', 'block_2');
$handler->override_option('fields', array(
'field_upload_image_fid' => 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,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'Thumb_50x50_linked',
'multiple' => array(
'group' => 1,
'multiple_number' => '1',
'multiple_from' => '',
'multiple_reversed' => 0,
),
'exclude' => 0,
'id' => 'field_upload_image_fid',
'table' => 'node_data_field_upload_image',
'field' => 'field_upload_image_fid',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'title' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 1,
'max_length' => '55',
'word_boundary' => 1,
'ellipsis' => 0,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'gid' => array(
'default_action' => 'default',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'current_domain',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'not found',
'id' => 'gid',
'table' => 'domain_access',
'field' => 'gid',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
),
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_user' => 0,
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'associations' => 0,
'blogs' => 0,
'company_profile' => 0,
'company_reports' => 0,
'events' => 0,
'industry_focus' => 0,
'market_sectors' => 0,
'page' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'1' => 0,
'6' => 0,
'7' => 0,
'3' => 0,
'2' => 0,
'5' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_php' => '',
),
));
$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(
'news' => 'news',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'delta' => array(
'operator' => 'not empty',
'value' => array(
'value' => '',
'min' => '',
'max' => '',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'delta',
'table' => 'node_data_field_upload_image',
'field' => 'delta',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'field_news_feature_value_many_to_one' => array(
'operator' => 'or',
'value' => array(
'0' => '0',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'field_news_feature_value_many_to_one',
'table' => 'node_data_field_news_feature',
'field' => 'field_news_feature_value_many_to_one',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
'reduce_duplicates' => 0,
),
));
$handler->override_option('style_plugin', 'viewscarousel');
$handler->override_option('style_options', array(
'grouping' => '',
'skin' => 'custom',
'skin_path' => 'sites/all/themes/exdigital/carousel/style.css',
'vertical' => 0,
'start' => '',
'offset' => '',
'scroll' => '1',
'visible' => 0,
'animation' => 'fast',
'easing' => '',
'auto' => '0',
'wrap' => 'both',
));
$handler->override_option('row_plugin', 'fields');
$handler->override_option('row_options', array());
$handler->override_option('block_description', 'Block: TopStories Slide');
$handler->override_option('block_caching', -1);
$handler = $view->new_display('block', 'BlockFrontNews', 'block_3');
$handler->override_option('fields', array(
'field_upload_image_fid' => 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,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'Slide_Front_430_linked',
'multiple' => array(
'group' => 0,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => 0,
),
'exclude' => 0,
'id' => 'field_upload_image_fid',
'table' => 'node_data_field_upload_image',
'field' => 'field_upload_image_fid',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'title' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 1,
'max_length' => '55',
'word_boundary' => 1,
'ellipsis' => 0,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'field_headline_caption_value' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 1,
'max_length' => '150',
'word_boundary' => 1,
'ellipsis' => 0,
'strip_tags' => 1,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_headline_caption_value',
'table' => 'node_data_field_headline_caption',
'field' => 'field_headline_caption_value',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'gid' => array(
'default_action' => 'default',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'current_domain',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'not found',
'id' => 'gid',
'table' => 'domain_access',
'field' => 'gid',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
),
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_user' => 0,
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'association' => 0,
'blogs' => 0,
'company_reports' => 0,
'events' => 0,
'industry_focus' => 0,
'market_sectors' => 0,
'news' => 0,
'page' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'1' => 0,
'6' => 0,
'7' => 0,
'3' => 0,
'2' => 0,
'5' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_php' => '',
),
));
$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(
'news' => 'news',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
),
'field_news_feature_value_many_to_one' => array(
'operator' => 'or',
'value' => array(
'2' => '2',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'field_news_feature_value_many_to_one',
'table' => 'node_data_field_news_feature',
'field' => 'field_news_feature_value_many_to_one',
'override' => array(
'button' => 'Use default',
),
'relationship' => 'none',
'reduce_duplicates' => 0,
),
));
$handler->override_option('title', 'News');
$handler->override_option('use_ajax', FALSE);
$handler->override_option('items_per_page', 5);
$handler->override_option('block_description', 'BlockFrontNews');
$handler->override_option('block_caching', -1);
There is an option to trim the field length on the view field settings, but heard to tell what is going on with out more information such as what templates are overridden, css, etc.
Can you export the view and post it?
Found the solution.The view was using row style plugin which themed it in the node-[node-type].tpl file.
I'm trying to do it for hours now, and I just can't do it.
What I want is:
A radio or select drop-down with varying options (from the database). This part is ok, it's just a query and building the options.
Then there are 3 text fields, each option from the above form has data for these 3 text fields.
When the user clicks/selects one of the options, i want to autocomplete the 3 text fields from the database. It's an edit feature, the user will select one option, and the 3 forms are completed with the current data, so the user can change them, and click submit to write the update to the database.
I'm using drupal 6 and the ahah_helper module.
I have this code, which is currently completing the textfields, but when I change the first selection, it just won't update, not even the select value itself, it just comes back to the default, like it's not being setted or stored into the 'storage' from ahah_helper. I did this based on the ahah_helper_example, it can be (and probably is) totally wrong, I just started on drupal and forms.
function filiais_editar_form($form_state) {
//
// AHAH Helper stuff
//
$form = array();
ahah_helper_register($form, $form_state);
if (!isset($form_state['storage']['editar_filial']['filial']))
$default_value = 1;
else
$default_value = $form_state['storage']['editar_filial']['filial'];
$form['editar_filial'] = array(
'#type' => 'fieldset',
'#prefix' => '<div id="editar-filial-wrapper">',
'#suffix' => '</div>',
'#tree' => TRUE,
);
$query_result = db_query("SELECT DISTINCT ON (cidade) cidade, id_filial
FROM filial_pf");
$cidades = array();
while($row = db_fetch_object($query_result))
$cidades[$row->id_filial] = $row->id_filial . ' : ' . $row->cidade;
$form['editar_filial']['filial'] = array(
'#type' => 'select',
'#title' => "Escolha a filial que deseja editar",
'#options' => $cidades,
'#default_value' => $default_value,
'#ahah' => array(
'event' => 'change',
'path' => ahah_helper_path(array('editar_filial')),
'wrapper' => 'editar-filial-wrapper',
),
);
$form['editar_filial']['update'] = array(
'#type' => 'submit',
'#value' => "Atualizar Dados",
'#submit' => array('ahah_helper_generic_submit'),
'#attributes' => array('class' => 'no-js'),
);
//$fid = $form_state['storage']['editar_filial']['filial'];
$fid = $default_value;
$query_result = db_query("SELECT cidade, endereco, estado
FROM filial_pf
WHERE id_filial = '%d'", $fid);
$row = db_fetch_object($query_result);
$cidade = $row->cidade;
$estado = $row->estado;
$endereco = $row->endereco;
$form['editar_filial']['cidade'] = array(
'#type' => 'textfield',
'#title' => "Nova Cidade da Filial",
'#size' => 18,
'#maxlength' => 18,
'#required' => TRUE,
'#default_value' => $cidade,
);
$estados = array(
"AC" => "AC",
"AL" => "AL",
"AP" => "AP",
"AM" => "AM",
"BA" => "BA",
"CE" => "CE",
"DF" => "DF",
"ES" => "ES",
"GO" => "GO",
"MA" => "MA",
"MT" => "MT",
"MS" => "MS",
"MG" => "MG",
"PA" => "PA",
"PB" => "PB",
"PR" => "PR",
"PE" => "PE",
"PI" => "PI",
"RJ" => "RJ",
"RN" => "RN",
"RS" => "RS",
"RO" => "RO",
"RR" => "RR",
"SC" => "SC",
"SP" => "SP",
"SE" => "SE",
"TO" => "TO");
$form['editar_filial']['estado'] = array(
'#type' => 'select',
'#title' => "Estado",
'#options' => $estados,
'#required' => TRUE,
'#default_value' => $estado,
);
$form['editar_filial']['endereco'] = array(
'#type' => 'textarea',
'#title' => "Novo Endereço da Filial",
'#size' => 70,
'#maxlength' => 140,
'#required' => TRUE,
'#default_value' => $endereco,
);
$form['editar_filial']['salvar'] = array(
'#type' => 'submit',
'#value' => "Salvar",
);
return $form;
}
Made it work, found some nice examples here:
http://www.kristen.org/content/drupal-ahah-form-examples
And the code looks like this:
function filiais_editar_form($form_state) {
//
// AHAH Helper stuff
//
$form = array();
ahah_helper_register($form, $form_state);
$form['editar'] = array(
'#type' => 'fieldset',
'#prefix' => '<div id="editar-wrapper">',
'#suffix' => '</div>',
'#tree' => TRUE,
);
$query_result = db_query("SELECT DISTINCT ON (cidade) cidade, id_filial
FROM filial_pf");
$cidades = array();
while($row = db_fetch_object($query_result))
$cidades[$row->id_filial] = $row->id_filial . ' : ' . $row->cidade;
if (!isset($form_state['values']['editar']['filial']))
$choice = 0;
else
$choice = $form_state['values']['editar']['filial'];
$form['editar']['filial'] = array(
'#type' => 'radios',
'#title' => "Escolha a filial que deseja editar",
'#options' => $cidades,
'#default_value' => $choice,
'#ahah' => array(
'event' => 'change',
'path' => ahah_helper_path(array('editar')),
'wrapper' => 'editar-wrapper',
'method' => 'replace',
),
);
$fid = $choice;
if($fid != 0)
{
$query_result = db_query("SELECT cidade, endereco, estado
FROM filial_pf
WHERE id_filial = '%d'", $fid);
$row = db_fetch_object($query_result);
$cidade = $row->cidade;
$estado = $row->estado;
$endereco = $row->endereco;
}
else
{
$cidade = '';
$estado = '';
$endereco = '';
}
$form['editar']['cidade'] = array(
'#type' => 'textfield',
'#title' => "Nova Cidade da Filial",
'#size' => 18,
'#maxlength' => 18,
'#required' => TRUE,
'#default_value' => $cidade,
);
$estados = array(
"AC" => "AC",
"AL" => "AL",
"AP" => "AP",
"AM" => "AM",
"BA" => "BA",
"CE" => "CE",
"DF" => "DF",
"ES" => "ES",
"GO" => "GO",
"MA" => "MA",
"MT" => "MT",
"MS" => "MS",
"MG" => "MG",
"PA" => "PA",
"PB" => "PB",
"PR" => "PR",
"PE" => "PE",
"PI" => "PI",
"RJ" => "RJ",
"RN" => "RN",
"RS" => "RS",
"RO" => "RO",
"RR" => "RR",
"SC" => "SC",
"SP" => "SP",
"SE" => "SE",
"TO" => "TO");
$form['editar']['estado'] = array(
'#type' => 'select',
'#title' => "Estado",
'#options' => $estados,
'#required' => TRUE,
'#default_value' => $estado,
);
$form['editar']['endereco'] = array(
'#type' => 'textarea',
'#title' => "Novo Endereço da Filial",
'#size' => 70,
'#maxlength' => 140,
'#required' => TRUE,
'#default_value' => $endereco,
);
$form['editar']['salvar'] = array(
'#type' => 'submit',
'#value' => "Salvar",
);
$form['#redirect'] = '';
return $form;
}