How to increase character length for title in views-slideshow module? - drupal
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.
Related
Wordpress custom taxonomy category filter, default value to get all categories
I am trying create filter with AJAX which filter different taxonomy categories. For each taxonomy is filter listbox. Filter is working if all listbox are chosen, but i need find way how filter categories if some of filter are not selected. How can query categories with empty value ? I have 4 listboxes, code is shortened. Code: $komanda = $_POST['komanda']; $pretinieks = $_POST['pretinieks']; if ($komanda == 0){ $komanda = '?'; } if ($pretinieks == 0){ $pretinieks = '?'; } $args = array( 'post_type' => 'speles', 'posts_per_page' => 99, 'post_status' => array('publish'), 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'komandas', 'field' => 'term_id', 'terms' => $komanda, ), array( 'taxonomy' => 'pretinieki', 'field' => 'term_id', 'terms' => $pretinieks, ), ) );
I found solution. $komanda = $_POST['komanda']; $pretinieks = $_POST['pretinieks']; if ($komanda == 0){ $terms = get_terms( 'komandas', 'orderby=count&hide_empty=1' ); $komanda = array(); $komanda = wp_list_pluck($terms, 'term_id'); } if ($pretinieks == 0){ $terms = get_terms( 'pretinieki', 'orderby=count&hide_empty=1' ); $pretinieks = array(); $pretinieks = wp_list_pluck($terms, 'term_id'); } $args = array( 'post_type' => 'speles', 'posts_per_page' => 99, 'post_status' => array('publish'), 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'komandas', 'field' => 'term_id', 'terms' => $komanda, ), array( 'taxonomy' => 'pretinieki', 'field' => 'term_id', 'terms' => $pretinieks, ), ) );
Wordpress meta_query search by area (lat, lng)
I have area (lat0, lat1, lng0, lng1). Why my wp_query not working? $new_query->query( array( 'post_type' => 'object', 'meta_query' => array( array( 'relation' => 'AND', array( 'key' => 'lat', 'compare' => 'BETWEEN', 'value' => array($lat0, $lat1), 'type' => 'DECIMAL', ), array( 'key' => 'lng', 'compare' => 'BETWEEN', 'value' => array($lng0, $lng1), 'type' => 'DECIMAL', ) ), ), ) ); I get some result if I use: array( 'key' => 'lat', 'compare' => '<=', 'value' => $lat0, 'type' => 'DECIMAL', ), But this code not working: array( 'relation' => 'AND', array( 'key' => 'lat', 'compare' => '>=', 'value' => $lat0, 'type' => 'DECIMAL', ), array( 'key' => 'lat', 'compare' => '<=', 'value' => $lat1, 'type' => 'DECIMAL', ) ), Can I use wp_query for search by area. And if this wrong way, what I can do?
Fixed global $wpdb; $querystr = " SELECT * FROM $wpdb->posts INNER JOIN $wpdb->postmeta m1 ON ( $wpdb->posts.ID = m1.post_id ) INNER JOIN $wpdb->postmeta m2 ON ( $wpdb->posts.ID = m2.post_id ) INNER JOIN $wpdb->postmeta m3 ON ( $wpdb->posts.ID = m3.post_id ) WHERE $wpdb->posts.post_type = 'object' AND $wpdb->posts.post_status = 'publish' AND ( m1.meta_key = 'lat' AND m1.meta_value < $lat0 ) AND ( m1.meta_key = 'lat' AND m1.meta_value > $lat1 ) AND ( m2.meta_key = 'lng' AND m2.meta_value < $lng0 ) AND ( m2.meta_key = 'lng' AND m2.meta_value > $lng1 ) AND ( m3.meta_key = 'city' AND m3.meta_value = $city_string ) GROUP BY $wpdb->posts.ID ORDER BY $wpdb->posts.post_date DESC; "; $pageposts = $wpdb->get_results($querystr, OBJECT);
Drupal Views- Filtering by multiple taxonomy terms
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..
create a default view in drupal
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.
GMAP & Location - Coordinates show but cannot show node information
I set up a view with a type of gmap. If I change it to grid, all of the field values output fine. When I switch to gmap, the coordinates show up on the map but I can't get any info on the coordinates/markers. I am very very stuck. I have gone at this several different ways. You can see the example here: http://speakitnow.com/immersionschools <div class="views-field-title"> <label class="views-label-title"> Title: </label> <span class="field-content"></span> </div>
After running into the same issue even with 6.x-1.1-rc1 it looks like the version here fixes the issue: http://drupal.org/node/95786
which versions of the modules are you using? There is a patch at the issue queue for gmap that fixes some of the issues If it helps, here is my export of a view that is similar to what you're trying to achieve: http://www.thegalleryguide.co.uk/galleries This is on Drupal 6.15, with views 6.x-2.8, GMap 6.x-1.1-rc1, GMap Location 6.x-1.1-rc1 $view = new view; $view->name = 'galleries_map'; $view->description = 'Galleries - Map'; $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('relationships', array( 'nid' => array( 'id' => 'nid', 'table' => 'location_instance', 'field' => 'nid', ), )); $handler->override_option('fields', array( 'field_images_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_linked', 'multiple' => array( 'group' => 1, 'multiple_number' => '1', 'multiple_from' => '', 'multiple_reversed' => 0, ), 'exclude' => 0, 'id' => 'field_images_fid', 'table' => 'node_data_field_images', 'field' => 'field_images_fid', 'override' => array( 'button' => 'Override', ), 'relationship' => 'none', ), 'title' => array( 'label' => '', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 1, 'exclude' => 0, 'id' => 'title', 'table' => 'node', 'field' => 'title', 'relationship' => 'none', ), 'street' => array( 'label' => '', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'style' => 'both', 'exclude' => 0, 'id' => 'street', 'table' => 'location', 'field' => 'street', 'relationship' => 'none', ), 'postal_code' => array( 'label' => '', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'exclude' => 0, 'id' => 'postal_code', 'table' => 'location', 'field' => 'postal_code', 'relationship' => 'none', ), 'teaser' => array( 'label' => '', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'target' => '', 'help' => '', 'trim' => 1, 'max_length' => '100', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'empty' => '', 'hide_empty' => 0, 'empty_zero' => 0, 'exclude' => 0, 'id' => 'teaser', 'table' => 'node_revisions', 'field' => 'teaser', 'relationship' => 'none', 'override' => array( 'button' => 'Override', ), ), 'tid' => array( 'label' => '', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'type' => 'separator', 'separator' => ', ', 'empty' => '', 'link_to_taxonomy' => 0, 'limit' => 1, 'vids' => array( '3' => 3, '2' => 0, '4' => 0, '5' => 0, ), 'exclude' => 0, 'id' => 'tid', 'table' => 'term_node', 'field' => 'tid', 'relationship' => 'none', ), 'view_node' => 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, 'text' => 'More...', 'exclude' => 0, 'id' => 'view_node', 'table' => 'node', 'field' => 'view_node', 'override' => array( 'button' => 'Override', ), 'relationship' => 'none', ), )); $handler->override_option('sorts', array( 'distance' => array( 'order' => 'ASC', 'origin' => 'user', 'units' => 'km', 'latitude' => '', 'longitude' => '', 'id' => 'distance', 'table' => 'location', 'field' => 'distance', ), )); $handler->override_option('filters', array( 'type' => array( 'operator' => 'in', 'value' => array( 'gallery' => 'gallery', ), 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'id' => 'type', 'table' => 'node', 'field' => 'type', 'relationship' => 'none', ), )); $handler->override_option('access', array( 'type' => 'none', )); $handler->override_option('cache', array( 'type' => 'none', )); $handler->override_option('title', 'Galleries'); $handler->override_option('items_per_page', 0); $handler->override_option('style_plugin', 'gmap'); $handler->override_option('style_options', array( 'grouping' => '', 'macro' => '[gmap ]', 'datasource' => 'location', 'latfield' => 'field_images_fid', 'lonfield' => 'field_images_fid', 'markers' => 'static', 'markerfield' => 'field_images_fid', 'markertype' => 'small blue', )); $handler->override_option('row_options', array( 'inline' => array(), 'separator' => '', 'hide_empty' => 0, )); $handler = $view->new_display('page', 'Page', 'page_1'); $handler->override_option('path', 'galleries'); $handler->override_option('menu', array( 'type' => 'normal', 'title' => 'Galleries', 'description' => '', 'weight' => '1', 'name' => 'primary-links', )); $handler->override_option('tab_options', array( 'type' => 'none', 'title' => '', 'description' => '', 'weight' => 0, )); $handler = $view->new_display('block', 'Nearest galleries', 'block_1'); $handler->override_option('relationships', array( 'nid' => array( 'label' => 'Location: Node', 'required' => 1, 'id' => 'nid', 'table' => 'location_instance', 'field' => 'nid', 'override' => array( 'button' => 'Use default', ), 'relationship' => 'none', ), )); $handler->override_option('sorts', array( 'distance' => array( 'order' => 'ASC', 'origin' => 'user', 'units' => 'km', 'latitude' => '', 'longitude' => '', 'id' => 'distance', 'table' => 'location', 'field' => 'distance', 'override' => array( 'button' => 'Use default', ), 'relationship' => 'nid', ), )); $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' => 'none', '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, '4' => 0, '3' => 0, ), 'override' => array( 'button' => 'Use default', ), 'relationship' => 'nid', 'default_options_div_prefix' => '', 'default_argument_user' => 0, 'default_argument_fixed' => '', 'default_argument_php' => '', 'validate_argument_node_type' => array( 'webform' => 0, 'poll' => 0, 'image' => 0, 'artist' => 0, 'exhibition' => 0, 'faqs' => 0, 'gallery' => 0, 'link' => 0, 'page' => 0, 'story' => 0, ), 'validate_argument_node_access' => 0, 'validate_argument_nid_type' => 'nid', 'validate_argument_vocabulary' => array( '2' => 0, '4' => 0, '5' => 0, '3' => 0, ), 'validate_argument_type' => 'tid', 'validate_argument_transform' => 0, 'validate_user_restrict_roles' => 0, 'image_size' => array( '_original' => '_original', 'thumbnail' => 'thumbnail', 'preview' => 'preview', ), 'validate_argument_php' => '', ), )); $handler->override_option('filters', array( 'type' => array( 'operator' => 'in', 'value' => array( 'gallery' => 'gallery', ), 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'id' => 'type', 'table' => 'node', 'field' => 'type', 'relationship' => 'none', ), 'distance' => array( 'operator' => 'dist', 'value' => array( 'latitude' => '', 'longitude' => '', 'postal_code' => '', 'country' => '', 'search_distance' => '100', 'search_units' => 'mile', ), 'group' => '0', 'exposed' => FALSE, 'expose' => array( 'operator' => FALSE, 'label' => '', ), 'type' => 'latlon', 'identifier' => 'dist', 'id' => 'distance', 'table' => 'location', 'field' => 'distance', 'override' => array( 'button' => 'Use default', ), 'relationship' => 'nid', ), )); $handler->override_option('items_per_page', 5); $handler->override_option('style_plugin', 'default'); $handler->override_option('style_options', array( 'grouping' => '', )); $handler->override_option('row_options', array()); $handler->override_option('block_description', ''); $handler->override_option('block_caching', -1);