Website design - articles divided into categories

TheJTrain

Senior member
Dec 3, 2001
665
6
81
I'm trying to re-design my website to display documents I've written (articles, letters to the editor, stories, etc.) and trying to figure out the best way to do so. I've been using Dreamweaver so far but code doesn't scare me - I've got some limited familiarity with Java, C++, and SQL. I have yet to learn PHP/MySQL but I understand it's pretty straightforward, and I'll probably want to use it for a future website feature that will definitely require a database.

This site is an example of what I'm thinking from a UI standpoint - the menu on the left expanding to show the contents of a category (but I might want each document in more than one category), then the document you click on displayed in the middle without the left-side menu changing at all. Am I right in assuming that, once there are upwards of 50 documents or so, it would be easier to add a new document if it was run from a database rather than with frames? If so, what suggestions do you all have for me as to how I might get started?

Thanks,
Jason
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
I'd stay away from the frames in the first place. They're sort of meant to be deprecated and there are all sorts of problems with using them. For one, you can't properly link to a page that shows up within the frame; you can only find it by clicking a series of links.

php is a nice, simple way to start with dynamic pages but you don't necessarily need a database. Your articles can be stored in text files and can simply be included into the page that displays them. Are you looking for a kind of solution where you can add new articles without modifying any code or is a little work ok?
 

TheJTrain

Senior member
Dec 3, 2001
665
6
81
Thanks for the reply kamper. I certainly wouldn't mind a little work, but I'm looking for a smart way to go about it that would be less complicated than the all-html no-php no-frames way I started with and quit early because I foresaw it getting really really bad.
 

TheJTrain

Senior member
Dec 3, 2001
665
6
81
Yeah fanboy, that's my impression as well - just seemed like with the limited HTML I know (and the lack of PHP/SQL), it was the only way I could think of to produce the desired effect. But I knew they sucked, hence the effort to find a better way.
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
ok, so what I'd do: if you've only got articles and categories then I wouldn't bother with a database. A db makes it harder to port around and creates more hassle in general. I'd come up with a standard format for the articles. Say, write some basic html into them, like <p> and anything else you may need and store them in an incomplete html file (no <html>, <body> ....). Then I'd make a single xml file that stores categorization info. In that file you say which articles belong in which categories and what file the articles are stored in. Then you have one php page that reads in the xml file and sets up an appropriate menu system. The page would have an optional argument specifying which article you want (maybe by number) and if that's present then the page simple imports the article straight into wherever it wants it. Otherwise it could default to some home page like display.

I've never tried anything like this so I don't know how it'd turn out. One problem I forsee is that you wouln't want to reparse the xml file everytime that page is requested. Maybe you could find a way to cache the info somewhere once it's been parsed. Anyways, then, each time you want to add an article you put in the file and add it to the xml file.
 

TheJTrain

Senior member
Dec 3, 2001
665
6
81
Thanks for the suggestions guys, and for confirming that frames are not the way to go. The PHP/XML route suggested by kamper sounded like an efficient way to go about it without a database, but through other conversations I've been encouraged to use this as my "learn PHP/MySQL" project even though, as one friend put it, "it's a little too much hammer for [my] nail."

I found this PHP/MySQL tutorial that looks like a good place to start - any other suggestions for how to quickly get up to speed?

Thanks again,
Jason