These instructions will walk you through the basic creation of an Add-on using Visual Studio .NET.
- Install Contensive on your Development Machine. See Installation and Setup for details.
- Open Visual Studio and create a new Class Library project. This sample is Visual Basic.
- Open project properties, click Application and remove the Root Namespace, because it is included in the sample code.
- On the compile tab, click build events and paste this into Post-Build event (correcting paths as needed)
copy $(TargetDir)"*.dll" "C:\Program Files\kma\Contensive\Addons" - Add a reference to cpBase.dll -- usually found in c:\Program Files\kma\Contensive
- Paste the following code into the created class file.
Namespace Contensive.Addons
'
' Hello World
'
Public Class HelloWorldClass
Inherits BaseClasses.AddonBaseClass
Public Overrides Function Execute(ByVal CP As Contensive.BaseClasses.CPBaseClass) As Object
Return "Hello World"
End Function
End Class
End Namespace - Build the DLL.
- Go to your admin site and open the navigator to Navigator >> Manage Addons >> Advanced >> click on Add-ons
- Click Add to create a new addon. Set the following
- Set the name to Hello World
- Click the DLL tab and enter "Contensive.Addons.HelloWorldClass" in the Dot Net Class Full Name
- Click the Placement tab and check the box "Place on Pages"
- Click OK to save and close the record
- Go to the public site and turn on Quick Edit.
- Put the cursor anywhere in the wysiwyg editor and click the 'addons' drop-down menu. Select "Hello World" and a green addon will appear in your content.
- Click OK to close the editor and in it's place on the page will be "Hello World"
- To deploy the new addon on another server, see Deploying an Addon Collection