Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].
Hi!
I’m developing a SO widget which offers several different options and “look”, set via a `select`form field type.
As you can see, using 3 instances of the same widget could quickly become confusing.
How can I display each widget’s current option state in the Page Builder Editor ? I’ve discovered that the ‘panels_title’ key set to false at least hides the query vars url, which is good. Can it perhaps display current instance’s option values?
class Vignette_Widget extends SiteOrigin_Widget { function __construct() { //Here you can do any preparation required before calling the parent constructor, such as including additional files or initializing variables. //Call the parent constructor with the required arguments. parent::__construct( // The unique id for your widget. 'vignette-widget', // The name of the widget for display purposes. 'Vignette Widget', // The $widget_options array, which is passed through to WP_Widget. // It has a couple of extras like the optional help URL, which should link to your sites help or support page. array( 'description' => 'Une "vignette" d'un article et son affichage.', 'panels_groups' => array('customer'), 'panels_icon' => 'dashicons dashicons-analytics', 'panels_title' => false, // 'help' => 'http://example.com/hello-world-widget-docs', ),
Thanks!!!
Hello,
I know this is an old thread but I encountered the same problem and I would like to share a viable solution.
The description of the widget is written by the main js “siteorigin-panels-xx.js”, specifically through a (misnamed?) function getTitle, line 2835 as of version 24.
In the line 2842 you can find
Here seems like developers put the basis for panels_title usage, but considering it only if set to false.
I would suggest to use panels_title as a reference to the field that we want to display as description of the widget:
Of course this is just a temporary solution, but I would like to suggest this feature to the official developers, it can be very helpful when you need a lot of widgets on the same page.
Hope it helps!
Have a nice day
Luigi