Dynamicweb Namespace : ContentModule Class |
ContentModule
is responsible for having the paragraph return some module output. Inherit this class and override the GetContent method to return the HTML for the module as a string.'Declaration
Public MustInherit Class ContentModule
public abstract class ContentModule
ContentModule
needs and attribute AddInName
with a module system name specified. The module system name needs to be a-z and 0-9 and no spaces etc.using Dynamicweb.Extensibility; namespace Dynamicweb.Examples.CSharp { [AddInName("ModuleSystemName")] public class Frontend : ContentModule { public override string GetContent() { //Get an instance of a template object var template = new Dynamicweb.Rendering.Template("ModuleSystemName/Template.html"); //Set a tag named "Text" with the value from the HelloText property template.SetTag("Text", Properties.Values["HelloText"].ToString()); //Add a tag with the system name of the module. That would be the same as in the [AddInName()] attribute template.SetTag("ModuleSystemName", this.ModuleSystemName); //Add the page id executing the page with the paragraph where this module is attached template.SetTag("PageID", this.Pageview.ID); //Return the parsed template to the event handler return template.Output(); } } }
Imports Dynamicweb.Extensibility Public Class ContentModuleSample <AddInName("ModuleSystemName")> _ Public Class Frontend Inherits Global.Dynamicweb.ContentModule Public Overrides Function GetContent() As String 'Get an instance of a template object Dim template As Global.Dynamicweb.Rendering.Template = New Global.Dynamicweb.Rendering.Template("ModuleSystemName/Template.html") 'Set a tag named "Text" with the value from the HelloText property template.SetTag("Text", Properties.Value("HelloText")) 'Add a tag with the system name of the module. That would be the same as in the <AddInName()> attribute template.SetTag("ModuleSystemName", Me.ModuleSystemName) 'Add the page id executing the page with the paragraph where this module is attached template.SetTag("PageID", Me.Pageview.ID) 'Return the parsed template to the event handler Return template.Output() End Function End Class End Class
System.Object
Dynamicweb.ContentModule
Dynamicweb.eCommerce.Frontend.Cart.Frontend
Dynamicweb.eCommerce.Frontend.Frontend
Dynamicweb.Modules.DataManagement.FormFrontend
Dynamicweb.Modules.DataManagement.PublishingFrontend
Dynamicweb.Modules.UserManagement.Frontend
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2