[MAGNOLIA-3713] Add a possibility to iterate selected values of the checkbox control in freemarker template Created: 24/May/11  Updated: 23/Jan/13  Resolved: 26/May/11

Status: Closed
Project: Magnolia
Component/s: freemarker
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Jozef Chocholacek Assignee: Unassigned
Resolution: Not an issue Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
is causing DOCU-157 templating: document how to iterate o... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

There is no possibility to display selected values of the checkbox type control in a FM template - if I have checkbox control named e.g. "mycheckbox" with some options and at least one option is checked,

${content.mycheckbox}

is not empty, but it displays "mycheckbox" string, and it is not possible to use it in #list (

[#list content.mycheckbox as mc]

throws error).

In a JSP template I can use the way described in http://wiki.magnolia-cms.com/display/WIKIARCHIVE/Displaying+values+from+checkbox+control but there is no such possibility in a FM template. Using

[#list cmsfn.nodeDataIterator(cmsfn.currentParagraph, "status") as s]

throws "freemarker.core.InvalidReferenceException: Expression cmsfn.nodeDataIterator is undefined" error.



 Comments   
Comment by Jozef Chocholacek [ 25/May/11 ]

The solution is:

[#list content.mycheckbox?values as val]

You can close the issue (after you put it into the documentation, to http://documentation.magnolia-cms.com/reference/controls.html#radiocheckboxandselect at best).

Comment by Philipp Bärfuss [ 26/May/11 ]

Thanks for the report. I created a documentation request: DOCU-157.

Generated at Mon Feb 12 03:48:59 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.