I have an HTML list with all three values set to be inline. The inline field separator is , (comma then a space).
The rendered HTML has spaces before and after all commas. E.g.:
<li class="views-row views-row-2 views-row-even">
<span class="views-field-title">
<span class="field-content"><a href="/node/177" title="&amp;quot;Dallas County constables&amp;#039; traffic tickets irritate some: Cities want enforcement suspended&amp;quot;" alt="&amp;quot;Dallas County constables&amp;#039; traffic tickets irritate some: Cities want enforcement suspended&amp;quot;">"Dallas County constables' traffic tickets irritate some: Cities want enforcement suspended"</a></span>
</span>
,
<span class="views-field-field-date-value">
<span class="field-content">Feb. 21, 2003</span>
</span>
,
<span class="views-field-field-author-value">
<span class="field-content">Herb Booth</span>
</span>
</li>
There is a space before and after each comma. There should be no space before the comma.
Cannot show SQL from live preview because the preview is for the default display, no the affected display, which has overridden values.
The view's export is here:
$view = new view;
$view->name = 'articles';
$view->description = '';
$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(
'field_publication_nid' => array(
'label' => 'Publication',
'required' => 0,
'delta' => -1,
'id' => 'field_publication_nid',
'table' => 'node_data_field_publication',
'field' => 'field_publication_nid',
'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' => '',
'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',
),
'field_date_value' => array(
'label' => 'Date',
'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,
'label_type' => 'widget',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_date_value',
'table' => 'node_data_field_date',
'field' => 'field_date_value',
'relationship' => 'none',
),
'field_author_value' => array(
'label' => 'Author',
'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,
'label_type' => 'widget',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_author_value',
'table' => 'node_data_field_author',
'field' => 'field_author_value',
'relationship' => 'none',
),
'field_publication_nid' => array(
'label' => 'Publication',
'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,
'label_type' => 'widget',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_publication_nid',
'table' => 'node_data_field_publication',
'field' => 'field_publication_nid',
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'title' => array(
'order' => 'ASC',
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'field_publication_nid',
),
'title_1' => array(
'order' => 'ASC',
'id' => 'title_1',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'field_publication_nid' => array(
'default_action' => 'ignore',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'fixed',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'not found',
'break_phrase' => 0,
'not' => 0,
'id' => 'field_publication_nid',
'table' => 'node_data_field_publication',
'field' => 'field_publication_nid',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_user' => 0,
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'poll' => 0,
'forum' => 0,
'article' => 0,
'book' => 0,
'move_over_law' => 0,
'page' => 0,
'publication' => 0,
'quote' => 0,
'story' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'2' => 0,
'1' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_php' => '',
),
));
$handler->override_option('filters', array(
'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',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('items_per_page', 0);
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
'grouping' => '',
'override' => 1,
'sticky' => 0,
'order' => 'asc',
'columns' => array(
'field_author_value' => 'field_author_value',
'field_date_value' => 'field_date_value',
'field_publication_nid' => 'field_publication_nid',
'title' => 'title',
),
'info' => array(
'field_author_value' => array(
'sortable' => 0,
'separator' => '',
),
'field_date_value' => array(
'sortable' => 0,
'separator' => '',
),
'field_publication_nid' => array(
'separator' => '',
),
'title' => array(
'sortable' => 0,
'separator' => '',
),
),
'default' => '-1',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'articles');
$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,
));
$handler = $view->new_display('page', 'WithoutPublication', 'page_2');
$handler->override_option('fields', array(
'title' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
'override' => array(
'button' => 'Use default',
),
),
'field_date_value' => 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' => 0,
'label_type' => 'none',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_date_value',
'table' => 'node_data_field_date',
'field' => 'field_date_value',
'relationship' => 'none',
'override' => array(
'button' => 'Use default',
),
),
'field_author_value' => 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' => 0,
'label_type' => 'none',
'format' => 'default',
'multiple' => array(
'group' => TRUE,
'multiple_number' => '',
'multiple_from' => '',
'multiple_reversed' => FALSE,
),
'exclude' => 0,
'id' => 'field_author_value',
'table' => 'node_data_field_author',
'field' => 'field_author_value',
'relationship' => 'none',
'override' => array(
'button' => 'Use default',
),
),
));
$handler->override_option('style_plugin', 'list');
$handler->override_option('style_options', array(
'grouping' => '',
'type' => 'ul',
));
$handler->override_option('row_options', array(
'inline' => array(
'title' => 'title',
'field_date_value' => 'field_date_value',
'field_author_value' => 'field_author_value',
),
'separator' => ', ',
));
$handler->override_option('path', 'articlewithoutpublication');
$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,
));
Comments
Comment #1
aren cambre commentedSorry, didn't see dropdown to select the display to preview. Here's the SQL:
Comment #2
merlinofchaos commentedThis isn't really a bug, it's a consequence of the templates.
TO fix this, you're going to need to override the row template you're using and put everything on one line. Browsers will interpret the carriage returns and whatnot as spaces. This is something that won't get fixed globally within Views because it makes the templates unusable.
Comment #3
aren cambre commentedReally?
Comment #4
merlinofchaos commentedYou can't really expect people to use those templates just so you can make a space go away in a fairly rare case, do you? That's lame.
Comment #5
aren cambre commentedOh, you expect people to directly edit those... I was wondering why there are so many PHP delimiters.
The "mostest" lame is code that forces space padding around separators. :-P
Comment #6
merlinofchaos commentedI'm sorry, your attitude is remarkably selfish. It's most lame because it impacts you, but what you suggest impacts thousands, whereas the existing problem impacts a very small handfull.
The math says, leave as is.
Comment #7
beto_beto commentedi have been use the Views Delimited List module
and it is shown as
ItalianBritishIndianChinese,,,,,
the comma appears after the list !!!!