
I have created a simple custom verb which allows you to link specified resource files from circuit.xml, without having to go to the bother of writing it all in a script and including it.
For example, you can do this:
<cf:link resource="/res/bubbles.css"/>
<cf:link resource="/res/bubbles.js"/>
And it will convert that and place the following inside your HTML head:
<link rel="stylesheet" type="text/css" href="/res/bubbles.css"/>
<script type="text/javascript" src="/res/bubbles.js"></script>
This should be useful if you have a lot of different circuits that all have unique styles and scripts, and you'd rather avoid putting lots of conditional statements in your layout pages.
If you haven't used lexicons before, they're actually really simple (once you have it explained to you - thanks to Nick Tong for helping me).
Here is how to setup and use them:
{webroot}/myapp/lexicon/ht/link.cfm<ht:link resource="/styles/default.css"/>And that's all there is to it!
Here is a simple example circuit:
<circuit access="public" xmlns:ht="ht/">
<fuseaction name="main">
<ht:link resource="/styles/default.css"/>
...
</fuseaction>
</circuit>
Download: link.cfm.zip (<1KB)
Nobody has commented on this article yet.