Return to v2.0 docs

includeContent()


View Helpers Miscellaneous Functions string controller


Used to output the content for a particular section in a layout.

Name Type Required Default Description
name string No body Name of layout section to return content for.
defaultValue string No What to display as a default if the section is not defined.
<!--- In your view template, let's say `views/blog/post.cfm--->
contentFor(head='<meta name="robots" content="noindex,nofollow">');
contentFor(head='<meta name="author" content="[email protected]">');

// In `views/layout.cfm`
<html>
	<head>
	    <title>My Site</title>
	    #includeContent("head")#
	</head>
	<body>
		<cfoutput>
			#includeContent()#
		</cfoutput>
	</body>
</html>

Related Functions

Miscellaneous Functions