Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.x-dev
Component:
Documentation
Priority:
Minor
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 May 2009 at 17:08 UTC
Updated:
8 Jul 2010 at 21:35 UTC
How can I access a single item of a grouped field, e.g. in the template file views-view-fields.tpl.php. I use a content type where I can specify multiple authors, and these authors are grouped in the view.
I can print the grouped field with <?php print $fields['field_author_value']->content; ?>
The printed HTML will look like this:
<div class="field-item">author1</div>
<div class="field-item">author2</div>
<div class="field-item">author3</div>But how can I access each item separately?
Comments
Comment #1
Jezze commentedDoes no one has a hint for me?
Well, I could extract the content between
<div></div>with a regular expression, but that's not really nice. I was hoping there would be a solution in which the grouped field is returned as an array.Thanks anyway! :)
Maybe someone still knows a better way than regular expressions.
Comment #2
esmerel commentedGiven the age of this issue, I have to hope it's either resolved or no longer relevant.