Closed (fixed)
Project:
Custom Formatters
Version:
6.x-1.4
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Sep 2010 at 07:09 UTC
Updated:
5 Oct 2011 at 22:41 UTC
I've used this module to create a comma separate list for fields where we have a multi-select. The one thing I can't figure out is how to tell it not to show the comma after the last item.
Right now we get this:
Label: Item1, Item2, Item3, Item4,
We want:
Label: Item1, Item2, Item3, Item4
Comments
Comment #1
SaxxIng commentedThere are several possibilities. Try this:
Comment #2
jsimonis commentedPerfect! That worked great.
I think it would be great to have a recipe book on here for things like this, contemplate, views, etc.
Comment #3
todd zebert commentedalmost exactly what I'm looking for, but how do I incorporate something like http://drupal.org/node/700480 to get the Value for the key?
Comment #4
todd zebert commentedI couldn't figure out my last question (still would like to know) but since I only had 1 key!=value I used a quick compare statement.
Anyway, I wanted a "collapsed" list of values using dashes for ranges, and commas. This works:
There's probably a more elegant solution but it works.
Comment #5
todd zebert commentedOddly enough my code works well in the regular cck display in a node, but from a view two things happened:
1) each individual element would print K,1,2,3,4,5 in order across subsequent rows. I ensured my Formatter is selected. Oddly, I have to check "Group multiple values" and it uses the formatter (or perhaps it's doing it itself, not sure).
2) Now it correctly outputs as my formatter "K-5" BUT it uses
Thanks!