Getting back a single attribute value from the consentable attributes list
Wessel, Keith
kwessel at illinois.edu
Thu Sep 8 22:01:08 EDT 2016
Apologies if this is a silly question, but I can't make this work.
On our consent page, we want to display attribute values for consentable attributes in a list when the attribute is multi-valued, but without a list when there's only one value. Easy enough to test using attribute.values.size.
But when size is 1, I can't figure out how to get back the sigle value to pass to the function that returns the attribute's display name. At this point, I've just left it in a copy of the foreach loop that pulls each attribute.values value into $value even though I know the loop will only run once.
I've tried attribute.values.pop and attribute.values.pop(), but Velocity doesn't seem to know what to do with either of those and just returns them as literal strings.
Is there a simple way to get a string back from the one and only member of the list?
Thanks,
Keith
More information about the users
mailing list