Printer Friendly Version
Email this thread to a friend
|
Featured Web Site Template |
|
Reflects user activity within the last 5 minutes
|
|
| Member |
Message |
rowdyraccoon
Joined: Mar 20, 2005
# Posts: 6
|
Posted: 2005-Mar-20 08:56
Hi all,
Thanks for all the great info here. This is my first question so I hope I sound halfway intelligent. I'm redesigning a site I built for a friend and we have decided we want to use iframes. I know...I've seen all the drawbacks on how much work maintaining iframes is along with the other hoopla etc. but it's a low maintainence site and besides I'm a glutton for punishment so what the heck. And it looks really nice now. From what I've seen there are some strong believers that the spiders won't all go away if you do it right so that's the goal.
I am looking for some code and I'm confused in the fact that everywhere I look, someone has posted something totally different than another fix I saw the day before. What I need is a foolproof script that will redirect someone who comes in from a search result on, say, page 4, and it proceeds to load the iframe so they won't be stuck on an orphan page. From what I've seen that would entail a script in each header along with an external file that the bots can find so they don't get scared off. (That last part is just as important and I've only seen one method that hinted at that procedure. I won't risk it without including that.) However, the directions I've seen for such methods are terrible and don't say whether the external file is a single file or a single file for every page. I've tried different things with no results. Can someone please give me the *exact* first-grade-level procedure including what to name the external file(s?) along with the *exact* url and name layouts I'll have to change in each header? If someone just has a url you want to tag on to this that's great but I may have seen it already.
I will patiently wait and bite my nails.
Thanks for your time
|
 |
lizardz
Joined: Nov 12, 2004
# Posts: 1394
|
Posted: 2005-Mar-20 10:05
All the directions to do that I ever found on the web totally sucked, and didn't do what you want. It can be done, but it's a real pain, but if you're a glutton for punishment, go for it. Hint: if you just get rid of the iframes you'll save yourself a lot of time, but it can be done. Requires cookies, lots of javascript, lots of fun, too hard to explain the method, sorry.
|
 |
birchj
Joined: Jan 03, 2005
# Posts: 16
|
Posted: 2005-Mar-20 21:36
Here is an example of the type of code that I think you are asking for.
You place the page file name of the frame content you require in the link to the page. When search engines index the page they will include the page name of the frame in the indexed information and people coming from searches will get the full page.
How ever the search engine will not follow the frame to index the content of the frame so make sure the meta tags of the main page contain decent information for the search engine.
The main code required is:
<IFRAME ID='Example' NAME='Example'></IFRAME>
<SCRIPT LANGUAGE='JavaScript'>
<!--
document.getElementById("Example" ).src = location.search.slice(1);
-->
</SCRIPT>
When you refer to pages in links use the form:
<A HREF='page1.html?frame2.html'>Link Example</A>
Operational example can be found here do a view source to see the page and frame content:
[link]
|
 |
birchj
Joined: Jan 03, 2005
# Posts: 16
|
Posted: 2005-Mar-20 21:45
The way to index the framed documents is to link to them directly from a page. And use the following code in the framed document so when a search engine directs a user at the page, the page will reload itself into the main page:
<SCRIPT LANGUAGE='JavaScript'>
<!--
if (top == window)
location.href = 'page1.html?frame1.html'
-->
</SCRIPT>
An example would be:
[link]
|
 |
rowdyraccoon
Joined: Mar 20, 2005
# Posts: 6
|
Posted: 2005-Mar-20 22:53
Hi Birch,
Thanks for the info. I'm sorry to admit that you had me and then you lost me. I see first off that while our nav links were set up as <a href="planning.htm" target="main">Planning</font></a> the one in your example is set up to call up one of 4 frames for each url, and that's where I'm lost because we only use one frame. What is frame 1,2,3,4? Am I to follow that code regardless and leave the attributes that read "frame1, frame2" unchanged and just change the individual page names? I don't mean to be stupid about this but that part has me stuck.
Our homepage is index.html, the main page that loads inside the homepage frame is main.html and then other names such as planning, etc for the others. If I'm missing something in the multiple frames issue could you give me an example?
As far as metatags for the index.html, would the tags I would use on a "normal page" work? You're not suggesting I spam the tags, correct? Are you also suggesting none of my pages will be crawled?
I did look at the actual code on the example pages but I can't get to the code that's driving each individual page. That being the case, I am to drop that 3rd script you gave for the actual framed documents into the header of each page and not the body right?
If you can enlighten me what the reference to frame 1,2 etc is, I think I may have a grasp on this. Thanks for your time and most of all your patience.
|
 |
rowdyraccoon
Joined: Mar 20, 2005
# Posts: 6
|
Posted: 2005-Mar-20 22:56
Don't let the </font> throw you. I took the font face out just now to simplify things and neglected to take the other part out.
|
 |
birchj
Joined: Jan 03, 2005
# Posts: 16
|
Posted: 2005-Mar-21 00:15
rowdyraccoon,
This may be more oriantated to your current situation:
[link]
In this example I have used the page names that you have. The key code in the main page is:
<IFRAME ID='Example' NAME='Example' SRC='planning.html'></IFRAME>
<SCRIPT LANGUAGE='JavaScript'>
<!--
if (location.search != "" )
document.getElementById("Example" ).src = location.search.slice(1);
-->
</SCRIPT>
The src of the iframe is the default home page.
In the pages you have inside the frame you need the links to refer to the main page so search engine that index the pages also refer to the main page. Do this with link code like:
<A TARGET='_top' HREF='main.html?anotherpage.html'>Another Page</A>
They have to target the top frame and tell the top frame which page they are a link to.
You also need this code in the pages which tells them they must always load in the main frame:
<SCRIPT LANGUAGE='JavaScript'>
<!--
if (top == window)
location.href = 'main.html?planning.html'
-->
</SCRIPT>
|
 |
birchj
Joined: Jan 03, 2005
# Posts: 16
|
Posted: 2005-Mar-21 00:23
From a search engine crawling point of view. The crawlers wont follow links in java script so you need a page with links to all of the individual pages. This page needs to be linked to from your main page. You could implement it as a menu system on your main page.
e.g.
<A TARGET='_top' HREF='main.html?anotherpage.html'>Another Page</A>
<A TARGET='_top' HREF='main.html?planning.html'>Planning</A>
This is not neat, but I can't think of another way of telling the crawlers about your framed pages.
|
 |
rowdyraccoon
Joined: Mar 20, 2005
# Posts: 6
|
Posted: 2005-Mar-21 02:06
thanks for all your help! sorry to be so difficult
|
 |
You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
- You have not yet logged in, or registered properly as a member
- You are a member, but no longer have posting rights.
- This is a private forum, for which you do not have permissions.
If you are a recent member, it's possible that you simply have not yet confirmed your account. Please
check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions
contained within.
If you cannot find this message, click here to Re-Send it.
|
If you are still experiencing problem, please read the
Login Assistance
Article for some advice on what may be causing your login not to work properly.
|
Switch to Advanced Editor and ...
Create a New Topic
or Reply to this Thread
|
|