Posts mit dem Label RenderTag werden angezeigt. Alle Posts anzeigen
Posts mit dem Label RenderTag werden angezeigt. Alle Posts anzeigen

Mittwoch, 13. März 2013

Custom render tags API documentation finished

The documentation of the custom render tags API has been finished in the OpenText developer network community. You can have a look here: http://tinyurl.com/OTDN-WSM

The documentation now contains details step by step samples for
  • Custom render spots:
    • Global constants render spot
  • Custom provider:
    • Global constants page / Global constants provider
  • Custom render tags:
    • Reformatting comma separated lists as XML
    • Page state information
In addition, the documentation contains information about general problems like:
  • How to cache information within customizations?
  • How to execute RQLs within customizations?
  • How to log information within customizations?
  • Where to put configuration data for customizations?

I'm curious to see the first customizations getting implemented. Let me know if there's something missing in the documentation or if you would like to see some additional examples.

Mittwoch, 6. Februar 2013

Finished first examples on custom render spots and provider

The custom render tags API documentation now contains the first two getting started examples for implementing a custom render spot and a custom object loader. These two examples show how to build a simple syntax for accessing global constant values like the text resources in the Best Practices Project more easily by just using two commands within your template:

<%% InitializeFromPage(A8EE657A1A8446CF90437A74B5CFEC6D) %%><div id="header" role="banner">
<!IoRedDotOpenPage>
<!IoRangeNoEditMode>
<%% stdLabelOpen %%>
<!/IoRangeNoEditMode>
<!IoRangeRedDotEditOnly>
<%% stdLabelClose %%>
<!/IoRangeRedDotEditOnly>

instead of using the more complex, redundant and more error-prone builtin commands like this:
<div id="header" role="banner">
<!IoRedDotOpenPage>
<!IoRangeNoEditMode>
<%!! Context:Pages.GetPage(Guid:A8EE657A1A8446CF90437A74B5CFEC6D).Elements.GetElement(stdLabelOpen).GetHtml() !!%>
<!/IoRangeNoEditMode>
<!IoRangeRedDotEditOnly>
<%!! Context:Pages.GetPage(Guid:A8EE657A1A8446CF90437A74B5CFEC6D).Elements.GetElement(stdLabelClose).GetHtml() !!%>
<!/IoRangeRedDotEditOnly>

Both examples come with full source code and compiled assembly. Read more on OTDN here.

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