Paul
Paul

Reputation: 197

ColdFusion dynamic placeholders

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.)

Upvotes: 0

Views: 266

Answers (1)

Todd Sharp
Todd Sharp

Reputation: 3355

Because <cfloop> expects a query name, not a query object. Try this:

<%cfloop query = "qPages"%>

Upvotes: 1

Related Questions