1 / 15

Page Layout and Navigation in ColdFusion

Learn how to utilize URL variables in ColdFusion to create dynamic site layout and navigation. Explore concepts like CFINCLUDE, CFSWITCH, CFIF, and CFTRY for error handling. Utilize URL variables like "VIEW" and "PAGE" to customize content areas. Understand the importance of application.cfm files for dynamic page building. Attend MDCFUG meetings for more insights. Contact Jon Brundage for ColdFusion development and Section 508 accessibility consulting.

jdameron
Download Presentation

Page Layout and Navigation in ColdFusion

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Page Layout and Navigation in ColdFusion Jon Brundage CF Developer / Accessibility and Section 508 Consultant jonwind@windcompany MDCFUG April 2003

  2. CF is power in your hands • This discussion shows how to use URL variables to create sophisticated layout and navigation. • You are only limited by your imagination.

  3. CFINCLUDE CFSWITCH CFIF CFTRY (for error handling) Tags we will be using

  4. Basic Concepts Adding URL variables to links exposes the variables for use by site pages. We will create and use URL variables “VIEW” and “PAGE” example: <A href=“index.cfm?view=home”>

  5. Some special files • config.cfm • nav files

  6. Pages are created by components • header • left navigation (CFINCLUDE template=“leftNav.cfm”) • content area depends on URL variable (CFINCLUDE template=“#view#.cfm”) • footer

  7. how it works • variables are set to default values when site is entered • as links are selected URL variables are passed for use by config.cfm, leftNav.cfm and index.cfm • pages are built based on the exposed URL variable

  8. Page layout index.cfm HEADER leftNav (<cfinclude template= “leftNav.cfm”>) content area (<cfinclude template=“#view#.cfm”>) FOOTER

  9. config.cfm • included at top of index.cfm • sets variables such as #title#, #describe#, #breadcrumb# • uses <CFSWITCH> to set variable values depending on URL

  10. leftNav.cfm • creates a navigation system • all links have URL variables added to HREF <a href=“index.cfm?view=home”> • leftNav uses <CFIF> to control appearance

  11. other uses • add additional URL variables for subfolder content “page=travel” • use URL variable in queries

  12. error handling • use CFTRY to prevent URL “hacking” or misspelling of URL • <cftry> • <cfinclude template=“#view#.cfm”> • <cfcatch type="MissingInclude"> • <cfset view="home"> • <cfinclude template="#view#.cfm"> • </cfcatch> • </cftry>

  13. caution using application.cfm files A reminder- using this system results in the building of index.cfm in a dynamic fashion. Your pages are processed from the root folder where index.cfm resides. Even if content is drawn from sub-folders only the application.cfm file in the root folder is processed. Any application.cfm in sub-folders ignored.

  14. thanks! • Have fun and be creative! • MDCFUG a great asset-attend these meetings, get on the mailing list, visit their site (http://www.teratech.com/) and sign up for classes.

  15. Jon Brundage • Section 508 / web accessibility consulting • ColdFusion development • jonwind@windcompany.com • 703-967-1024

More Related