Documentation Center

Making your custom TCDL tag iterative

If you want to make a TCDL tag iterative (that is, if you want its contents to be processed in a loop), implement a role interface called IterationTagSupport, which contains a doAfterBody() method.

Procedure

  1. In the Java class that represents your custom TCDL tag, edit the header to also implement the IterationTagSupport interface. Although you could do this for a class that implements com.tridion.tcdl.TagHandler, this would typically only make sense a class that implements com.tridion.tcdl.TagRenderer
  2. Add an implementation for the sole method of this interface, doAfterBody(Tag tag, StringBuffer tagBody, TransformContext context, OutputDocument target). The method should return one of the following constants:
    Return valueMeaning
    IterationTagSupport.EVAL_BODY_AGAINIteration is not finished. Continue processing tag contents.
    IterationTagSupport.SKIP_BODYIteration is finished.
  3. Save and close your class and recompile it.