Feature Suggestion: cf-tags

I hate engaging cfoutputs for one line of code or an attribute (when working with tags), but I also know that the the CF UI tags are, aside from being terrible, too much code-bloat just to skip a cfoutput.

So, the engine allows cf_, which initiates a search for a relevant custom tag. What if the engine also allowed for <cf-, whose sole purpose was the parse the attributes/body of the tag.

<cfset request.mode = "dark">
<cf-div style="#request.mode#" background="wp.png">
  <cf-img src="#request.mode#.png" /><br>
  The mode is #request.mode#.
  <cf-watermelon>
</cf-div>

I fully know that div has no background attribute and watermelon probably isn’t an HTML5-tag, but that’s the point. It would parse to

<div style="dark"  background="wp.png">
  <img src="dark.png" /><br>
  The mode is dark.
  <watermelon>
</div>

You can do that with cfimport

Here is a snippet of code that I use for my views.

<cfimport prefix="c" taglib="/app/tags" />

<c:buttons>
	<c:add name="add_a_person" url="add.cfm" />
</c:buttons>

<c:filters>
	<c:search value="#args.search#" />
</c:filters>

<c:section label="People">
	<c:table>
		<c:header>

All those will call separate cfm pages that might have special logic, or call extra cfc functions

1 Like