[opencms-dev] Problem with contentload

Andras Balogh abalogh at gmail.com
Mon Oct 24 14:39:59 CEST 2005


Hello,

    I have never tried it so i'm not sure if it works but each file has 
2 property (or attribute?)
like "Date released" and "Date Expired", you can see this in explorer view.
    You can bind 2 values (like from_date, to_date) from your news schema
to these, than opencms will do what you want, will show only news
that are not expired yet.
You may already have  from_date to_date  in your news structure (schema)
than you don't have to change so much things.
If you are lucky there should be a collector to get the archive news also.
    You should check the docu that comes with opencms how to do all these.

Good luck,
Andras.

Matthias Neher wrote:

> Hi list,
>  
> I'm still working at my news-archive.
> To remember: I have news items which are xml content files. These 
> files are stored in a folder called news. The index.html shows a list 
> of all news items stored in its folder. Old news items should not be 
> shown in this list. They should appear in another list (archive or 
> something like that).
> My first approach was to create a subfolder (archive) and to move old 
> news items into this folder by a script. It works but I have problems 
> with the filenames. If a news item (let me say newsitem_0003.html) is 
> moved to the archive folder and you create a new news item, it has the 
> same filename (newsitem_0003.html). Sometime this new created news 
> item will be old too and should be moved to the archive folder. In 
> this folder there is already a file "newsitem_0003.html". So this 
> could not work.
> My second approach is to have no special archive folder. All news 
> (actual ones and old ones) are in the same folder. I like to create 
> two list views - one which shows only actual news items one which 
> shows old news items. I like to differ whether a news item is old or 
> not by using a property. Now it is impossible to read a property of a 
> file during the contentload tag. I tried the following:
>  
> <cms:contentload collector="allInFolderDateReleasedDesc" 
> param="${opencms.folder}newsitem_${number}.html|500" editable="true">
>  <cms:property name="is_in_archive" file="uri" /><br /> 
> ...
>  
> I do only get the property value of the file which creates the list, 
> not of the actual news item file.
>  
>  
> Any idea?
>  
> Thanks a lot in advance
>  
> Best regards
> Matthias
>  
> -----------------------------------------------------------------
>
> Matthias Neher                     Fon: +49-7541-6047-143
>
> doubleSlash Net-Business GmbH      Fax: +49-7541-6041-111
>
> Müllerstr. 12 B                    Matthias.Neher at doubleSlash.de
>
> D-88045 Friedrichshafen            http://www.doubleSlash.de 
> <http://www.doubleslash.de/>
>
>  
>
>------------------------------------------------------------------------
>
>
>
>_______________________________________________
>This mail is send to you from the opencms-dev mailing list
>To change your list options, or to unsubscribe from the list, please visit
>http://mail.opencms.org/mailman/listinfo/opencms-dev
>




More information about the opencms-dev mailing list