Apologies if this is stupidly simple, but I have unsuccessfully looked around for the answer.
I need to add a class to each value in a multiple value field.
I would like to wrap each taxonomy term link with the same Bootstrap class. 'Multiple field settings' offers options like Unordered List, Ordered List, etc. but does not allow wrapping a class around each of the multiple values; and adding a style to the field simply wraps the entire field (containing the multiple values) with a class—I want to style each individual value, not the whole block as one.
I've tried a few 'foreach' options in the various Views template files but reckon I'm missing the correct terms and php stuff to get it to work.
I want to split:
<?php print $fields['field_tags']->content; ?>
into its component values, styled individually.
Any help would be greatly appreciated.
Comments
Comment #2
andrew smith CreditAttribution: andrew smith commentedComment #3
Subhransu.addweb CreditAttribution: Subhransu.addweb at AddWeb Solution Pvt. Ltd. commentedFor your purpose override view field template files.
Hope this works for you.
Comment #4
andrew smith CreditAttribution: andrew smith commentedIt did!
Now it's written out, I start to see how it works.
Brilliant. Thank-you very much.
Comment #5
renatogThank you @denishaaddweb for your help.
Best,
Comment #6
renatog