Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

brianellisrules

macrumors regular
Original poster
Oct 17, 2003
229
0
http://www.brianellisrules.com




right now I'm using frames... I think I want to get away from it, but I'm not really sure how. well, I know *how* to do it, but if I want a header/menu type feature, do I have to code that into each and every page? or are there cool shortcuts available through the use of things like xml, javascripts, etc (which I don't know just yet).
 

sonofslim

macrumors 6502a
Jun 6, 2003
742
0
includes -- either server-side html (shtml) or via php/mysql or really any one of many server technologies. much better for your site, and for the health of the web, than frames.

i use php/mysql. includes can be as simple as "inlude menu.php" which just places whatever is in the menu.php file; or as complex as a function with multiple arguments, allowing you to customize your include based on paramaters you set.

for instance, you could have a sidebar or table of links on all of your pages; when you include it on any particular page, you can also pass it the current location, and have that menu display the current link in a "you are here" style.
 

brianellisrules

macrumors regular
Original poster
Oct 17, 2003
229
0
Originally posted by sonofslim
includes -- either server-side html (shtml) or via php/mysql or really any one of many server technologies. much better for your site, and for the health of the web, than frames.

i use php/mysql. includes can be as simple as "inlude menu.php" which just places whatever is in the menu.php file; or as complex as a function with multiple arguments, allowing you to customize your include based on paramaters you set.

for instance, you could have a sidebar or table of links on all of your pages; when you include it on any particular page, you can also pass it the current location, and have that menu display the current link in a "you are here" style.
What do you mean by "the health of the web"?

php/mysql... I have a feeling most of that is over my head...
 

Mr. Anderson

Moderator emeritus
Nov 1, 2001
22,568
6
VA
php is a good way to go and there are quite a few members here who have set up their own sites with it, so you could probably ask a few questions about specifics and get all the answers you need.

nice site, btw....and in the other thread started by j-lo you got into a good discussion about the tech details....rower knows his stuff.

Good luck!

D
 

sonofslim

macrumors 6502a
Jun 6, 2003
742
0
Originally posted by Mr. Anderson
php is a good way to go and there are quite a few members here who have set up their own sites with it, so you could probably ask a few questions about specifics and get all the answers you need.

i second that -- php is nice in that you can easily do a lot without having to learn every nook and cranny of the language. in your initial post, you mentioned javascript; at the level we're talking about (non-commercial/non-huge-database-driven sites) the php you'll use is as straightforward as any javascript you'll use. you don't even need to get into mysql.

What do you mean by "the health of the web"?

generally, "modern" web design has moved away from frames for several reasons. largely, but not solely, it's a matter of useability. frames do weird things to URLs; it can be difficult to link to a particular frameset, making your content less accessable. and they can be hard to index, making your content harder to find in the first place.

so, alright, if you use frames it's not like you're ruining the internet for everyone or anything. but a lot of good thought has gone into the recommendations of the web standards people (w3c.org, but many other worthwhile sites explain it all in simpler english) so why not make your own contribution to a better-designed web?

[/web standards evangelism]
 

brianellisrules

macrumors regular
Original poster
Oct 17, 2003
229
0
whoa, whoa, whoa... I'm reading up on php and making efforts to get away from the frames... trust me! ;)


I just read a tutorial on php that had a lot of good info about variables and strings and a little bit on loops and whatnot, but I don't think that really points me in the right direction for what I'm looking to do. I'll keep looking later (unless someone has some links for me), but right now I gotta head to a meating.
 

sonofslim

macrumors 6502a
Jun 6, 2003
742
0
Originally posted by ber.com
whoa, whoa, whoa... I'm reading up on php and making efforts to get away from the frames... trust me! ;)

yeah, sorry... it's my job to get carried away about web standards.

beats when i was in high-school and worked with cows on the weekends. tough to get fired about about a field full of cow crap, i'll tell you that.
 

Mr. Anderson

Moderator emeritus
Nov 1, 2001
22,568
6
VA
there has to be a few good books on getting up and going with php - and I'm sure you could get some suggestions here. But it might be best to go to Borders/BooksAMillion/etc. and grab one that has the basic stuff you're interested in doing.

I would wager that you could find a book specifically to do weblogs with pics and interactivity (allowing for comments and such).

That said, I'm thinking I might have to go out and get that one as well. :D

D
 

Rower_CPU

Moderator emeritus
Oct 5, 2001
11,219
2
San Diego, CA
I started out with a Visual Quickstart Guide for PHP and it was a very friendly introduction.

Like sonofslim said, a few includes and/or requires and you've got reusable content a la frames, but without the frameset. I use includes on most of my sites for repeated elements like headers, footers, persistent navigation, etc.

When you combine that with an external CSS file for your styles you've got a lean, mean website.

PS. Nice to see another standards evangelist around, sonofslim. :)
 

sonofslim

macrumors 6502a
Jun 6, 2003
742
0
Originally posted by Rower_CPU
PS. Nice to see another standards evangelist around, sonofslim. :)

just doin' my part.

(and congrats on the engagement, by the way!)

ber.com -- there are plenty of people here who would be glad to throw some pointers your way, no matter what route you go... just say the word.
 

brianellisrules

macrumors regular
Original poster
Oct 17, 2003
229
0
Originally posted by Rower_CPU
I started out with a Visual Quickstart Guide for PHP and it was a very friendly introduction.

When you combine that with an external CSS file for your styles you've got a lean, mean website.
Yeah, I think I'm going to look for a book after work today...

Maybe what I'll do is code up a generic template-type page of what I want my page to look like, and then ask for pointers/suggestions as to how I should go about it...? (If you guys would be willing to throw me a bone that way.)

But, I think I'm starting to get the hang of external CSS, so I'm already halfway to a lean mean website! Right?


...right?
 

sonofslim

macrumors 6502a
Jun 6, 2003
742
0
Originally posted by ber.com
But, I think I'm starting to get the hang of external CSS, so I'm already halfway to a lean mean website! Right?
...right?

right! if no one else has already, let me be the first to recommend Designing With Web Standards by Jeffrey Zeldman. it'll teach you a whopping big ton of techniques and skills, but more importantly it'll teach you how to think about building web pages in a smart, smart way.
 

Rower_CPU

Moderator emeritus
Oct 5, 2001
11,219
2
San Diego, CA
Originally posted by sonofslim
right! if no one else has already, let me be the first to recommend Designing With Web Standards by Jeffrey Zeldman. it'll teach you a whopping big ton of techniques and skills, but more importantly it'll teach you how to think about building web pages in a smart, smart way.

That's a great companion to the Eric Meyer book I recommended in the other thread, too. ;)
 

brianellisrules

macrumors regular
Original poster
Oct 17, 2003
229
0
OK, how would I go about doing something like this....

-a title/banner area that remains constant with every page.
-a menu section (either dynamic, with dropdown options, or traditional style) which would also remain constant with every page.
-an area where the content pops up based on which menu is selected.

I'm sure this is like pre-webpage 101 type stuff... but yeah, I'm pretty clueless.

Thanks for the help.
 

Flowbee

macrumors 68030
Dec 27, 2002
2,943
0
Alameda, CA
Originally posted by ber.com
OK, how would I go about doing something like this....

-a title/banner area that remains constant with every page.
-a menu section (either dynamic, with dropdown options, or traditional style) which would also remain constant with every page.
-an area where the content pops up based on which menu is selected.

I'm sure this is like pre-webpage 101 type stuff... but yeah, I'm pretty clueless.

Thanks for the help.

I don't want to derail the php discussion, but using Dreamweaver, I just created a basic template with my Banner on top, menu selections underneath, ads along the side, and an editable "content" window in the center. When you create a new page from the template, all the code for those elements is already there. All that's left for you to do is fill in the content. I realize that this isn't the most sophisticated design, but I'm a playwright, not a programmer, and this seemed like the best solution.

Click my sig for the results.
 

Rower_CPU

Moderator emeritus
Oct 5, 2001
11,219
2
San Diego, CA
Check it, yo.

http://organicallydigital.com/ber/

It's a total of 5 files:
- the index.php file that calls in the other files
- the CSS file
- the 'head.inc' file that makes up the head of the document
- the 'nav.inc' file that makes up the menu section
- the 'body.inc' file that will contain the main page content

Here's the PHP I used:
PHP:
<?php
include('head.inc');
include('nav.inc');
include('body.inc');
?>
 

brianellisrules

macrumors regular
Original poster
Oct 17, 2003
229
0
awesome! and now for the barrage of (dumb) questions...

1) index.php -> this basically had the <html>, <head>, <title> and <body> tags, plus the php code you listed... correct? the php goes inside the <body> tags? (not to mention DTD and CSS links, etc)

2) these individual *.inc files -> they're just standard html files, except they have a .inc ending?

3) body.inc -> how do I get this to update after each menu/link selection with a new/different page?

4) for the menu, I was thinking drop-down menus... should I learn to crawl before I try running?

Other than that, I'm with you so far... hahaha

(I think) I understand what's going on based on what I read in the php tutorials I checked out today. The thing that gets me is that whenever php is mentioned, it's all about databases and arrays and I'm thinking to myself, "how is that going to help me code drop-menus?"

Or maybe I'm a moron and I can't see the forest for the trees. Or something like that.
 

brianellisrules

macrumors regular
Original poster
Oct 17, 2003
229
0
Originally posted by Flowbee
I don't want to derail the php discussion, but using Dreamweaver, I just created a basic template with my Banner on top, menu selections underneath, ads along the side, and an editable "content" window in the center. When you create a new page from the template, all the code for those elements is already there. All that's left for you to do is fill in the content. I realize that this isn't the most sophisticated design, but I'm a playwright, not a programmer, and this seemed like the best solution.

Click my sig for the results.
Yeah, I checked out your site before and it's very cool and definitely slick looking.

I started off using Frontpage (eek!), but that garbled up the code good... so then I switched over to notepad and kicked it old school for a while... then I was turned onto CSS and that helped clean things up a bit... but from what I hear, this php stuff is the wave of the future, so who am I to argue?

And I hear ya... I'm an engineer, not a programmer... this stuff is bringing back FORTRAN nightmares from school. I thought I'd sworn of programming forever - ha!
 

Rower_CPU

Moderator emeritus
Oct 5, 2001
11,219
2
San Diego, CA
Originally posted by ber.com
awesome! and now for the barrage of (dumb) questions...

1) index.php -> this basically had the <html>, <head>, <title> and <body> tags, plus the php code you listed... correct? the php goes inside the <body> tags? (not to mention DTD and CSS links, etc)

Actually, I stuck all the HTML in the .inc files, but you could put it in index.php. It's nice if you're going to use the same header to not have to worry about the DTD, charset and CSS links for each page.

Originally posted by ber.com
2) these individual *.inc files -> they're just standard html files, except they have a .inc ending?

Yeah, just HTML snippets. It's a suggestion I've read that helps you to differentiate files based on their purpose and use. Since they're being included...'inc'.

Originally posted by ber.com
3) body.inc -> how do I get this to update after each menu/link selection with a new/different page?

The easiest way to do it would be to create a news.php file that includes news.inc, etc. Just create a new PHP file and include the parts you want.

Originally posted by ber.com
4) for the menu, I was thinking drop-down menus... should I learn to crawl before I try running?

Other than that, I'm with you so far... hahaha

(I think) I understand what's going on based on what I read in the php tutorials I checked out today. The thing that gets me is that whenever php is mentioned, it's all about databases and arrays and I'm thinking to myself, "how is that going to help me code drop-menus?"

Or maybe I'm a moron and I can't see the forest for the trees. Or something like that.

Give it a shot. Throw some javascript on there and have at it. I saw that you've checked out WebMonkey already...they've got some good DHTML stuff on there.
 

brianellisrules

macrumors regular
Original poster
Oct 17, 2003
229
0
OK, I *think* I've got it all figured out on how to switch my current page over to php except for one small problem....

I can use php for every page except for the main/news page... it uses blogging software to make the updates and has an automated file naming/storage/creation system.

The main file is stored in /greymatter/

Each individual entry is stored in /greymatter/archives/

I'm pretty sure what happens is that the software grabs the X most recent entries and puts them all together to form the main page (/greymatter/index.htm).

I can go into the control panel and change it so the files are output as *.inc as opposed to *.htm. In the php file, I figured I would do:

<?php
include('head.inc');
include('/greymatter/index.inc');
?>

This would work for the main page, but anytime someone tried to access the archives, it wouldn't work due to the separate directory and file names.

Although, now that I think about it, within the blogging software there's different templates for main index, archives, etc... I guess I could set it up so the main index is formatted for the php, but each of the archives are complete html pages, with the header/menu section put at the top as html..... that might work.... although it'd be pretty rigged.

But, if I change the settings so the files are as .inc, that would mess up the archive files.... right?

Wow, I just confused the heck out of myself about a dozen times here. haha
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.