Recent Topics

1 Nov 29, 2009 17:07    

My b2evolution Version: 2.x

If this is in the wrong place, then you have my apologies.

Just for tidiness sake, I'd like to be able to add a header to the 'Long Description' widget that I use in my sidebar, much like happens with Linkblog, Recent Posts and FreeHTML. It's not something that can be edited within the widget itself at the moment, but I wondered how difficult something like that would be to implement. Is this worth the effort?

2 Nov 29, 2009 17:42

Add the new function and extra line /inc/widgets/widgets/_coll_longdesc.widget.php

  /**
   * Get definitions for editable params
   *
	 * @see Plugin::GetDefaultSettings()
	 * @param local params like 'for_editing' => true
	 */
	function get_param_definitions( $params )
	{
		$r = array_merge( array(
			'title' => array(
				'label' => t_('Block title'),
				'note' => T_( 'Title to display in your skin.' ),
				'size' => 40,
				'defaultvalue' => '',
			),
		), parent::get_param_definitions( $params )	);

		return $r;
	}
	/**
	 * Display the widget!
	 *
	 * @param array MUST contain at least the basic display params
	 */
	function display( $params )
	{
		global $Blog;

		$this->init_display( $params );

		// Collection long description:
		echo $this->disp_params['block_start'];
		$this->disp_title();

¥

3 Nov 29, 2009 19:50

Thanks ¥åßßå, will give that a go.

4 Nov 29, 2009 20:05

That was easy. Thanks again.

6 Nov 29, 2009 22:01

One thing I did wonder is why that's not in the default install, given that filling the field in isn't mandatory. Presumably the database field is there regardless (no changes to the schema required to implement this). Not a biggie in any way, I'm just curious

7 Nov 30, 2009 08:27

You'd need to ask the evo devs ;)

¥


Form is loading...