Page Layout and Navigation in ColdFusion - PowerPoint PPT Presentation

About This Presentation
Title:

Page Layout and Navigation in ColdFusion

Description:

This discussion shows how to use URL variables to create sophisticated layout and navigation. ... the building of index.cfm in a dynamic fashion. ... – PowerPoint PPT presentation

Number of Views:63
Avg rating:3.0/5.0
Slides: 16
Provided by: JonBru3
Category:

less

Transcript and Presenter's Notes

Title: Page Layout and Navigation in ColdFusion


1
Page Layout and Navigation in ColdFusion
  • Jon Brundage
  • CF Developer / Accessibility and Section 508
    Consultant
  • jonwind_at_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
Tags we will be using
  • CFINCLUDE
  • CFSWITCH
  • CFIF
  • CFTRY (for error handling)

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
  • ltA hrefindex.cfm?viewhomegt

5
Some special files
  • config.cfm
  • nav files

6
Pages are created by components
  • header
  • left navigation (CFINCLUDE templateleftNav.cfm)
  • content area depends on URL variable (CFINCLUDE
    templateview.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 (ltcfinclude
template leftNav.cfmgt)
content area (ltcfinclude templateview.cfmgt)
FOOTER
9
config.cfm
  • included at top of index.cfm
  • sets variables such as title, describe,
  • breadcrumb
  • uses ltCFSWITCHgt to set variable values depending
    on URL

10
leftNav.cfm
  • creates a navigation system
  • all links have URL variables added to HREF
  • lta hrefindex.cfm?viewhomegt
  • leftNav uses ltCFIFgt to control appearance

11
other uses
  • add additional URL variables for subfolder
    content pagetravel
  • use URL variable in queries

12
error handling
  • use CFTRY to prevent URL hacking or
    misspelling of URL
  • ltcftrygt
  • ltcfinclude templateview.cfmgt
  • ltcfcatch type"MissingInclude"gt
  • ltcfset view"home"gt
  • ltcfinclude template"view.cfm"gt
  • lt/cfcatchgt
  • lt/cftrygt

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_at_windcompany.com
  • 703-967-1024
Write a Comment
User Comments (0)
About PowerShow.com