Details
-
Magnolia Malfunction
-
Resolution: Done
-
Major
-
None
-
None
-
None
-
None
Description
Hello,
These examples don't seemed to execute at all:
cmsfn.asNodeList(contentMapList)
[#assign myMapList = cmsfn.children(content, "mgnl:page")]
list cmsfn.asNodeList(myMapList) as child
${cmsfn.parent(child)!},
/#list
cmsfn.children(content, nodeTypeName)
<ul>
[#list cmsfn.children(content, "mgnl:page") as child ]
<li>${child.title!}</li>
/#list
</ul>
This one generates the error below:
cmsfn.asContentMapList(nodeList)
[#assign childrenNodesAsContentMaps = cmsfn.asContentMapList(cmsfn.children(currentNode,
"mgnl:page"))]
list childrenNodesAsContentMaps as child
${child.title!},
/#list
Error (abridged):
No compatible overloaded variation was found; declared parameter types and argument value types
mismatch.
The FTL type of the argument values were: Null, string (wrapper: f.t.SimpleScalar).
The Java type of the argument values were: Null, String.
The matching overload was searched among these members:
info.magnolia.templating.functions.TemplatingFunctions.children(javax.jcr.Node, String),
info.magnolia.templating.functions.TemplatingFunctions.children
(info.magnolia.jcr.util.ContentMap),
info.magnolia.templating.functions.TemplatingFunctions.children(javax.jcr.Node),
info.magnolia.templating.functions.TemplatingFunctions.children
(info.magnolia.jcr.util.ContentMap, String)
Caused by: freemarker.core._TemplateModelException: No compatible overloaded variation was found;
declared parameter types and argument value types mismatch.
The FTL type of the argument values were: Null, string (wrapper: f.t.SimpleScalar).
The Java type of the argument values were: Null, String.
- Failed at: #assign childrenNodesAsContentMaps = ...
Thanks.