cheap website plus + a question

Discussion in 'Web Design and Development (archive)' started by brianellisrules, Oct 21, 2003.

  1. macrumors regular

    Joined:
    Oct 17, 2003
    #1
    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).
     
  2. macrumors 6502a

    sonofslim

    Joined:
    Jun 6, 2003
    #2
    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.
     
  3. thread starter macrumors regular

    Joined:
    Oct 17, 2003
    #3
    What do you mean by "the health of the web"?

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

    Mr. Anderson

    Joined:
    Nov 1, 2001
    Location:
    VA
    #4
    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
     
  5. macrumors 6502a

    sonofslim

    Joined:
    Jun 6, 2003
    #5
    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.

    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]
     
  6. thread starter macrumors regular

    Joined:
    Oct 17, 2003
    #6
    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.
     
  7. macrumors 6502a

    sonofslim

    Joined:
    Jun 6, 2003
    #7
    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.
     
  8. Moderator emeritus

    Mr. Anderson

    Joined:
    Nov 1, 2001
    Location:
    VA
    #8
    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
     
  9. Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #9
    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. :)
     
  10. macrumors 6502a

    sonofslim

    Joined:
    Jun 6, 2003
    #10
    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.
     
  11. thread starter macrumors regular

    Joined:
    Oct 17, 2003
    #11
    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?
     
  12. Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #12
    sonofslim-
    Thanks! :)

    ber.com-
    Do it to it. And yes, you've got a great start. Score one for the technocrats. ;)
     
  13. macrumors regular

    Joined:
    Oct 4, 2003
    #13
  14. macrumors 6502a

    sonofslim

    Joined:
    Jun 6, 2003
    #14
    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.
     
  15. Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #15
    That's a great companion to the Eric Meyer book I recommended in the other thread, too. ;)
     
  16. thread starter macrumors regular

    Joined:
    Oct 17, 2003
    #16
    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.
     
  17. Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #17
    I'll mock something up real quick for you in a couple of minutes...
     
  18. macrumors 68030

    Flowbee

    Joined:
    Dec 27, 2002
    Location:
    Alameda, CA
    #18
    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.
     
  19. Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #19
    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');
    ?>
     
  20. thread starter macrumors regular

    Joined:
    Oct 17, 2003
    #20
    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.
     
  21. thread starter macrumors regular

    Joined:
    Oct 17, 2003
    #21
    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!
     
  22. Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #22
    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.

    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'.

    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.

    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.
     
  23. thread starter macrumors regular

    Joined:
    Oct 17, 2003
    #23
    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
     
  24. Moderator emeritus

    Rower_CPU

    Joined:
    Oct 5, 2001
    Location:
    San Diego, CA
    #24
    Yeah it can be tricky to work out all the particulars of the system. Give it a shot and let us know how it goes.
     

Share This Page