1 kenton Sep 30, 2011 16:54
3 kenton Sep 30, 2011 22:39
Methinks you are confusing me. Taking me out to explore a plugin that is not within scope is just adding to the confusion.
I thought it was a simple question and fairly clear. The editing of widgets/_coll_category_list.widget.php is the simplest way to get where I want to (and the simplest way back should it mess up). I can see no alternative without completely reinventing the wheel. That does not seem to be a good solution.
As indicated I am half way to a solution. The new parameter of my widget works and is visible and editable in Dashboard and the raw php code works withing the widget. So there is nothing wrong with that.
It is simply that one of the parameters used inside the coded function display does not take the value given to it in the skin_container passed params array.
I could easily add more code (another parameter 'working_use_form' perhaps and then test and code accordingly. But this seems to be a total waste of coding and effort when there is a name_parameter and a perfectly valid test already there.
I just do not understand why $this->disp_params['new_param'] works yet $this->disp_params['use_form'] doesn't?
4 kenton Oct 01, 2011 16:46
OK I have got it to do almost what I wanted by adding yet another parameter.
So now back to examining it as a plugin.
sam2kb wrote:
Pick a plugin that provides a widget, like the one I released yesterday
http://forums.b2evolution.net/viewtopic.php?t=22919See how it works, in SkinTag() method you use $params['my_param'] instead of $this->disp_params['my_param']
That looks essentially what I have done BUT and it is a big but how do I call the display method from index.main.php ?
(This might be a real numbskull question.)
For example I have loaded your widget in Dashboard > Gallery > Global settings ? > Plugin configuration
Then activated it in Dashboard > Blog settings > Widgets under the chosen Skin Block.
Nothing appears on the screen - I have even tried calling it through SkinTag(NT_('SubMenu'), array(...
but that just causes a bad error.
5 sam2kb Oct 02, 2011 23:10
That plugin is for b2evolution v4.
That looks essentially what I have done BUT and it is a big but how do I call the display method from index.main.php ?
To call a particular widget use this, check a_noskin.php for examples
skin_widget( array(
// CODE for the widget:
'widget' => 'my_code',
// Optional display params:
'list_start' => '<ul>',
'list_end' => '</ul>',
'item_start' => '<li>',
'item_end' => '</li>',
) );
The above code will only work on stock widgets. If you want to call a widget supplied by your plugin use this instead
// Call the coll_common_links widget:
$Plugins->call_by_code( 'my_code', array(
// Optional display params:
'list_start' => '<ul>',
'list_end' => '</ul>',
'item_start' => '<li>',
'item_end' => '</li>',
) );
First of all, are you editing a plugin or a widget from /inc/widgets/widgegts/_coll_category_list.widget.php ? It's not the same, you shouldn't work on existing widgets if you want to create a plugin.
Pick a plugin that provides a widget, like the one I released yesterday
http://forums.b2evolution.net/viewtopic.php?t=22919
See how it works, in SkinTag() method you use $params['my_param'] instead of $this->disp_params['my_param']