An Immediacy plug-in is a special type of ASP.NET User Control that allows you to extend the functionality of the core content management system. http://www.immediacy.net/
Follow these instructions to create a custom plug-in for the Immediacy/CMC CMS.
Create a new directory within the Immediacy plug-ins directory for your plug-in. This new directory will hold the .ascx file for your user control plus your Immediacy editor dialogue UI (Which is a special web file that allows you to change the plug-in settings from within the Immediacy editor).
The name of your plug-in directory should have the same name as the “tagName” you use to register the User Control in Immediacy’s web.config file.
Build your ASP.NET User Control to perform your custom functionality making sure that you create public properties in your C#/VB.NET code for all the properties you would like configurable from within the Immediacy editor.
Add a reference to the Immediacy.Web assembly to your project.
Next, add these attributes to your User Control class.
[PluginDesigner(PluginDesignerType.Html, "PluginCmsDialogue.aspx", Height = 400, Width = 400)]
[PluginInfo("My First Plug-in", "CMS Plug-in Category", Description = "Description of my Plug-in")]
public partial class Comments : System.Web.UI.UserControl, INamingContainer
// Your plug-in code here
If you don’t add these class attributes your plug-in properties will not be configurable from within Immediacy, but the plug-in will still work.
If you don’t have public properties that you want editors to be able to change you can skip creating a dialogue box for your plug-in.
Create an Editor Dialogue Pop-up
Create a CMS dialogue page which will allow Immediacy users to change the properties of your custom plug-in from within the editor. The name of this file is referenced in the class attributes above (e.g. PluginCmsDialogue.aspx) .
Create a simple HTML form with form elements to match each public property of your plug-in class.
Add two HTML buttons, one for OK, one for Cancel. Give them IDs of ok and cancel respectively.
Dialog=new DialogObject("name of plugin", 400, 400); Dialog.UniqueKeys=false;
// Load each property and update the dialogue box
// Add functionality to the OK and Cancel HTML buttons
// Perform validation here
// Save each property
// Update the Immediacy control UI placeholder
Dialog.InnerHTML="<div style='background:#DDDDDD; color:#000000; float:left; padding:10px; clear:both;'><strong>Comments Enabled : </strong>Status of Plug-in</div>";
At the bottom of your dialogue HTML call the Init() function as below.
Install the Plug-in
Register your ASP.NET User Control to Immediacy’s web.config under <pages><controls> as you would with an ordinary User Control. Ensure the “tagName” is the same as the plugin directory name for your plugin.
<add tagPrefix="MyUserControls" tagName="PluginName" src="~/plugins/ PluginName /test.ascx"/>
Build your project in Visual Studio.
Copy the .ascx and your dialogue box HTML file to the /plugins/PluginName folder.
Copy the .dll file to the Immediacy bin folder.