Forum Moderators: phranque

Message Too Old, No Replies

How to automatically create index pages

A dillemma...

         

PFOnline

3:09 am on Jun 1, 2004 (gmt 0)

10+ Year Member



Ok this is really hard to explain so bare with me, i will try my best...

Say im running a lyrics site for example...

How would you create the index page (for example: www.mydomain.com/lyrics/r/rolling_stones/index.html) for every artist, (there are over 3000 artists) that will list all the available lyrics by this artist...
(all the actual lyric files within each artist directory are done, and look like this for example: www.mydomain.com/lyrics/r/rolling_stones/paint_it_black.html)

What is the best way to go about doing this?

Right now in each artist directory, it just lists all the files, and this is basically what i want, but it doesn't have my web design or logo, just the apache index file.

I just need to know how to automatically create the index files for www.mydomain.com/lyrics/r/artist/ that will list all the lyrics by that artist.

lasko

5:59 am on Jun 1, 2004 (gmt 0)

10+ Year Member



If your using Apache and php have a look at mod_rewrite

I would do something like

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule (.*)/(.*)/(.*)/index.htm$ /index_template\.php?artist_id=$3 [L]

By no means is the above correct but if you know a little php then you can create a database of all your content then use mod_rewrite under apache to generate index files for each directory.

[edited by: lasko at 6:11 am (utc) on June 1, 2004]

ogletree

6:08 am on Jun 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You could create an index page that has a script that goes out and finds all the file names in it's directory then makes a page with that info. You could have the site template includes at the top and bottom of that code. Just copy that file to every directory. You could also make a script that spiders your site and usese that information to make each index file and creates it in it's directory.

ControlEngineer

6:29 pm on Jun 1, 2004 (gmt 0)

10+ Year Member



If there is some way to list the directory and get it into an Excel spreadsheet, you can then hand code (or copy the code produced by Frontpage, etc.) the an index page (with your logo and anything else you need) in MS Word. Use mail merge to copy the excel to Word, then save the word document as plain text with the extension changed to .html (This is NOT the same as saving the word file as a web page or saving as .html).

I have converted several spreadsheets to web pages this way. You can put the url in the anchor fields as both the target and as the displayed text.

How to create the spreadsheet depends upon what other sofware you are using. Generally, if you can get the index into a text or word processing document with returns at the end of each entry, you can cut and past into excel, resulting in a row for each entry.

grifter51

6:04 am on Jun 2, 2004 (gmt 0)

10+ Year Member



I've done something similar to what you described using a program called DIRHTML

It can build a scrolling frame with the directory names(Artists) on the left and thefiles (Lyrics) on the right. It's fairly customizable.

home.pacbell.net/nitzsche/dirhtml.html