I’m writing a page generator to generate ColdFusion templates. I use placeholders (or whatever they’re called) where the code shouldn’t run immediately.
The following works OK and dumps a valid query object:
<%cfdump var = "#qPages#"%>
But the following attempt to loop through the above query throws the error: “Complex object types cannot be converted to simple values.”
<%cfloop query = "#qPages#"%>
This also throws the same error:
<%cfloop query = "<%=qPages=%>"%>
What am I doing wrong?
(I’m running CF8.)
Because
<cfloop>expects a query name, not a query object. Try this: