Recent Topics

Plugin Name for List View

Started by on May 05, 2017 – Contents updated: Jun 02, 2017

May 05, 2017 12:34    

Please can the functionality be added to make it possible to allow plugins that is widget type to have a different name based on the content in the Widget List View?

Widget Name in List view to behave exactly like "Core" widgets but for "Plugin" widgets.

At the moment, all the "Plugin" widgets display the Plugin name, and this makes it troublesome to identify what its for.

May 08, 2017 00:58

@achillis it's a bit difficult to make both, core and plugin widgets, behave exactly the same because they extend from different classes.

Maybe we can make plugin widgets to display something like: Short description (Plugin's name - [Plugin]), instead of: Plugin's name (Plugin), as it's done right now. So, short_desc is defined in the code of the plugin.

However, making plugin widgets to dynamically display the Block title value in the list is more complicated, I guess.

May 24, 2017 00:23

This is all unclear to me.

@achillis Can you post a screenshot of what you see and annotate it with what you would like to see?

We'll see what we can do. We are working on big changes regarding the widget management...

May 24, 2017 08:50

@See /inc/widgets/_widget.class.php //line 189

/**
	 * Get a clean description to display in the widget list.
	 * @return string
	 */
	function get_desc_for_list()
	{
		$name = $this->get_name();

		if( $this->type == 'plugin' )
		{
			return '<strong>'.$name.'</strong> ('.T_('Plugin').')';
		}

		$short_desc = $this->get_short_desc();

		if( $name == $short_desc || empty($short_desc) )
		{
			return '<strong>'.$name.'</strong>';
		}

		return '<strong>'.$short_desc.'</strong> ('.$name.')';
	}

May 27, 2017 12:04

@achillis so, it would be something like this:

/inc/widgets/_widget.class.php //line 193

function get_desc_for_list()
{
	$name = $this->get_name();

	if( $this->type == 'plugin' )
	{
		if ( isset($this->disp_params['title']) && ! empty($this->disp_params['title']) ) {
			return '<strong>'.$this->disp_params['title'].'</strong> ('.$name. ' - ' .T_('Plugin').')';
		}

		return '<strong>'.$name.'</strong> ('.T_('Plugin').')';
	}

	$short_desc = $this->get_short_desc();

	if( $name == $short_desc || empty($short_desc) )
	{
		return '<strong>'.$name.'</strong>';
	}

	return '<strong>'.$short_desc.'</strong> ('.$name.')';
}

It would look like as in the screenshot below.

Jun 02, 2017 16:13

@achillis it will be included in the beta branch indeed, I'm still not sure if it will be released in version 6.9.2 or later.


Form is loading...

powered by b2evolution free blog software – This forum is powered by b2evolution CMS, a complete engine for your website.