We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

How can I show a Plugin on an other Page? | Forum

Marina Bircher
Marina Bircher May 29 '15
There is a Widget Plugin (google map location) which I can show it on the Dashboard.


How can I programmatically get this Widget shown on another Page?


Guna
Guna Jun 1 '15

Hi Marina,


Go to your plugin's activate.php.


There you will find the list of widgets available in the plugin with the information about where they should display (User Dashboard page, User Profile Page and in any other custom page).


$widgetService = BOL_ComponentAdminService::getInstance(); // You already had this line in your plugin's activate.php since there is a widget in place.


$widget = $widgetService->addWidget('Widget Class Name', false);// This line also you can see in your plugin.

$widgetPlace = $widgetService->addWidgetToPlace($widget, BOL_ComponentService::PLACE_PROFILE);// This code is responsible to display in which page the widget should display.

$widgetService->addWidgetToPosition($widgetPlace, BOL_ComponentService::SECTION_RIGHT); // This code is responsible for the position that the widget should display in that page.


Since you said that the widget is showing in dashboard page, you can see a line of code which consist of PLACE_DASHBOARD in your activate.php


Also go to this page to know about widgets https://docs.oxwall.org/dev:begin:widget



Alia Team
Alia Jun 2 '15
Thanks for great answer Guna
Glen Williamson
Glen Williamson Dec 1 '15
$widget = $widgetService->addWidget('Widget Class Name', false);


The above line says true at the end of the slidedshow activate.php.  Does it matter if it set to true or false?


I took out the // on the line with PLACE_DASHBOARD, did debug, refresh, put debug back to false, but the Slideshow still isn't showing up in the User Dashboard on the Admin side.  What am I doing wrong?


Thanks..