[opencms-dev] Re: How to create a new news article

Toni PĂ©rez tp.ocms at gmail.com
Tue Aug 15 19:43:34 CEST 2006


On 15/08/06, vasu dodda wrote:
> Hi Everybody,
>
> I have some problem while creating a new news article using '+' button. I
> wrote a jsp file which get all news pages in the current folder. When jsp
> page is loaded it retrieves all
> the news pages that are based on news_article structure content type. but
> the probllem is when I click on new icon I am not sure I should I write the
> code.
>
> Currently my code works fine only for displaying by using following
> sentence.
>
> <cms:contentload collector="allInFolderPriorityDateDesc"
> param="tests/|news_article" editable="true" >.. this code works fine but it
> can only retrieve the all files that are type
> of news article. but when I try to add new page it shows some exception like
> 'tests already exists'. tests is my folder where I have all news
> pages(news1.html, news2.html,..news5.html)


Hello,

You could try the following thing:

<cms:contentload collector="allInFolderPriorityDateDesc"
                 param="/tests/news${number}.html|news_article"
                 editable="true" >

With this, when you click on the '+' button, the OpenCms would create
a new resource of type "news_article" named "news00001.html". The next
time you click the button, it would create "news00002.html" and so on.

I hope that helps you.
Regards.
    Toni.



More information about the opencms-dev mailing list