Embedding CF in CMS Content

4 views
Skip to first unread message

hofar...@houseoffusion.com

unread,
Apr 17, 2015, 12:59:21 PM4/17/15
to ColdFusion Technical Talk

I have a situation where I need to embed a CFINCLUDE in a CMS data field
which is output. How do I get the include to render? Can I even do that?



Example is like <cfoutput>#mydata#</cfoutput> . the include is in the mydata
output. Can I evaluate or something?



Thanks







Robert Harrison
Full Stack Developer
AIMG
<mailto:rhar...@aimg.com> rhar...@aimg.com
Main Office: 704-321-1234 ext.118
Direct Line: 516-302-4345
<http://www.aimg.com/> www.aimg.com









~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360464

hofar...@houseoffusion.com

unread,
Apr 17, 2015, 1:11:45 PM4/17/15
to ColdFusion Technical Talk

No, CF won’t evaluate the output of a database query - nor should it.  That would pose all sorts of security and stability concerns.  A better solution is to incorporate the dynamic content you want in to your CMS as a module.  Most CMS systems have a method for including custom modular content.
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360465

hofar...@houseoffusion.com

unread,
Apr 17, 2015, 1:14:50 PM4/17/15
to ColdFusion Technical Talk

Thanks. I found another way around it. Just dealing with something that
was already put together strangely, where some embedded functional code into
a CMS WYSIWYG editor.

Robert Harrison
Full Stack Developer
AIMG
www.aimg.com



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360466

hofar...@houseoffusion.com

unread,
Apr 17, 2015, 1:33:32 PM4/17/15
to ColdFusion Technical Talk

when you need to put dynamic content then you should never allow CODE,
instead use macros
e.g.
[include:filename]

you then parse the content before displaying to process the macros.
read this article for more info:
http://www.michaels.me.uk/post.cfm/content-management-processing-dynamic-content


--

*Russ Michaels*
Blog: www.michaels.me.uk
*skype*: russmichaels

*My other sites/projects*
www.bluethunder.co : SME hosting solutions
www.cfmldeveloper.com : ColdFusion/Railo developer hosting
www.cfsearch.com : ColdFusion search engine
www.cflive.net : Live CFML console/testing tool


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360467

hofar...@houseoffusion.com

unread,
Apr 17, 2015, 1:38:12 PM4/17/15
to ColdFusion Technical Talk

We needed to do something similar and we actually wrote the content to a file and included that.
It worked perfectly.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:360468
Reply all
Reply to author
Forward
0 new messages