954,585 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Page title

We have a cold fusion website that uses an include file for the header. In that header file the page title field is set. This header file is included in every page of the website. So, every page has the same title.

Without doing something real fancy, how can I have a different page title for each page but keep a common header include.

I would prefer not to use a db table to house them and have a dynamic title field. Is there a way to "re-set" the page title after the header file?

Thanks for the help.

Best Regards,
Rodney

HostChart
Light Poster
25 posts since Oct 2005
Reputation Points: 10
Solved Threads: 0
 

Here is a simple cfswitch that uses a default title but easily handles custom titles for pages where you want a different title. The second snippet seems more organized. Your call how you would like to do this. The key is to pull the name of the file form the cgi variable script_name. You may want the whole variable including the path but this example uses just the page name.
[HTML]#strTitle#


[/HTML]

Here is a slightly different vesion that uses a structure (associative array) to hold the data.


[HTML]#strTitle#


[/HTML]

e3computer
Newbie Poster
9 posts since Nov 2005
Reputation Points: 11
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You