Problems, need help? Have a tip or advice? Post it here.
6 posts Page 1 of 1
Dont know what I'm doing wrong but in trying to set up archives I get the dates showing up and that looks good but if I click on a date it just shows the same articles that are listed on local news page under each date....

Attachments

Hi,

Your current code that does the actual listing is this -
<cms:pages masterpage='localnews.php' paginate='1' access_level='4' limit='7'>

As explained in the docs about archives (http://www.couchcms.com/docs/concepts/u ... hives.html), you need to make it as follows to accommodate the archive period's dates -
<cms:pages masterpage='localnews.php' start_on=k_archive_date stop_before=k_next_archive_date paginate='1' access_level='4' limit='7'>

Hope it helps.
That worked KK,thank you..
I'm new to the area of actually building a functional website for a client..Most of my experience has been building personal websites so I have little knowledge of archives....The way I have this set up is:
1.Archives do not have a separate page of their own such as archives_list.html but instead archives is only on localnews_list.html from localnews.php.....Is this ok?
Basically my concern is how do I go about making sure the pages stay in the archives folder if the client deletes a page..Will it be deleted from archives?
Or should I have made a separate archives _list page?
Using the same snippet for archives if perfectly fine.

Archives only serve to list pages grouped by time-periods (monthly, weekly etc.).
If you delete a page it is gone from the system and so it cannot be included in any archive listing.

Hope that answers your query.
How can I go about setting up archives in a way that the articles remove themself from the main page such as news_list.html but stay in news archives ? Would that be done using something as simple as an expiry date?
You can set an expiry date on pages as we discussed here - viewtopic.php?f=4&t=9361

To make the expiry date take effect only on normal listing and not in archive view, we'll have to do something like the following (where we make a distinction between which 'view' we are handling and then don't specify the 'expiry_date' in the archive-view)
Code: Select all
<cms:if k_is_archive >
    <cms:pages masterpage='localnews.php' start_on=k_archive_date stop_before=k_next_archive_date paginate='1' limit='7' >
        ..
    </cms:pages>
<cms:else />   
    <cms:pages masterpage='localnews.php' custom_field="expiry_date > <cms:date format='Y-m-d H:i:s' />" paginate='1' limit='7' >
        .. normal listing - skips expired pages ..
    </cms:pages>
</cms:if>

Hope it helps.
6 posts Page 1 of 1