Skip to content

Instantly share code, notes, and snippets.

@bennadel
Created March 22, 2023 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bennadel/e7e78bd5242674e19f1d9f0384e6c012 to your computer and use it in GitHub Desktop.
Save bennadel/e7e78bd5242674e19f1d9f0384e6c012 to your computer and use it in GitHub Desktop.
Russian Doll Content Wrapping With CFSaveContent In ColdFusion
<cfoutput>
<!--- Define the initial BODY content. --->
<cfsavecontent variable="body">
<p>
This is the body!
</p>
</cfsavecontent>
<!--- Wrap the BODY content in more content. --->
<cfsavecontent variable="body">
<header>
This is the header.
</header>
<main>
#body#
</main>
<footer>
This is the footer.
</footer>
</cfsavecontent>
<!--- Wrap the BODY content in EVEN MAOR content! --->
<cfsavecontent variable="body">
<!doctype html>
<html lang="en">
<head>
<title>
ColdFusion is Amaze-balls!
</title>
</head>
<body>
#body#
</body>
</html>
</cfsavecontent>
<!--- Output the doubly-wrapped content. --->
#body#
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment