?
Solved

Dynamic Page Title

Posted on 2000-01-16
4
Medium Priority
?
177 Views
Last Modified: 2013-12-24
Is there a way to use what is located between the title tags of a cfm page as a variable and output it in other areas of the page? I'm using a cfinclude header page on all of the pages in my site. I want the page title to be read and outputted dynamically into my common header. How do you read what is between the title tags and output it?
0
Comment
Question by:Dennis_Halsey
  • 2
4 Comments
 
LVL 1

Expert Comment

by:deepchanda
ID: 2358109
U can use the javascript property "title" of document object to return the value between the <title> tags. It would look like this, document.title. All this would be client-side javascript code, so after the web page has been loaded in the browser, this value can be available in all the javascript code u use to access this property

DC
0
 
LVL 5

Accepted Solution

by:
nathans earned 200 total points
ID: 2358178
<cfset CHeader ="This is my Title">

<cfinclude template="header.cfm">






Inside the Header.cfm file
<cfoutput>
<title>#cheader#</title>
<body>
Main Page - #cheader#


Does this help?

0
 

Author Comment

by:Dennis_Halsey
ID: 2358187
Is there a way to use what is located between the title tags of a cfm page as a variable and output it in other areas of the page? I'm using a cfinclude header page on all of the pages in my site. I want the page title to be read and outputted dynamically into my common header. How do you read what is between the title tags and output it?

Since I'm a Web designer and programmer, I'm seeking ways to save time using dynamic headers. I really need to read what is already between a page's title tags without using a cfset to get it. Isn't there some kind of a variable like url.pagetitle or something that can read the title tag? I've included my two templates below so you can see what I'm doing. Thanks for your help
0
 
LVL 5

Expert Comment

by:nathans
ID: 2360218
Sorry as far as I know there is no way variable to do that however what I might would do different is.


Create the Header as a Custom Tag

in the File use the below link


<cfmodule template ="/includes/header.cfm" title="Main Page">


Then inside the file header.cfm in the includes directory does not need to be this way just the way I seperate my include files from my regular files.

<cfoutput>
<title>#attributes.title#</title>
</cfoutput>

My email is nathan@nsnd.com
My website is www.nsnd.com


0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
The following information will get you familiar with your new DV server, including the (mt) Account Center, the Plesk Control Panel, our world-renowned support department and the rest of the (mt) tools that come with your new service.
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
Get the source code for a fully functional Access application shell with several popular security features that Access VBA application developers desire, but find difficult or impossible to figure out how to code. You get the source code for managi…

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question