function getWidgetkit($name)
{
$db = JFactory::getDBO();
$db->setQuery("SELECT `id` FROM `#__widgetkit` WHERE `name` = '".$name."'");
$widgetkit_id = $db->loadResult();
$app = @include(JPATH_ADMINISTRATOR . '/components/com_widgetkit/widgetkit-app.php');
$output = $app->renderWidget(array("id"=>$widgetkit_id));
return ($output === false) ? 'Could not load widget' : $output;
}
// How to call function
echo getWidgetkit($widget_name);
How to Load Widgetkit (Yootheme) in a custom Joomla! extension.
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.