O'Reilly logo

ColdFusion 9 Developer Tutorial by John Farrar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Nested tags

Let's have a look at how we can create a nested custom tag. Our parent will be the sidebar tag and the child tags will be sidebar_section and sidebar_item. We will learn how it allows us to separate content from containers. This type of coding helps us to send AJAX and FLEX, and other content in the future. In this chapter, we will be concentrating on HTML.

First, we will create a single sidebar tag in a similar way to how we created the custom tags for the header and footer. It will give us a chance to see how we use our thisTag.executionMode = "end" logic. To learn more, we are going to use the conditional switch logic. You can either use switch or if logic:

<cfswitch expression="#thisTag.executionMode#"> <cfcase value="start"> <!--- ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required