Created
March 22, 2023 12:37
-
-
Save bennadel/e7e78bd5242674e19f1d9f0384e6c012 to your computer and use it in GitHub Desktop.
Russian Doll Content Wrapping With CFSaveContent In ColdFusion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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