The store includes a variety of custom tags that are used throughout the code and that you can use as well in custom coding. You’ll find these tags in the customtags directory of the store. A number of these tags have been developed by other ColdFusion developers that have shared their work with the rest of the CF community and for that, we thank them.
SESConverter – A standard custom tag used with Fusebox sites, this is used to convert the sitemap links to a format the store can understand. It is called in the main index.cfm page of the site, you shouldn’t need to do anything else with it. If you have problems on your site with SES links, you may need to make sure your server is properly configured to handle them. First, make sure that IIS is set to not check the validity of URLs. Otherwise it will throw a server error for SES links since they do not actually exist on the server. Also note that the SESConverter file relies on various CGI variables as well as expecting your SSL to be on port 443. In some cases, this may return invalid results on some servers. You may need to dump your CGI variables and check what port your SLL (https) runs on and customize the file to make sure it’s returning a valid base href for both locations on your server.
AvarTree – This custom tag can be used to output scoped variables from your store (application,session, request, URL, etc.) The default layouts include this tag for administrators only by adding a ‘Debug=Yes’ to the store URL. You can click “help” on the output of the tag to view additional parameters you can set for the tag (such as restricting it to specific IP addresses). By default, the tag is output using the put_debug.cfm page.
PutTitle – A simple custom tag for outputting titles on store pages
PutText – Custom tag used for outputting text in the store. Particularly useful when outputting teaser and detail text for store pages when they include links to other store pages, as it will append the Session information to any .cfm links for users with cookies turned off. You can pass additional parameters to this tag, such as the class to use for the text and whether to add a line break at the end.
PutImage – Custom tag used when outputting images in the store. There are a variety of attributes you can pass to this tag for things such as the image alignment, link on the image, alt tag, etc. You can make modifications to this tag to change how images are output throughout your site.
Format_Box – Used to wrap content on a page in a formatted box with a title header. Use the attributes for the tag to set things such as the colors for the box, the title text, width of the box, border size, etc. The tag is called using a cfmodule wrapped around the text to be inside the box. Example:
Format_Input_Form – This custom tag works basically the same as the format_box but is used for forms. It has some additional parameters you can pass that are specifically for forms.
Format_Output_Box – Another box custom tag, very similar to the format_box but uses different color defaults.
PageThru – Used for pages that show a maximum number of records per page. There are a variety of parameters you pass to this tag to configure how it will work, and a number of variables returned by the tag. For instance, you pass the number of records in the query, the page you are currently on, the maximum records per page, text or images to use for the navigation, etc. The tag will return the start and end rows for the page as well as the output for the navigation which you can use anywhere on the page you would like. You can see the comments on the tag for detailed information on its usage, but here’s an example:
NextItems – This tag is used when displaying items to show links for the next and previous items in the list. It is currently used in the store when displaying orders and for products. There are two modes you can use with this tag. One is to set the list (stored in a session variable) and the other is to display the links. An example of calling the tag to display links would be:
ID = "#attributes.product_ID#"
StringSearch – This is a useful tag for database searches. You pass any number of words and whether to include all the words or any of them in the search, and the name of the column to search and it returns the SQL commands needed for the search. It is used for the full store SQL search and the product and feature searches. An example of this tag in use is as follows:
The SQL returned would then be used in your query like this:
<cfquery name="qry_search" datasource="#Request.DS#">
SELECT * FROM MyTable
WHERE 1 = 1
SetImages – This tag uses the current color palette for a page to set the store images: the think and thick lines, sale, new and hot images, etc. Simply call it after running queries/qry_getcolors.cfm to set the images.
CFFormProtect – This is a ColdFusion component that has been added to the contact form templates in CFWebstore® to help prevent spam. The main CFC (modified for use with the software) can be found in the cfcs/tags directory. The rest of the files that run and configure the spam checking are found in the includes/cffp directory. If you wish to modify the settings, these are found in the cffp.ini.cfm file. Among other things, you can set which text strings to consider spam and configure use of the Akismet service for checking for spam. You can also configure the tag to email you a copy of any trapped emails.
Feature List - You can use a custom tag to output lists of features on your site; for instance, you could display the latest headlines for your site on the homepage.
· category_id – selects features from a specific category
· new – selects features marked as new
· featureCols – sets the number of columns to display
· searchform, searchfooter – turns off these sections used for feature searches
Product List – Likewise, you can also include a custom tag in a template or layout for outputting a product list, such as this:
· undercategory_id – selects products from a specific category
· onsale – selects products marked as on sale
· new – selects products marked as new
· hot – selects products marked as hot
· notsold – selects products marked as not sold
· type – the product type to list
· productCols – sets the number of columns to display
· searchheader, searchform, searchfooter – turns on/off these sections used for product searches