Keep News Showing until Expiry Date

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

Keep News Showing until Expiry Date

Postby Stash » Sun Feb 19, 2006 8:40 pm

Is it possible to keep news showing until its expiry date goes past and only ever have 5 headlines showing

eg.

Headline 1 Expires 20th Feb
Headline 2 Expires 21st Feb
Headline 3 Expires 22nd Feb
Headline 4 Expires 23rd Feb
Headline 5 Expires 24th Feb
Headline 6 Expires 25th Feb <--- this dosent show until Headline 1 expired
Headline 7 Expires 26th Feb <--- this dosent show until Headline 2 expired

Hope i explained this ok and it is understanable
Stash
 
Posts: 8
Joined: Sun Feb 19, 2006 4:20 pm

Postby SrNupsen » Mon Feb 20, 2006 10:46 am

I think this is pretty straight forward: Setting the filter by number in your profile to 5 will make sure that 5 headlines are displayed at any given time.

Now use the ChangeDateNew addon to set an expiry date for your news, and they will effectively disappear on that date.

SrNupsen
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby Stash » Mon Feb 20, 2006 11:22 am

youre right but if i have more than 5 headlines in will remove headline 1 and replace it wit headline 6, i dont want that to happen not till headline 1 expires.
Stash
 
Posts: 8
Joined: Sun Feb 19, 2006 4:20 pm

Re: Keep News Showing until Expiry Date

Postby Dale Ray » Mon Feb 20, 2006 3:50 pm

Stash wrote:Is it possible to keep news showing until its expiry date goes past and only ever have 5 headlines showing

eg.

Headline 1 Expires 20th Feb
Headline 2 Expires 21st Feb
Headline 3 Expires 22nd Feb
Headline 4 Expires 23rd Feb
Headline 5 Expires 24th Feb
Headline 6 Expires 25th Feb <--- this dosent show until Headline 1 expired
Headline 7 Expires 26th Feb <--- this dosent show until Headline 2 expired

Hope i explained this ok and it is understanable

We need more information.

Do you want to keep the news item, but just limit the headlines?

What type of profile (standard, Maginot, etc.) are you using?

Are you using the built-in headline feature of the profile or using a second profile for the headlines?

How are you sorting this profile?

What are you other settings for the profile?

What version of Coranto are you using?
Dale Ray
User avatar
Dale Ray
 
Posts: 1001
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Postby Stash » Mon Feb 20, 2006 4:38 pm

Sorry for the limited amount of information provided to answer your questions im using coranto 1.24.

Yes i want to keep the news item but limit the headlines to 5 and then when headline 1 expires headline 6 replaces it.

Using a standard profile with the built in headline feature creating the headlines.

the sorting of the profile is done numerically by two fields which are numbers.
Stash
 
Posts: 8
Joined: Sun Feb 19, 2006 4:20 pm

Postby SrNupsen » Mon Feb 20, 2006 5:54 pm

Stash wrote:youre right but if i have more than 5 headlines in will remove headline 1 and replace it wit headline 6, i dont want that to happen not till headline 1 expires.


+

Stash wrote:Yes i want to keep the news item but limit the headlines to 5 and then when headline 1 expires headline 6 replaces it.


This confuses me and sounds a little contradicting. You want the 5 most recent headlines displayed at any time, but NOT including the expired ones, right? Because this is exactly what till happen if using the ChangeDateNew addon together with the filter by number option.

Or am I misunderstanding your intentions?

SrNupsen
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby Dale Ray » Mon Feb 20, 2006 6:30 pm

Stash wrote:Sorry for the limited amount of information provided to answer your questions im using coranto 1.24.

Yes i want to keep the news item but limit the headlines to 5 and then when headline 1 expires headline 6 replaces it.

Using a standard profile with the built in headline feature creating the headlines.

the sorting of the profile is done numerically by two fields which are numbers.


This requires using a separate profile to generate the headlines since your settings for the headlines is different than the settings for full items.

Create a new profile using the settings you wish for the headlines and include the file it generates where you want the headlines to show.

Using a separate profile for your headlines gives you a lot more flexibility since you can set different values for all of the filtering options if you want to. Some of the addon features don't work with the built-in headlines, but do work with a regular profile.
Dale Ray
User avatar
Dale Ray
 
Posts: 1001
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Postby Parahead » Tue Feb 21, 2006 7:20 pm

Like Dale said, you would need a separate profile for this to be able to have full control of the headlines.

It is a little tricky to achive what you want, but lets give it a try. In the new profile set the filter by number to maybe 30 ( I will explain this more later on) and leave the other filter/skip settings blank. The sort order should be set to Chronological (oldest first).

Then, in the style for the headlines, you add something like this at the very top:
Code: Select all
<PerlCode>
  if( ($ChangeDateNew_ValidToDate < $newstime) || ($countitems{$ProfileName} > 5) ) {
    next;
  }
  $countitems{$ProfileName}++;
</PerlCode>
The code is not tested so please get back with info if it worked or not...

OK, what do we do here? First we limit the items to be the 30 freshest newsitems, then we sort them in Chronological order (oldest first). Then in the style we check if the newsitem has "expired" or not and also make sure we only present 5 headlines. The number 30 should be an amount that is 5 + the amount of newitems you post "ahead" of time... Did this made any sense? Well, I think it is what you want to achive so just try it out, OK?

I would also like to add a link to this thread for additional reading...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Stash » Wed Mar 08, 2006 7:25 pm

thanks to the three of you for your help and time i managed to get it to work, sorry it took so long to reply but only got round to trying it today due to other stuff..

Many thanks for your help and keep up the excellent work you guys do.
Stash
 
Posts: 8
Joined: Sun Feb 19, 2006 4:20 pm

Postby Parahead » Fri Mar 10, 2006 6:25 pm

Stash wrote:thanks to the three of you for your help and time i managed to get it to work
For future reference, could you please let us know some more details about how you ended up solving this, did you use the PerlCode snippet I provided or did you solve it in some other way...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden


Return to Customization

Who is online

Users browsing this forum: No registered users and 1 guest

cron