Widget Plugin - Posted (2207 Views)
Forum Administrator
/mvc/ProtectedContent/Avatar/HuwR132430879466080654.jpg
Posts: 4383
starstarstarstarstar
This Plugin allows you to store HTML widget code in the forum database and then display the widgets in various places in your forum.

What is a widget?
A widget is a small snippet of html/JavaScript that some websites provide in order to display information from their sites, RSS feeds, weather forecasts etc. See below.



You can download the Plugin here ?filename=ForumWidgetsMOD.zip



Installing the Plugin
  1. Unzip the contents of the downloaded file
  2. Copy the file in the App_Data folder to your Forums App_Data folder on the webserver
  3. Copy the ForumWidgets folder and its contents to your Forums Plugins folder
  4. Open your forum in a browser, Navigate to the Admin/Tools page and use the 'Reset Application' button to recycle the application.
Adding a menu link
To add a link to the Widget admin, open the file /Views/Shared/_AdminMenu.cshtml in a text editor.
Add the following code wherever you want the link to appear.
Code:

@if (SnitzConfig.Config.TableExists("FORUM_WIDGETS"))
{
<li>@Html.ActionLink("Manage Widgets", "Admin", "Widgets")</li>
}

The if statement ensures that the menu item only appears if the widget table exists in the database.


Adding the Widget to a page
The widget can be placed anywhere in a page template so that it appears on that page, or it can be added to all pages by adding to the main Layout template.
To display your widget, simply add the code below where you want the widget to be displayed.

@Html.Action("Display","Widgets",new{name="WIDGETNAME"})
Signature Test