tags:

views:

108

answers:

2

Hi!

I'm developing a website using OpenCMS and am having a problem with creating links to files over which I loop using cms:contentload:

  <cms:contentload collector="allInFolder" param="faqs/|FaqFile" editable="false">
     <b><a href="${opencms.filename}"><cms:contentshow element="Title" /></a></b><br />
  </cms:contentload> 

This is a part of the index.jsp file. All the links unfortunately lead to index.jsp and not to the individual FAQ files. Do you know how to change this so that it works as expected?

Thanks, John

A: 

In the end I solved the problem by changing the link into:

<a href="<cms:link><cms:contentshow element="%(opencms.filename)" /></cms:link>">

It's working now.

John Manak
+2  A: 

This is actually a better (and now recommended) way of doing it:

<cms:contentload collector="allInFolder" param="faqs/|FaqFile" editable="false">
   <cms:contentaccess var="faqfiles" />
   <b><a href="<cms:link>${faqfiles.filename}</cms:link>"><c:out value="${faqfiles.value['Title']}" /></a></b><br />
</cms:contentload>
John Manak