Link to home
Start Free TrialLog in
Avatar of NRackham
NRackham

asked on

Displaying "Main" page in Browser Title Bar

How do I display the name of the "Main" page in the browser title bar when using frames (created using FP98)??

Thanks
Avatar of TTom
TTom

You can't.  The title which is displayed will currently be the title of the frameset page.

(There is a possibility that this property can be scripted in IE, but it is SUPPOSED to be read only.  If that is true, you might try inserting some JavaScript in your Main page which changes the title of the frameset doc, e.g. <body onload="parent.title = self.title">.  Don't know if it will work.)

Tom
Avatar of NRackham

ASKER

Tom

Tried the above but to no avail, I thought about the using the title tag of the frameset being = to the title of the main page but I'm having trouble with the syntax. Any thoughts?




Don't think much of the possibilities for success.  As I mentioned, the 'title' property is (currently) supposed to be read only.  Any solution at all which changes it will have massive browser compatibility problems.

As long as the main page will be changeable, you will not be able to match the window title to anything other than the title of the frameset.

Sorry,

Tom
I am not totaly sure what you are asking.  If you want the title to change with the main page is changed in the frame then I dont't think it is possible.  If you want the initial frameset page to display a title of coarse it is the title tag.  You can name all the changing pages but the title will not change with ther page change.
When in FrontPage, click on Frames Page HTML at the bottom.  In the HTML, change the title:

<title>what it says now</title>
 
to <title>what you want it to say</title>

This will not affect anything else navigation.

Unless you wanted to display the name of each page that is loaded, that is the only thing you can do.  There is a good site with free javascripts you can use that can do great things like scroll your page names in the status bar.  The URL is  http://www.draac.com.  They have alot of other great things as well
Thanks Tom maybe I can't have what I want, oh well!!
-----------------
mbodamer, What I want is for the frameset title to display the title of the current "main" page, so that when ever the main page changes the title bar changes to reflect the title of the new page. Simple request but possibly not as easy as I first thought. If you can help I'd appreciate it but having discussed this with TTom, maybe it's not possible.
----------------
messentary

Not a bad suggestion re page title in the scrollbar area. maybe a solution but not exactly what I was looking for.

Nick


Regards Nick
Well, think I went thru this before...
IE let's you write to the document.title... so...

for each page that you want to update the window title, add the following javascript into the header:

<script language="javascript"><!--
function doOnload()
{
 top.document.title = document.title;
}
// --> </script>

and for the <body> of each document.... add this...

onload="doOnload()"

That'll work for IE4 upwards, so you can have half your cake.

hth

Brian
Brian,

Thanks for the above. I'm now off for a week so I'll try it when I get back.

Thanks

Nick
Change the title of the frameset page to match that of the main frame.
If your server supports CGI,you may be able to reload the entire page with a new frameset, passing the sources of the non-changing frames in your script.  This is messy in that it requires a reload of your frameset each time the main page changes, but it would solve your problem I think.
Brigmar,

Excellent, just what I wanted, Many thanks. Please post as an answer.

Nick
ASKER CERTIFIED SOLUTION
Avatar of brigmar
brigmar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't know if this can be added to the question or if I'll have to post as a seperate question but can I have the page name displayed in the address bar as well? At the moment it seems that what ever page I'm in the address is always Http://sitename/default.htm

I'd like to display the page name of the "main" page in the address bar ie http://sitename/news.htm or pressreleases.htm etc

Any thoughts

Nick
Thanks Brian,

Please see my comment posted just after your answer. Is it possible?

Nick
as long as the pages are all on the same domain...

change the line in the javascript to read :

top.document.title = top.document.location + ' - ' + document.title;

suck it and see...

Brian
Hi Brian

Thanks for the extra code for the title bar. What I really wanted was to change the address bar as well, not have the url of the page in the title bar. Does that make sense?

Nick
Nick,

The address bar is the location of the top level document of the window. This would be the frameset document.
 The only way to change it is indirectly, by navigating to another URL, which would break your frameset.

Brian
Brian,

Thanks,

Nick