Invokes a custom tag for use in CFML application pages.
This tag processes custom tag name conflicts.



Attribute Reference

template string

Mutually exclusive with the name attribute. A path to the
page that implements the tag.

Relative path: expanded from the current page
Absolute path: expanded using CFML mapping
A physical path is not valid.

name string

Mutually exclusive with the template attribute. A custom
tag name, in the form "Name.Name.Name..." Identifies
subdirectory, under the CFML tag root directory,
that contains custom tag page.
For example (Windows format):

cfmodule name = "superduper.Forums40.GetUserOptions"

This identifies the page GetUserOptions.cfm in the
directory CustomTags\superduper\Forums40 under the
CFML root directory.

attributecollection struct

A collection of key-value pairs that represent
attribute names and values. You can specify multiple
key-value pairs. You can specify this attribute only



Version 3+ ColdFusion supports the cfmodule() script syntax


Lucee Supports script syntax module template="file.cfm"

Sample code using the cfmodule tag

<cfmodule template="\layout\default\mainheader.cfm">

<cfmodule template="..\..\..\layout\register\sectionheader.cfm">

<cfmodule name="layout.corp.copyright">

<cfmodule template="\layout\default\mainheader.cfm" theme="default" pageTitle="Welcome!">

<cfset attrs = {theme = "default", pageTitle = "Welcome!"}>
<cfmodule template="\layout\default\mainheader.cfm" attributecollection="#attrs#">

In this example, the <p> tag and it's content will be available to super-duper-formatter.cfm to perform whatever the formatting logic dictates.

<cfmodule template="\layout\super-duper-formater.cfm">
   <p>Some content the module will format</p>

In this example, show how to invoke using cfscript.

<cfscript>attrs = {theme = "default", pageTitle = "Welcome!"}>

Fork me on GitHub