title tag

Thread Solved

Join Date: Mar 2008
Posts: 3
Reputation: jstama is an unknown quantity at this point 
Solved Threads: 0
jstama jstama is offline Offline
Newbie Poster

title tag

 
0
  #1
Jun 20th, 2008
I use a page that pulls the content from a database, including the title of the document. How can I make that title to also be the browser title (content in the title tag)?

Thanks!
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 72
Reputation: cmhampton is an unknown quantity at this point 
Solved Threads: 10
cmhampton's Avatar
cmhampton cmhampton is offline Offline
Junior Poster in Training

Re: title tag

 
0
  #2
Jun 23rd, 2008
Here's one way:

Get your db information before you output the <head> tag on your page.

Inside the <title> tag, output the info from your query. For example:

  1. <cfquery datasource="dsn" name="pageData">
  2. SELECT
  3. *
  4. FROM
  5. pageContent
  6. WHERE
  7. pageID = #pageID#
  8. </cfquery>
  9.  
  10. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  11. <html xmlns="http://www.w3.org/1999/xhtml">
  12. <head>
  13. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  14. <title><cfoutput>#pageData.Title#</cfoutput></title>
  15. </head>

Obviously, replace the query with your own, but you get the general idea?

Let me know if you need more help.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 3
Reputation: jstama is an unknown quantity at this point 
Solved Threads: 0
jstama jstama is offline Offline
Newbie Poster

Re: title tag

 
0
  #3
Jun 28th, 2008
cmhampton,

thanks for your help. This code worked perfectly.

Thanks again.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 72
Reputation: cmhampton is an unknown quantity at this point 
Solved Threads: 10
cmhampton's Avatar
cmhampton cmhampton is offline Offline
Junior Poster in Training

Re: title tag

 
0
  #4
Jun 29th, 2008
I'm glad I could help. Please mark the thread solved.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ColdFusion Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC