We have a component of our site that has content management
features. Simply put, we have a bunch of pages in a database, that
are managed by a content editor in an admin back end.
The front end simply pulls the pages from the database as you
navigate the site.
What I am looking to do, is enable us to include pure
ColdFusion in the HTML (thru the editor, inside some tags such as
<%cf %>), and when the page is called on the front end, that
it somehow 'processes' or 'evaluates' this code.
An example might be as follows:
HTML In Database:
<strong>This is my executed code</strong>
When this text is pulled from the database, I would like to
get all the text inside the <%cf %> tags, store it in a var,
and somehow 'process it' and display it.
Does anyone know if this is possible? Was originally thinking
evaluate("CFContent"), but this only processes ## vars, it doesn't
not execute script (dies at the first < )
I've seen this done in Joomla with PHP, and would like to see
if I can do it in CF, as it would be very powerful (albeit
dangerous too. Serious validation before processing required).
Probably the easiest way would be to create an includes
directory and then process the form input and saving it as a cfm
file in that directory. Then use a dynamic cfinclude when you
retrieve the content.