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
- 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
- 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 value | Meaning |
|---|
IterationTagSupport.EVAL_BODY_AGAIN | Iteration is not finished. Continue processing tag contents. |
IterationTagSupport.SKIP_BODY | Iteration is finished. |
- Save and close your class and recompile it.