1

I intend to implement TCDL on Web 8.5 I'm using RESTful Broker API (Java).

I saw manual but I couldn't understand how to implement and configure TCDL.

Creating custom TCDL tags

The manual describes to use com.tridion.tcdl.TagRenderer to create Java class, but there is no such class in RESTful Broker API.

Also the manual describes to edit cd_dynamic_conf.xml and tcdl-conf.xml, but there is no such files in RESTful Broker API's classes directory.

"In process" API have com.tridion.tcdl.TagRenderer class, but I'm not sure whether it can be used in RESTful Broker API environment.

Does anyone know how to implement and configure TCDL on a Web site with RESTful Broker API?

Perhaps TCDL have to be installed in Content Service, not client Web site?

3

Implementation requires the following steps:

  1. To start to create your own custom TCDL tags jar using Maven + IntelliJ IDEA Java development tools to create a Java class that implements the interface com.tridion.tcdl.TagRenderer.
  2. Dependent SDL jar files from [Install-Media]\SDL Web 8.5\Content Delivery\roles\content\standalone\services\content-v2-service

    • cd_core-8.5.0-1011.jar
    • cd_dynamic-8.5.0-1014.jar
    • cd_linking-8.5.0-1014.jar
    • cd_tcdl-8.5.0-1014.jar

      package com.sample.tcdl.tags;
      
      import com.tridion.tcdl.*;
      
      public class SampleImageRenderer implements TagRenderer
      {
          private String alt = "";
          private String target = "";
      
          private TransformContext context;
      
          public void setRequiredAlt(String alt)
          {
              this.alt = alt;
          }
      
          public void setTarget(String target)
          {
              this.target = target;
          }
      
          @Override
          public int doStartTag(Tag tag, StringBuffer content, TransformContext context, OutputDocument document) throws TCDLTransformerException {
      
              //ToDo
              return Tag.CONTINUE_TAG_EVALUATION;
          }
      
          @Override
          public String doEndTag(Tag tag, StringBuffer content, TransformContext context, OutputDocument document) throws TCDLTransformerException {
          }
              //ToDo
              return content.toString();
          }
      
          @Override
          public boolean requiresCodeBlock(TransformContext transformContext, OutputDocument outputDocument, Tag tag) 
          {
             return false;
          }
      }
      
      1. Update the Content Services. Copy the jar file eg. sampleimage-1.0-SNAPSHOT.jar into the lib folder of the Content Service this jar contains the Custom TCDL tag control:image

      2. In the file cd_dynamic_conf.xml, located in the config folder of the Content Service Add <TagBundle Resource="SampleImageTagBundle.xml" />; right before the closing tag </TCDLEngine> Note: SampleImageTagBundle.xml you can also include in the part of jar file, so that no need to copy it separately. This contains the tag definition of control:image

tcdl-conf.xml - you can find it in the deployer-compined or deployer-worker config folder of the micro services of installation media folder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.