New rendering support in V6

I've just checked into the V6 SVN repo the new render support for BlogCFC. This is a major new way to do plugins for BlogCFC. I've long had a way to dynamically add support for <foo> type tags. This was done via CFCs, yet no one actually ever used this feature. I didn't really document it so that's my fault.

In V6, you can now add support for tags via custom tags. Let me give you an example. In the render/content folder you will find a custom tag named code.cfm. The mere existence of this tag will make BlogCFC entries (and pages) recognize <code> in your data. You can pass any arbitrary argument in the code tag, <code style="sql">, and they will be passed as arguments to the tag. Also, if you do:


<fcode>
foo
</fcode>

(FYI, "fcode" is there because I just realized I probably can't use the code block in BlogCFC to demo a code block. ;)

Anything inside the tag will be passed to the custom tag as the content argument. So here is the code support as it stands now:


<cfparam name="attributes.format" default="coldfusion">
<cfparam name="attributes.content" default="">

<cfif not len(attributes.content)>
    <cfexit>
</cfif>

<cfif attributes.format is "plain">
    <cfoutput>
<pre>
#htmlEditFormat(attributes.content)#
</pre>
    </cfoutput>
<cfelse>
    <cfoutput>
<pre>
<span style="font-weight: bold; color: ##ee0000">
#htmlEditFormat(attributes.content)#
</span>
</pre>
    </cfoutput>
</cfif>

Where it gets cool is - in the next update, I'll add support for:


<cf_runonce>
<script src="something.js">
</cf_runonce>

This will make it so you can include JS files and even if 2 instances of the tag are run, the JS files are included only once.

Anyway, the point of all of this is to make doing plugins/add-ins for BlogCFC significantly easier.

Comments welcome.

Comments
BlogCFC was created by Raymond Camden. This blog is running version 5.9.2. Contact Blog Owner