Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Are there ways to easily change designs with application.cfm & onrequestend.cfm?

General

Are there ways to easily change designs with application.cfm & onrequestend.cfm?

by  webmigit  Posted    (Edited  )
I'm a designer and a developer.. As a developer I like application.cfm and onrequestend.cfm, for header and footers for my designs.. as a designer, it is a great pain to change the design.. I have to piece it together and then change it pull it apart..

I started a new site and had a revelation...

Create your design in whatever manner you like and save it as one file.. in the place where you want the content that varies from page to page.. use this <CFINCLUDE template="#cgi.script_name#"> (On my computer, that worked, but on the server, I had to say.. <CFINCLUDE template="#right(cgi.script_name,len(cgi.script_name) - 1)#">.. so you may have to do the same..

Anyway now when I want to change the design, I can open it in notepad or my favorite WYSIWYG and edit it without and complications...

[color red]Update: [/color] This is critical, if people discover the name of your layout page, they can set your server into an endless loop.. so if we're going to call the page sitelayout.cfm.. We'll want to do this:

Code:
<CFIF cgi.script_name is not "
Code:
sitelayout.cfm
Code:
">
 ....your include code...
</CFIF>

At the bottom of your page template.. remember to put <CFABORT>.. that also works at the bottom of application.cfm if you prefer.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top