Dynamicweb Namespace > ContentModule Class : GetContent Method |
ParagraphModule
in the paragraph template.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
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