Advertisement
xtiansimon

Views Multiple Field adds space

Jul 30th, 2012
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.05 KB | None | 0 0
  1. 1) Multiple Field Settings: Display all values in same row:
  2. 8 =>
  3.   array (
  4.     'title' => 'Test Item Title',
  5.     'field_item_price' => '',
  6.     'field_item_description' => '
  7.  
  8. This is a test item to show the problem of extra "something" added to a multiple field entry.
  9.  
  10. ',
  11.     'field_item_options' => '
  12.  
  13. Option A
  14. ,
  15.  
  16. Option B
  17. ',
  18.     'field_item_options_price' => '$1.00, $2.00',
  19.     'draggableviews' => '',
  20.   ),
  21.  
  22. 2) With Multiple field settings: not checked.
  23. 9 =>
  24.   array (
  25.     'title' => 'Test Item Title',
  26.     'field_item_price' => '',
  27.     'field_item_description' => '
  28.  
  29. This is a test item to show the problem of extra "something" added to a multiple field entry.
  30.  
  31. ',
  32.     'field_item_options' => '
  33.  
  34. Option A
  35. ',
  36.     'field_item_options_price' => '$2.00',
  37.     'draggableviews' => '',
  38.   ),
  39.  
  40. 3) various attempts to remove the extra space include using trim() and preg_replace() in a views template override:
  41. $striped_array_options = trim($row['field_item_options']);
  42. $stripeded_array = preg_replace('~\s+~', 'x', $striped_array_options);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement