CityDesk Technical Support

A forum for technical support discussion related to CityDesk

How to do an archive

Hi

On my homepage, I list the three newest articles, and at the bottom there is an "Archive" link. By clicking on it, the user should get a list of all the articles EXCEPT the three that are already on the homepage.

Right now the archive page lists all articles, but how can I restrict it to exclude the first n articles?

Thanks for your help!
Joerg
Joerg Ewald Send private email
Thursday, December 08, 2005
 
 
You can't do this in CityScript. But it's logical to expect an archive to contain all of the articles.

You could us a keyword. Put "current" into your current articles. Select "current" for your home page and not current" for your archive. That's not very automatic. I wouldn't do it that way.

You can separate articles by date with scripts like these:

This does today's and future events:
{$foreach x in (and(folder "EuphonicList") (or (today) (after publishdate)))SortAscendBy .fileddate $}

This does previous events:
{$foreach x in (and(folder "EuphonicList") (or (today) (before publishdate)))SortDescendBy .fileddate $}
tk Send private email
Thursday, December 08, 2005
 
 
Hi,

there's no "foreach  except first 3" in CityScript. But you can list all articles, give them a unique ID and hide the first three with CSS.

Here's a suggestion using the filedDate and modifiedDate variables for the unique ID. Make sure you remove the linebreaks from the code, which were inserted by the discussion group.

Best Regards
Arend

<style type="text/css">
{$ foreach 3 x in (all) sortAscendBy .filedDate $}
{$ setDateTimeFormat "English" "MMMddyyyy" "HHmmss" $}
div#{$ x.filedDate $}{$ x.filedTime $}{$ x.modifiedDate $}{$ x.modifiedTime $} { display: none; }
{$ next $}
</style>

{$ foreach x in (all) sortAscendBy .filedDate $}
{$ setDateTimeFormat "English" "MMMddyyyy" "HHmmss" $}
<div id="{$ x.filedDate $}{$ x.filedTime $}{$ x.modifiedDate $}{$ x.modifiedTime $}">

<!-- List item for each article -->
<p><a href="{$ x.link $}">{$ x.headline $}</a>
<br />{$x.teaser$}</p>

</div>
{$ next $}
Arend Send private email
Thursday, December 08, 2005
 
 
Thanks Arend, that's a really nice tip.
Ron Lane Send private email
Thursday, December 08, 2005
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz