3

We have situation where we need to implement custom tcdl tag on page level:

In page dwt we added this new tag:

<!DOCTYPE html>
<html lang="@@language@@">
<head>

<!-- TEST NEW REL ALTERNATIVE TAGS -->
<rel:RelHelloWorld />
<!-- END OF TEST REL ALTERNATIVE TAGS -->
</head>

Java class that should render this tag returns only comment (as you can see in code bellow):

public class RelHelloWorld implements TagRenderer
{

@Override
public String doEndTag(Tag arg0, StringBuffer arg1, TransformContext arg2, OutputDocument arg3)
        throws TCDLTransformerException {
    // TODO Auto-generated method stub
    return "<!-- Hello World -->";
}

@Override
public int doStartTag(Tag arg0, StringBuffer arg1, TransformContext arg2, OutputDocument arg3)
        throws TCDLTransformerException {
    // TODO Auto-generated method stub
    return 0;
}

@Override
public boolean requiresCodeBlock(TransformContext arg0, OutputDocument arg1, Tag arg2) {
    // TODO Auto-generated method stub
    return false;
}
}

We uploaded jar with this tag into session service and in custom_tcdl_tag_bundle.xml we register this tag:

<Tag Namespace="rel" Name="RelHelloWorld">
        <Handler Class="com.org.tridion.tags.RelHelloWorld" AllowCodeBlock="false" />
</Tag>

Then we updated cd_dynamic_conf.xml:

<TCDLEngine>
        <Properties>
                <Property Name="tcdl.dotnet.style" Value="controls"/>
                <Property Name="tcdl.jsp.style" Value="tags"/>
                <Property Name="tcdl.target.language" Value="rel"/>
        </Properties>
        <TagBundle Resource="custom_tcdl_tag_bundle.xml"/>
</TCDLEngine>

After restarting of services and republish of page, tag is present: enter image description here

Also, we updated tcdl-conf.xml in deployer-worker, but result is same:

<?xml version="1.0" encoding="UTF-8"?>
<TCDLEngine xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schemas/tcdl-conf.xsd" Version="8.5">
        <Properties>
                <Property Name="tcdl.page.target.language" Value="jsp" />
                <Property Name="tcdl.target.language" Value="rel" />
        </Properties>
        <TagBundle Resource="com/tridion/smarttarget/tcdl/tagbundle.xml" />
</TCDLEngine>

I want to emphasize that this custom tag works when it is added on dwt of any Dynamic Component Presentation.

Does anybody know what we are missing? Thanks

4
  • Please provide a bit more details of your web application is it .net or java? Is it using DXA or webform?
    – Velmurugan
    Oct 16 '19 at 20:26
  • web application is in java Oct 17 '19 at 7:43
  • I could be wrong, but I don't think it's working for items that are stored on the filesystem. Are your pages stored in the database or on disk? Oct 18 '19 at 9:37
  • Pages are saved on file system and if you set Target language it should work, or we suspect to work tridion.stackexchange.com/questions/14295/… Oct 18 '19 at 9:41
1

Apparently, this issue is resolved by implementing Apache Freemarker servlet.

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.