PDA

View Full Version : Question about moving 'Latest news' in templates


pcoskat
06-11-2007, 03:37 PM
It is possible to move 'latest news' to one of the sidebars? (but still with Abstract image, title, excerpt, link)

Also, can the display be 'random' instead of 'most recent'?

Alex
06-11-2007, 04:38 PM
Why don't you move {LATEST_NEWS} to right-hand column in index.tpl ?

pcoskat
06-11-2007, 09:43 PM
Why don't you move {LATEST_NEWS} to right-hand column in index.tpl ?

And that will automagically result in random display?

nfriend
06-12-2007, 07:35 AM
nope.
The list of articles is being pulled out of the database in descending order, which means you'll always get the LATEST x-number of articles (set in preferences). It is entirely logical that "latest news" would be just that...

HOWEVER (and I am presuming that you want to know this too)

I would like to know how to change the parameters in the search() function, though... such as a random result set from the past week (total randomness could be a problem too, if you don't archive very often).

A few examples would be a huge help to those of us who like doing things just a little bit differently :cool:

utvara
06-12-2007, 11:28 AM
What you need to do is to change generator properties for latest news:

$article_list = new Article_list();
$article_list->search(array('a.status' => 1, 'a.created' => $cur_date, 'a.featured_news'=> '0' ), 'order_desc', 'descending', $latest_news_number, 0);
(index.php line 582 in v3.5.1)

You need to change 'order_desc' to 'rand' (BTW latest news is not ordered by creation date, but by user/admin specified order - d'n'd via sortables in administration)

Refer to http://www.vivvo.net/forums/showthread.php?t=674 for more options on article list generator.

utvara
--------
Vivvo CMS lead developer

nfriend
06-12-2007, 09:24 PM
Thank you! These tutorials really help all the pieces fall into place.