I have a view that's grouped by two fields.

enter image description here

(In this case, the content: title field is using rewritten output with replacement tokens [field_session_number] | [title].) I need to do some pretty heavy-duty customizing - i.e. I need to attach some javascript to the session number, but not the title. They need to display on a single line. I've tried using two separate fields and setting them to be inline, but it doesn't seem to work when you then group by both fields.

This is the desired result (shows only second-level grouping by title; the time/date was too far up the screen.) enter image description here

So I've decided that the best way to do it would probably be with a template. When I look at the view's theme information link, I see possible template names for individual fields, but it seems that those only get applied if the fields are displayed in the view - when you group a view by a field, you explicitly exclude that field from the view so it doesn't display once as the group and again with each record.

Which template would I need to use to be able to get at the content of the grouped fields? I need to be able to access each grouped field separately - I looked at views-view-unformatted.tpl.php, but it looks like the only thing you have access to for grouping is $title.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.