As you know (or may know) any custom tag can be called in both 'start' and 'end' mode. What does this mean? When CF encounters the following code:

lots of code

The custom tag foo will actually be run twice. Inside the tag, you can check to see which mode you are in by examining thisTag.executionMode. This technique allows for many cool custom tags, but that's not why I'm posting.

If you use cfmodule to call foo, you can still use 'wrappers' as I have defined above, you simply end the call with </cfmodule> instead of </cf_sometag>. However, if you have ANY cfmodule call inside your tag pair, CF can get confused by the </cfmodule> call. To get around that, you simply use a closing / at the end of the call:

<cfmodule template="..." />

However - this will execute your tag twice. So, how do you get around it? You could check executionMode like so:

<cfif thisTag.executionMode is "start">
lots of code

However, why wrap an entire tag in one big cfif? Instead, simply do:

<cfif thisTag.executionMode is "end"><cfexit></cfif>

This makes your code easier to read and simpler to debug.