Recent Topics

1 Mar 03, 2008 04:43    

I'd like to be able to limit the number of posts to the 15 most recent in the post_list displayed in the sidebar... I guess its pretty simple since it's just a few lines in _coll_post_list.widget.php but I'm clueless cuz' I dont know much about PHP...

Thx for helping...


<?php

if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );

load_class( 'widgets/model/_widget.class.php' );

/**
 * ComponentWidget Class
 *
 * A ComponentWidget is a displayable entity that can be placed into a Container on a web page.
 *
 * @package evocore
 */
class coll_post_list_Widget extends ComponentWidget
{
	/**
	 * Constructor
	 */
	function coll_post_list_Widget( $db_row = NULL )
	{
		// Call parent constructor:
		parent::ComponentWidget( $db_row, 'core', 'coll_post_list' );
	}


	/**
	 * Get name of widget
	 */
	function get_name()
	{
		return ("Articles parus");
	}


  /**
	 * Get short description
	 */
	function get_desc()
	{
		return T_('Display list of all posts');
	}


	/**
	 * Display the widget!
	 *
	 * @param array MUST contain at least the basic display params
	 */
	function display( $params )
	{
		$this->init_display( $params );

		// List of posts:
		$this->disp_item_list( 'posts' );

		return true;
	}
}
?>

2 Mar 03, 2008 04:58

In the widget look for

'limit' => array(
					'label' => T_( 'Display' ),
					'note' => T_( 'Max items to display.' ),
					'size' => 4,
					'defaultvalue' => 20,
				),

and adjust the default value to what you want.

3 Mar 03, 2008 06:43

The problem is : the code you're talking about doesn't exist since i'm on 2.0.1... The code of the widget is what I posted. But thx for fast replying.

4 Mar 03, 2008 07:01

Hi IsabelleGusse. Anyone using ANY of the 2.* branch should be upgrading with each new release until a "stable" comes along. That currently means 2.4.0-RC2, which is way ahead of 2.0.* in many regards. Any work you've done to your skin *should* be able to stand the upgrade cycle, but for sure there are many new features that your skin won't know about because they didn't exist back then.

So yeah I'd say the problem is not that John replied with up-to-date code; rather it is that you're using code no one should be using anymore.

You should upgrade. Then you'll find that the widget in question has a setting for how many to show. And by the way quite a few other settings as well :D

5 Mar 10, 2008 10:09

Done. It was more simple than I tought...

Thxs, both of you.


Form is loading...