- b2evolution CMS Support Forums
- b2evolution Support
- Plugins & Extensions
- Plugin development assistance
- Call a $param to display into SkinBeginHtmlHead( & $para
1 achillis Jun 11, 2011 04:27
Hi, Can you please give me some direction please? I am developing this plugin and all works well, except I am not successful to display a setting in SkinBeginHtmlHead( & $params ) specified in my get_widget_param_definitions( $params )
here is a sample:
function get_widget_param_definitions( $params )
{
return array(
'theme' => array(
'label' => $this->T_('theme'),
'note' => $this->T_('Modify this option with the desired theme name'),
'type' => 'select',
'options' => array( 'default' => 'default', 'metallic' => 'metallic' ),
'defaultvalue' => 'true'
),
);
}
function SkinBeginHtmlHead( & $params )
{ global $Plugins, $plugins_url;
$comm_start = '<!-- Start plugin -->';
$comm_end = '<!-- End plugin -->';
$jvscode = '
jQuery.noConflict();
(function($) {
$(function () {
$("#theme").theme({
[b]theme : "'.$params['theme'].'",[/b]
});
});
})(jQuery);';
$plug_url = $this->get_plugin_url();
require_js( $plug_url . 'js/demo.js', true );
add_headline( $comm_start );
add_js_headline( $jvscode );
add_headline( $comm_end );
return true;
}
}
When this code is rendered in the browser everything works except theme shows up empty-> theme : ""
Any ideas for me please? Thanks.
This value should be the one defined in options.
I believe you can only use "get_widget_param_definitions" in widget context e.g. when called from SkinTag hook. You specify widget params there.
All global params should go in "GetDefaultSettings"
In your case you can simply rename "get_widget_param_definitions" to "GetDefaultSettings" and then replace $params['theme'] with