User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 391,993 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,276 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser:
Views: 880 | Replies: 3 | Solved
Reply
Join Date: Mar 2008
Posts: 3
Reputation: jstama is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jstama jstama is offline Offline
Newbie Poster

title tag

  #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!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2008
Posts: 70
Reputation: cmhampton is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 10
cmhampton's Avatar
cmhampton cmhampton is offline Offline
Junior Poster in Training

Re: title tag

  #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>
  16.  

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

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

Re: title tag

  #3  
Jun 28th, 2008
cmhampton,

thanks for your help. This code worked perfectly.

Thanks again.
Reply With Quote  
Join Date: Feb 2008
Posts: 70
Reputation: cmhampton is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 10
cmhampton's Avatar
cmhampton cmhampton is offline Offline
Junior Poster in Training

Re: title tag

  #4  
Jun 29th, 2008
I'm glad I could help. Please mark the thread solved.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb ColdFusion Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the ColdFusion Forum

All times are GMT -4. The time now is 9:47 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC