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"> <!--- No code here at this time. ---> </cfcase> <cfcase value="end"> <cfoutput> <div id="sideBar"> <div class="relatedLinks"> <h3>Custom Tags</h3> ...