HS+ Snippets and CFMODULE Workaround

I use cfmodule almost exclusively for my custom tag calls. The problem with that is that HS+ won’t let you write a VTM for custom tags used w/ cfmodule. Phil Costa at Macromedia reminded me that HS+ 5.5 supports snippets that can prompt you for values. This is useful for me as I need help remembering the syntax for my custom tags. Once I actually have the code on the page I’m normally not too concerned with help when editing. So, by using a snippet and having it prompt for the values I use I can get the functionality I want. Here is an example that calls one of the core tags in Element, our CMS:

<cfmodule template="/$$Mapping/customtags/coapi/object.cfm"
    bUseCache="$${bUseCache:#request.element.cache.bUseCache#,Yes,No}"
    cacheTimeout="$${cacheTimeout:#request.element.cache.elementTimeout#}"
    bActiveOnly="$${bActiveOnly:Yes,No}"
    datasource="#request.element.objectstore.dsn#"
    type="$$type"
    method="$$method"
    returnVar="$$returnVar"
/>

Each use of {FOO:list} will give me a drop down. (Actually this is better than a simple drop down - you can use one of the defined values or type your own.)

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Comments