Posts mit dem Label Navigation werden angezeigt. Alle Posts anzeigen
Posts mit dem Label Navigation werden angezeigt. Alle Posts anzeigen
Dienstag, 15. Januar 2013
Custom RenderTag Documentation
I just started writing additional Custom RenderTag documentation that will be part of the Web Site Management Community in the OpenText Knowledge Center. In addition to the documentation that is already part of the RQL documentation, it tries to give more examples, handson guides and a better overall overview about the architecture and lifecycle of a RenderTag.
Mittwoch, 29. Juni 2011
Developing Custom RenderTags
Did you ever think of implementing your own RenderTag to ease up template development?
Management Server already provides everything you need for that task. There was only one small bug that was actually blocking the load mechanism of custom RenderTags. This was fixed for version 11 now and will soon be available in one of the next hotfixes for 10.1 SP2.
Here are the steps to develop your own RenderTag:
1. Open up Visual Studio and create a new class library project, e.g. My.CustomRenderTag
2. Add references to Reddot.CMS and Reddot.CMS.Rendering
3. Now add a new class and implement the Reddot.CMS.Rendering.IRenderTag interface, e.g. HelloWorldRenderTag:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Reddot.CMS.Rendering.Tags;
using Reddot.CMS.Rendering.Objects;
using System.Xml;
using Reddot.CMS.Rendering;
namespace My.CustomRenderTag
{
public class HelloWorldRenderTag : IRenderTag
{
public HelloWorldRenderTag()
{
}
public void Render(RenderStream outputStream, TagProcessor tagProcessor, XmlNode tag, ObjectLoadManager objectLoadManager, PageBuildContext context)
{
string text = tag.InnerText;
if (string.IsNullOrEmpty(text))
{
outputStream.WriteLine("Hello World!");
}
else
{
outputStream.WriteLine("Hello {0}!", tag.InnerText);
} }
}
}
4. Build the project
5. Adapt the main.config in your ASP directory:
add the following line in the <RenderTag>-section:
<RenderTags>
<Tag name="helloworld" typename="HelloWorldRenderTag" namespace="My.CustomRenderTag" filename="<PathToAssembly>\My.CustomRenderTag.dll" />
6. Kill the RDCMSServiceProcess.exe
7. Now add your new RenderTag (<helloworld>) to your template
Management Server already provides everything you need for that task. There was only one small bug that was actually blocking the load mechanism of custom RenderTags. This was fixed for version 11 now and will soon be available in one of the next hotfixes for 10.1 SP2.
Here are the steps to develop your own RenderTag:
1. Open up Visual Studio and create a new class library project, e.g. My.CustomRenderTag
2. Add references to Reddot.CMS and Reddot.CMS.Rendering
3. Now add a new class and implement the Reddot.CMS.Rendering.IRenderTag interface, e.g. HelloWorldRenderTag:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Reddot.CMS.Rendering.Tags;
using Reddot.CMS.Rendering.Objects;
using System.Xml;
using Reddot.CMS.Rendering;
namespace My.CustomRenderTag
{
public class HelloWorldRenderTag : IRenderTag
{
public HelloWorldRenderTag()
{
}
public void Render(RenderStream outputStream, TagProcessor tagProcessor, XmlNode tag, ObjectLoadManager objectLoadManager, PageBuildContext context)
{
string text = tag.InnerText;
if (string.IsNullOrEmpty(text))
{
outputStream.WriteLine("Hello World!");
}
else
{
outputStream.WriteLine("Hello {0}!", tag.InnerText);
} }
}
}
4. Build the project
5. Adapt the main.config in your ASP directory:
add the following line in the <RenderTag>-section:
<RenderTags>
<Tag name="helloworld" typename="HelloWorldRenderTag" namespace="My.CustomRenderTag" filename="<PathToAssembly>\My.CustomRenderTag.dll" />
6. Kill the RDCMSServiceProcess.exe
7. Now add your new RenderTag (<helloworld>) to your template
Abonnieren
Posts (Atom)