Log in

View Full Version : Frames and FavIcon



bernie
04-19-2007, 09:32 AM
First of all, thanks for a great website.

As I do my own web maintenance when not working, I tried the favicon on one of my pages. I have a lead-in page directing to two sub-domains via two logos. The favicon came up relatively quick in IE7 after a couple of F5's (refresh).

On one of the sub domains, I am still using frames with the revised slashdot menu on the left and in the main page a modified version of the thick tabs menu.

I have two questions. (actually only one now, figured out the 2nd one)

1.
When using frames, the title bar refers to index.htm as the page even after selecting a different page from within the main page. Each of these pages have their own titles but are never displayed in a tab or title bar.

Is there at least a way to update the tab viz. "URL Name" - "Current Page" by using the info in <title>Whatever</title>?

1.1
With the address bar referring to url/index.htm when refreshing with the mouse focus in either frame, the current page is refreshed and also if the refresh button is used. However, when the focus goes back to the address bar and pressing enter, the default page is loaded. I know this is a result of the way frames work. As a creature of habit, I try to keep the content of my pages limited to a maximum of one rotation of the scroll wheel (2 screen heights) so I am reluctant to rewrite without frames.

Any suggestions will be appreciated.

Lead-in page http://www.lbk.co.za
Frames page http://www.lbk.co.za/Const

2.
On the same page, I included the favicon in the left frame but no appearance of the favicon.

NOTE I just realised, that with frames there is a main page main.htm and I tried including

<link rel="bookmark" href="http://url/favicon.ico">
<link rel="shortcut icon" href="http://url/favicon.ico">
in this page and the favicon appeared immediately after deleting the cache.

So question 2. is answered, just thought I'd leave it in the post for similar problems others may be having in this regard:cool:

Bernie

jscheuer1
04-19-2007, 08:15 PM
I don't even understand the point of question 1.1. I see you've answered question 2 yourself. There is no way, using just HTML to answer question 1. And, if your frameset has more than one frame in it that changes, you would have to choose which frame's title would be promoted. But, javascript may be able to help out. On the pages that you want to behave this way, you could have a script below the title (untested):


<title>LBK Construction (Contact Details)</title>
<script type="text/javascript">
parent.document.title=document.title;
</script>

Or something like that.

techno_race
04-20-2007, 01:01 AM
I'm pretty sure that you can't make the frame address and title to show up in the parent window; that's basically the whole point of frames. If you need the link inside the frame to open in the parent window, use _parent as the a target.

jscheuer1
04-20-2007, 04:34 AM
I'm pretty sure that you can't make the frame address and title to show up in the parent window

The address, no - not without some server-side gymnastics and maybe not even then. However, I just tried out my little script-let and it works just fine for the title. I imagine there may be problems if the frameset page were on a different domain than the en-framed page but, this doesn't seem to be at issue here.

Notes: The title also changes the text shown in the tab, if tabs are enabled. Of course, with javascript disabled this will not work but, that would be relatively few people and, the title of the frameset would simply remain. If that title is appropriate to the other (en-framed) content as is the case with this situation, it would still be OK in javascript disabled browsers, just not optimal.

bernie
04-20-2007, 05:51 AM
Thanks John

The scriptlet works fine and is exactly what I needed.

As for


However, when the focus goes back to the address bar and pressing enter, the default page is loaded.

I can live with this as it is unlikely a user would set the focus to the address bar and merely press enter.

Just a note to others, the title in the tabs is cache dependant, so clear the cache or refresh a couple of times to see the results.

A qustion on Favicon.

It does not work on a local machine. Is this as a result of some www service etc. needing to be enabled on the local machine? Just curious, would be nice to test locally before uploading.

Bernie

jscheuer1
04-20-2007, 06:12 AM
A qustion on Favicon.

It does not work on a local machine. Is this as a result of some www service etc. needing to be enabled on the local machine? Just curious, would be nice to test locally before uploading.

That's pretty much the issue. If you had an intranet, you could test it out there. Also, you could try the absolute local path to the favicon in a:


<link rel="shortcut icon" href="http://url/favicon.ico">

tag, then some browsers may show it, example of an absolute local path:


<link rel="shortcut icon" href="file://localhost/C:/webstuff/test/favicon.ico">