# Writing Custom CFML Tags

Writing a custom tag in CFML is no different from writing any CFML template. You can use all CFML constructs, as well as HTML.

Custom tags are stored either in the current directory or under the `customtags` directory. You call them using the CF_ prefix. Beyond that, you are free to use any naming convention that fits your development practice. Unique descriptive names make it easy for you and others to find the right tag. For example, the tag name CF_getweather invokes the file `getweather.cfm`

If you are concerned about possible name conflicts when invoking a custom tag or if the application must use a variable to dynamically call a custom tag at runtime, the CFMODULE element provides a solution.

Note | While tag names in templates are case-insensitive, custom tag file names must be lower case on UNIX.

### Defining attributes

CFML custom tags support both required and optional attributes. Attributes are defined as name-value pairs. Custom tag attributes conform to CFML coding standards:

- ColdFusion passes any attributes in the ATTRIBUTES scope.
- Use the CFPARAM tag at the top of a custom tag to test for and assign defaults for each attribute that may be passed from a calling template.
- Use the ATTRIBUTES.attribute_name syntax when initializing passed attributes to distinguish them from local ones.
- Attributes are case-insensitive.
- Attributes may be listed in any order within a tag.
- Attribute = value pairs for a tag must be separated by a space.
- Passed values that contain spaces must be enclosed in double-quotes.