[opencms-dev] JSON output

Андрей Диканский andikk at mail.ru
Wed Feb 13 07:41:55 CET 2019


I tried it. I still have "wrong" JSON output:

{"parts":["Title","Title","Title"],"Title":"Title 1"}
It seems that  <cms:jsonpart> takes only the last one content element for output.


>Среда, 13 февраля 2019, 9:31 +03:00 от 脸谱 <afeinet at 163.com>:
>
>Hi, I have not used the jsonpart tag, but I suggest you use the following code to try to see what the output is.
>
><cms:contentload collector="allInFolder" param="/service/1/Direction-%(number).xml|Direction" preload="true">
>  <cms:contentinfo var="info" />
>  <c:if test="${info.resultSize > 0}">
>  <cms:contentload>       <%--  This is itself a loop call. It is not sure which part is decided. --%>
>      <cms:contentaccess var="content" /> <%-- This content will change with the loop, so it might be yours Direction1.xml, Direction2.xml, Direction3.xml . . . --%>
>      <cms:jsonpart element="Title">  ${content.value.Title}  </cms:jsonpart>
>   </cms:contentload>
>  </c:if>
> </cms:contentload> 
>
>
>
>
>
> 
>_______________________________________________
>This mail is sent to you from the opencms-dev mailing list
>To change your list options, or to unsubscribe from the list, please visit
>http://lists.opencms.org/cgi-bin/mailman/listinfo/opencms-dev
>
>
>


-- 
Andrew Dikansky
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20190213/46e057d5/attachment.htm>


More information about the opencms-dev mailing list