Here’s an example of a typical category page and the files used to display it. This is just a basic walkthrough of one of the main types of pages and how all the different files are pulled in to play their part of the puzzle. If you are new to Fusebox, this should help you learn how to step through the file structure to find specific code used by a page.
The fuseaction called is category.display. First, we run the fbx_Settings files for the home directory and the category circuit. This will generate all the store-wide settings that we need.
Next, we check the fbx_Switch.cfm file in the category directory, and find the section for “display”.
The first page called is qry_get_cat.cfm. This retrieves all the information on the selected category. This will be a cfif tag doing a CompareNoCase against “display”. In this case, it will be the first one in the page.
After making sure that we have a valid category, we retrieve the list of subcategories for this category with qry_get_subcats.cfm. If the category was not found, errors/dsp_notfound.cfm will be displayed.
Next we check to see if a custom palette was selected for this category. If a custom palette was chosen, we use queries/qry_getcolors.cfm to retrieve the information on this palette, and customtags/setimages.cfm to reset the main store images on this page.
Next we check for any parameters passed to this category page. These may be used by the template file for the category, for instance to set the type of product listing to use. The includes/parseparams.cfm is a standard page used to parse out any parameters that are passed.
Using the access.secure custom tag (calls access/secure.cfm), we check that the user has permissions to view this category page. The contentkey_list says to check the user’s list of access keys, and compare against the access key set for the category.
If the user has permission, we continue by displaying the category header using dsp_catheader.cfm. This page creates the meta tag headers and outputs the title and description for the category. This page calls the following:
customtags/putimage.cfm is used to output the large image and title for the category, if any
customtags/puttitle.cfm is used to output the category title
customtags/puttext.cfm is used to output the main category description
qry_get_catcore.cfm retrieves the information for the page template this category uses
access/secure.cfm is used to determine whether to output admin links for the category and what types of links to show.
Unless turned off with a page parameter, a line will be displayed after the header using customtags/putline.cfm.
The next page called is the selected page template (catcore) for this category. Let’s take a look at the basic products template page. This template uses the products/catcore_products.cfm page.
The first page called by the template is queries/qry_get_products.cfm. This page will run the query that retrieves the products in the category, along with all the options, addons and custom fields associated with them. It calls the safesearch custom tag when running searches, qry_stock_amounts.cfm to get stock amounts if using cached product queries, qry_get_opt_choices.cfm to get all the option choices, and calls the nextitems.cfm page to set the list of products, used for the ‘next/previous’ browsing.
A cfmodule call to customtags/pagethru.cfm is used to limit the number of products output on the page, and determining which products from the recordset to output for this specific page. It creates the navigation links to move from page to page as well.
The parameters passed to the page are used to determine the options for the search header and search form at the top of the page. Any search form results are output using put_search_header.cfm, and put_search_header.cfm show the basic search form. An alphabetic browsing header can be shown by put_search_header_alpha.cfm. The search form uses query/qry_getpicklists.cfm to retrieve the list of product availabilities, which are then output using customtags/form/dropdown.cfm.
Depending on the settings for the category page, the subcategories or products can be output first. Let’s go with subcategories. These will be output by category/dsp_subcats.cfm.
Dsp_subcats.cfm loops through each subcategory to output its listing. customtags/putimage.cfm is used to display the small image and/or small title for the category. customtags/puttext.cfm outputs the teaser text. customtags/putline.cfm is used for putting the lines between each subcategory. And a call to access/secure.cfm is used to determine whether to output the admin link to edit the category.
Back to catcore_products.cfm, now we output the products. This is done with dsp_products.cfm. We loop over the list of products to output the listing for each one. This page accepts a parameter passed by the category page that specifies the type of product listing to use. Let’s look at the standard product listing, which is the most extensive. This is called by listings/put_standard.cfm.
do_prodlinks.cfm is called first to create the product links, based on the search-engine safe settings for the site.
queries/qry_get_prod_info.cfm is then called to get the information specific to this product, using query-of-query functions.
customtags/putimage.cfm is used to output the teaser image and title for the product. customtags/puttext.cfm outputs the teaser text.
access/secure.cfm is again used to determine whether to output admin edit links.
Unless the product is not sold, put_orderbox.cfm is called to create the orderbox. The orderbox is used to output the form to order the product, as well as options, addons and pricing information.
From put_orderbox.cfm we call the discounts and promotions components (in cfcs/shopping) to determine any discount and/or promotion messages to output for the product.
put_price.cfm is used to output pricing information. This sets prices according to retail, wholesale, and group prices, and shows the price with VAT tax (if any set) and currency exchange price.
The product.qty_discount fuseaction is called to output a table of any quantity discounts for the product.
If the product does not have any options or addons and the orderbox is not turned on, customtags/putimage.cfm is used to output the order button image.
If product reviews are turned on and available for this product, the product.reviews fuseaction will display the review summary and links.
put_options.cfm is used to create the product option selectboxes and put_addons.cfm is used to create the product addons.
A final call on dsp_products.cfm to customtags/putline.cfm to output a line between product listings and we’re done!