[opencms-dev] Structured content list not displayed

Xavier Ottolini xavier.ottolini at adelis.com
Mon May 16 13:43:21 CEST 2005


Hi all,

I found the reason why the list was not displayed.

In the tutorial , in the step 6, there was an error. The id of the 
Generic XML content is not 11 but 7. The step 6 should be :

6. Create an overview list page
Now create a JSP page "mylist.jsp" in "myfolder". The mimimum version might look like this:

<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" <http://www.opencms.org/taglib/cms%22> %>

<cms:contentload collector="allInFolderDateReleasedDesc" param="/myfolder/myarticle_${number}.html|7" editable="true">
<h3><cms:contentshow element="Title" /></h3>
</cms:contentload>

Click on the page. It should now display your single myarticle. Note that you can now create a new article using the "wizard wand". Add some more myarticles. They will be named "myarticle_0001.html" and up. 

The "param" attribute controls what files are actually listed. 
param="/myfolder/myarticle_${number}.html|7" translates to: All contents of
type 7 (generic XML content) in "/myfolder/". New files should be named
"myarticle_${number}.html". You can also get the folder part from a property
by using the "property" attribute and leavin this out of "param", see the
provided demo for that.


--
Note that there is also an error in the step 4. It should be : 

4. Create a "detail" page. 
The demo contains a "full featured" example. Here's like the "minimum
version", without a template:

<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" <http://www.opencms.org/taglib/cms%22> %>

<cms:contentload collector="singleFile" param="${opencms.uri}" editable="true">
<h1><cms:contentshow element="Title" /></h1>
</cms:contentload>

Save this file as "mydetail.jsp".
--

Best regards, 

Xavier Ottolini

> Hi all
>
> I try to create my first structured content. I created pages. I do not 
> know why the elements of my list are not displayed.
>
> I tried to follow the tutorial of this message :
> http://mail.opencms.org/pipermail/opencms-dev/2004q4/013609.html
>
> In my site (/sites/transport-woehl/), I created a folder
> /fr/actualites/
>
> The folder has the following properties :
> template=/system/modules/com.adelis.transportwoehl/templates/index_local
> template-elements=/fr/actualites/detail.jsp
> 1. I copied the article.xsd of the demo to my folder /fr/actualites/. 
> I called it article_woehl.xsd
>
> 2. I created two Generic XML content documents. I called them 
> article_0001.html and article_0002.html.
> 3. I edited the files successfully in the editor.
> 4. Then I created a detail page. The jsp displays the articles.
> 5. I connected the detail page to the XML content using the 
> "template-elements"
> property. The folder has the property template-elements set to 
> "/fr/actualites/detail.jsp".
> I published the folder. The articles are now displayed successfully.
>
> 6. I create an overview list page
> I called it  "index.jsp" in " /fr/actualites/". Source code is the 
> following:
>
> <%@ page session="false" %>
> <%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
> <cms:contentload collector="allInFolderDateReleasedDesc" 
> param="/fr/actualites/article_${number}.html|11" editable="true">
> <cms:contentshow element="Title" />
> </cms:contentload>
>
> Result : the page index.jsp is completely empty. There is not tag 
> inside. There is no message in the log files about that.
> Why are my articles not found ?
> The path is OK. 11 is the parameter of the generic content. The 
> articles are OK, because I can open each one in the browser.
> Has anybody any idea ? I would appreciate some help.
>
> Regards
>



More information about the opencms-dev mailing list