[opencms-dev] Show content of a plaint text file

Dominic Rothemel dominic at rothemel.de
Mon Jul 30 10:54:04 CEST 2018


Thanks to Filip and Stephan,

exactly what I needed, the code below works for me:

<cms:resourceload collector="byQuery" preload="true" 
param='fq=parent-folders:"/sites/default/CorrelationRules/UC/"&fq=type:plain'>
   <c:if test='${info.resultSize != 0}'>
     <cms:contentinfo var="info" />
       <c:if test='${info.resultSize != 0}'>
          <cms:resourceload>
             <cms:resourceaccess var="content" />
                
${fn:replace(fn:replace(fn:replace(fn:replace(fn:replace(content.fileContentAsString, 
'&', '&'),'>','>'),'<','<'),'"','"'),'\\n','')}
          </cms:resourceload>
       </c:if>
   </c:if>
</cms:resourceload>

Best regards,
Dominic



More information about the opencms-dev mailing list