Miscellaneous
includeContent()
Signature
Section titled “Signature”includeContent() — returns any
Description
Section titled “Description”Used to output the content for a particular section in a layout.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | yes | body | Name of layout section to return content for. |
defaultValue | string | yes | — | What to display as a default if the section is not defined. |
Examples
Section titled “Examples”<!--- In your view template, let''s say `views/blog/post.cfm --->
<cfset contentFor(head=''<meta name="robots" content="noindex,nofollow">"'')>
<cfset contentFor(head=''<meta name="author" content="wheelsdude@wheelsify.com"'')>
<!--- In `views/layout.cfm` --->
<html>
<head>
<title>My Site</title>
##includeContent("head")##
</head>
<body>
<cfoutput>
##includeContent()##
</cfoutput>
</body>
</html>