Affects Version/s: 6.0.12 EE, 6.1.1 CE GA2, 6.1.20 EE GA2, 6.1.X EE, 6.2.10 EE GA1, 6.2.X EE, 7.0.0 M6, 7.0.0 M7
Fix Version/s: 7.0.0 Beta 3
It does not appear to be currently possible to extract the names of items from a Multi Selection List in Web Content Structures and Templates.
The example shown here: http://www.liferay.com/community/wiki/-/wiki/Main/CMS+Template+%28Velocity%29#section-CMS+Template+(Velocity)-Iterating
Currently only extracts the Data Types set in the XML structure and not the names. Arguably the Types are useless as they can't contain spaces or special characters and really don't lend themselves to being displayed on a page.
Take this example:
Using the example code in the template:
Steps to reproduce it in master
1. Create a web content structure with a select field
2. Edit the field settings
3. Set Name to SupportedVersions
4. Edit the options and replace option1 with Liferay Portal 6.1 CE GA2, value1 with CE61GA2, option2 with Liferay Portal 6.1 EE GA2 and value2 with EE61GA2. Remove the option3-value3 line.
5. Set Multiple to Yes
6. Save changes
7. Create a new template for the previously created structure.
8. Select Velocity as template language
9. Copy the template code above and save changes.
10. Add a web content with the structure and template
11. Mark all the values of the select field
12. Save Changes.
13. Display the web content in a web content display
All that's extracted and displayed on the page is:
However what should be displayed is:
*Liferay Portal 6.1 CE GA2
*Liferay Portal 6.1 EE GA2
Really what's wanted is the list of human readable names - this is consistent with all the other data types available in the template which allow the user to extract the names.
Sorting this out would greatly improve the usability of Web Content Structures and Templates where large lists of values are used. Currently the only workaround to this is to duplicate the lists in the template via a map.
For further info see the following posts from users: