page plug-in development


Steps

Description

Remark

Setup environment

Create a plug-in project using the VS.NET extension template. Give it a name.

As per version 4.3, all extensions development has been moved into one VS.NET extension template.

Find the sample code under “/extensions/pageplugin”. To create a page plug-in, uncomment the right code file and move it the file location you want.

Development

Options1, Implement IHttpMethodPagePlugin

HttpGet:  Handle HTTP GET request
HttpPost:  Handle HTTP POST request

 

Option 2, Implement IPagePlugin

Execute: will be executed for both Post and Get events

 

Data communication

Use ViewBag to transfer code result to pages
context.ControllerContext.Controller.ViewBag

 

Debug

-         First build your VS project to generate the dlls

-         Run your VS extension project, it is a standard Kooboo website, login to the CMS and navigate to the website you want to debug with.

-         Upload your dll (eg kooboo.cms.myname.dll) under the site “Extension/Plug-ins” menu.

-         Insert the plug-in into page, layout or view to start developing and debugging

Debug feature will be improved in the next version. This is a history solution.

Deployment &
Use the plug-in

-         On the site that requires this plug-in, goes to “Extension/plug-ins”, and upload the plug-in dll there. Your plug-in is now available on that website.

-         In the page, layout or view editing screen, add the plug-in to it.

Plugin is site based now, each site should upload its own plugin dlls. Dlls exist in the same bin location and will overwrite each other.