Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Frames or No Frames?

Frames or No Frames?
Thread Tools
surferboy
Mac Enthusiast
Join Date: Jul 2003
Status: Offline
Reply With Quote
Aug 18, 2005, 09:07 AM
 
I assume that a lot of purists out there would advise against the use of frames, but it seems to be the simplest way to accomodate my needs- and I'd like others' feedback and advice:

I am building an academic type site with a lot of content. Each content page is pretty much the same layout with a navigation bar at the top. The nav bar is the key to the site. I'd like the nav bar to appear on every page. Additionally, depending on which user is visiting the site, the nav bar may have different links. Also, I may update the nav bar on ocassion.

I am using dreamweaver- and I thought about making the nav bar present in a template html file (.dwt), so that each time I need update the nav bar- the updates go to each page automatically. And, I can make a template for each particular user group- so the links are different for different user groups. But, putting a nav bar in dreamweaver is somewhat limited from what I understand. So, it seems that using a frameset would easily accomplish my needs.

I have read about some drawbacks about framesets. I don't care a lot about bookmarking issues and googling issues- since this is a relatively private site primarily with "invited" users. With that in mind, can you give an opinion on the use of Framesets within the context of my needs- or offer me some advice on how else to accomplish the above mentioned goals? Much apprecation for input.
     
Synotic
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Aug 18, 2005, 09:14 AM
 
Can you run PHP or use SSIs?
     
travisimo
Junior Member
Join Date: Jun 2005
Location: Knoxville, TN
Status: Offline
Reply With Quote
Aug 18, 2005, 09:30 AM
 
no frames. definatly need a dynamic content creation system such as php, asp, cfm.. something, anything but frames. frames work for 4 or 5 page sites for joe blow.. not for academic sites.
     
registered_user
Dedicated MacNNer
Join Date: Nov 2001
Location: Are Eye
Status: Offline
Reply With Quote
Aug 18, 2005, 09:36 AM
 
Originally Posted by surferboy
I don't care a lot about bookmarking issues and googling issues- since this is a relatively private site primarily with "invited" users. With that in mind, can you give an opinion on the use of Framesets within the context of my needs.
If you don't care about the draw backs of frames, and your invited users don't care about the draw backs, then use them.

I wouldn't do it, but then, you can't see your frame sets from my house.
     
surferboy  (op)
Mac Enthusiast
Join Date: Jul 2003
Status: Offline
Reply With Quote
Aug 18, 2005, 11:01 AM
 
I certainly can run PHP. I have fantastico available to me- which can take the pain out of installing some scripts- but I am no programmer. Is there some relatively easy tutorial on how to use PHP to accomplish what I want to do?

Can you give me an example of a frameset website out there?
     
Mooga2
Forum Regular
Join Date: Jun 2003
Location: San Francisco
Status: Offline
Reply With Quote
Aug 18, 2005, 10:04 PM
 
I added frames to a client's website (http://www.foxracing.com) because it was a necessity for their designer's implementation, and it worked out well compatibility-wise. But if you're just doing a headerbar, you should definitely use PHP.

Simple suggestion: just create one page as you normally would.

Split up the html into three pages:
- header.php
- index.php (content area)
- footer.php

In the index.php file, just use a simple
<? include "header.php"; ?>
<html> content blah blah blah> </html>
<? include "footer.php"; ?>

In your other pages, such as "contact.php" do the following:
<? include "header.php"; ?>
<html> contact info blah blah blah> </html>
<? include "footer.php"; ?>

It's the most basic php without having to use headers, and if you ever change your header -- you only need to upload one file. You can add more logic about which user receives which headerbar from that point on.

Later on!
- Moo!
"He only has one look... it's like I've been taking crazy pills!"
...
     
surferboy  (op)
Mac Enthusiast
Join Date: Jul 2003
Status: Offline
Reply With Quote
Aug 19, 2005, 12:52 AM
 
After much reading, I completely agree with what you're saying- definately the way to go. But, here's my problem: I spent gobs of time learning how to make a drop down menu with behaviours, etc. with dreamweaver. The menu is an html file that relies on a separate javascript file. So, my problem is that if I convert the html navigation file into php, I lose the behaviours, and drop-downs.

Is there a way to include a js file with PHP? Or, given what I've described, how can I keep this "fancy" many, but use PHP and includes to use it?

I am about to pull my hair out! There have got to be sites out there that have pop up menus that are handled with PHP and includes?!
     
surferboy  (op)
Mac Enthusiast
Join Date: Jul 2003
Status: Offline
Reply With Quote
Aug 19, 2005, 02:20 AM
 
Is there any way to use a PHP include command on a menu that has javascript action? The navbar.php file I created appropriately gets included- and the rollover states are preserved, but any button that has a dropdown menu associated with it does not work- I assume because the javascript is not working.

Any thoughts on how to fix or work around this?
     
Synotic
Mac Elite
Join Date: Oct 2000
Status: Offline
Reply With Quote
Aug 19, 2005, 08:43 AM
 
Originally Posted by surferboy
Is there any way to use a PHP include command on a menu that has javascript action? The navbar.php file I created appropriately gets included- and the rollover states are preserved, but any button that has a dropdown menu associated with it does not work- I assume because the javascript is not working.

Any thoughts on how to fix or work around this?
Just take your original, working HTML files and change the extension to .php. They should still work fine. Only the stuff in the <?php ... ?> tags gets executed by the PHP engine.
     
Millennium
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Aug 19, 2005, 09:07 AM
 
Originally Posted by Synotic
Just take your original, working HTML files and change the extension to .php. They should still work fine. Only the stuff in the <?php ... ?> tags gets executed by the PHP engine.
They execute fine, but there's a performance hit involved, because the PHP engine has to parse every file before sending it on. Of course, this parsing is necessary if there's actually PHP code in the files, but if there isn't then the time spent parsing is wasted.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
surferboy  (op)
Mac Enthusiast
Join Date: Jul 2003
Status: Offline
Reply With Quote
Aug 19, 2005, 10:12 AM
 
I agree- it should work, but at least on my testing server (which happens to be my php enabled OSX mac), I can't get the javascript behavours to work. In a few minutes, I'll test them on my actual server and post them here for anyone to try!

Thanks.
     
surferboy  (op)
Mac Enthusiast
Join Date: Jul 2003
Status: Offline
Reply With Quote
Aug 19, 2005, 12:21 PM
 
You guys were right! This is a bittersweet moment for me: happy that I was wrong- menu all works fine. Sad that I pulled my hair out until 2AM last night fretting over this, trying to figure it out, and searching the internet for alternative menu schemes like flash!

Here is the menu included in the actual page, and here it is with a blank page with a simple PHP include statement.

Damn thing works! Wish I knew what I was doing wrong all those hours last night. In the end, though, I created fresh documents and started from scratch. I hope that when I go to apply this to the files I was already working on, there aren't some code fragments screwing things up!
     
registered_user
Dedicated MacNNer
Join Date: Nov 2001
Location: Are Eye
Status: Offline
Reply With Quote
Aug 19, 2005, 02:37 PM
 
A problem might be that you've got two <html></html> tag sets on your page.

Your included file only needs to a segment of a html.

kinda like:

</head>
<body>
<h1>my fabulous page</h1>
<?php include "nav.html"; ?>
<p>This is the content blah blah</p>

and nav.html would contain only the html for the nav e.g.

<a href="home.php">home</a>
<a href="contact.php">contact</a>
<a href="etc.php">etc</a>


having two html elements in the same document might send javascript for a ride.
     
surferboy  (op)
Mac Enthusiast
Join Date: Jul 2003
Status: Offline
Reply With Quote
Aug 19, 2005, 05:06 PM
 
Great to know. I took the tags out of the php included file. Still seems to work!

Thanks.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 11:53 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,