Click to See Complete Forum and Search --> : Dynamic includes from subfolders
blodefood
03-29-2004, 05:11 PM
I have a set of folders in a folder called MTN. The subfolders are M1, M2, M3 etc. In each of these folders is an .inc file with a text string that is a publication date. (M1\pubdate.inc) This is included in the .asp pages in each folder.
I want to make a dynamic directory making the dates into hyperlinks. I have already succeeded in making the links correctly. The text I wish to display between the <a href..> and </a> is the include file text.
I do not know how to include a file cotained in a subfolder without putting a direct path. I need to have the path dynamic according to which folder . See *** below.
<a href="<%Response.write(x.Name) & "\PageOne.asp"%>" target="new"> *** </a><br />
Any help would be appreciated. Thanks.
blodefood
03-29-2004, 05:17 PM
Sorry, shoulda said also that the directory.asp page is in the MTN folder.
PeOfEo
03-29-2004, 06:10 PM
Humm, this is a terrible way to go about doing things in my opinion :/. I think it would be much easier to put a data base in to store the url and the description. Or better yet. Make only two pages, one would be your list with the descrtiption but when the user clicks the link you would use a query string to pass the id of the page the user wants and on page 2 the content the user wants could be output with the html. Do you have to use subdirectories the way you are? Does your host support MSSql server, will they allow you to upload an access mdb? BTW: Nice name, http://www.rathergood.com/ rocks. I like foodvick bloodax in blode6: attack of the uber pea.
blodefood
03-29-2004, 08:59 PM
Yup, Uber Pea is my favourite as well! Like the angry kittens?
The reason for the directories is that each one has all the files for an issue of an ezine. There are five or six pages for each issue, and actually the folders have a longer name that reflects the volume, issue number and year eg MTNV2I104.
Having already established this pattern over several issues, I would like to create a back issue directory. Thus this odd method of using the file/folder object and includes. The pubdate is a single line that is included in all pages. The includes make what could be hours of work to create a new issue into a few minutes.
The images are kept in one folder in the MTN. I'll have to figure out a way to exclude that one from the directory list.
If this is helpful, I wonder if anyone could come up with a better method of doing this.
- blodefood
PeOfEo
03-29-2004, 11:01 PM
Heh, do it like every other website that has lots of data... put it in a data base. It would make your life much easier, you might only have two .asp(x) files floating around but mountains of content in a data base (even files and images). The kittens make me say hum (gaybar for example)... I like the crabs.
blodefood
03-30-2004, 09:27 AM
I am trying to avoid using a database for this one. This is because I am working with other people putting the ezine together who are not very computer literate. Again, the hours versus a few minutes' work.
What about some ASP scripting based on the folder name?
Currently, I am using MTN (name of the ezine), V2 (Volume)
I3 (Issue) 04 (Year). The only problem this presents is getting the month. There will be 11 issues this year, so maybe the month is not such a big deal.
If I have solved my own problem, I just need that little bit of code to go between the <a href..>here</a> tags.
- blodefood
PeOfEo
03-30-2004, 05:32 PM
Well I am no authority on asp classic but I am guessing you are going to have to use a fso to acheive this. Just because you use a data base does not mean that comp illiterite people cannot use it... just give them a web form to paste text into and give them some [text formating] codes[/formatting] to make their lives easier using the replace statement
replace(sting, "this", "withthis"). Ok but I think a better solution would be to just name the file what you want the article title to be then lop off the format and just get the file name the same way you are getting the path, I am assumeing you are already using an FSO for that.
http://www.w3schools.com/asp/asp_ref_filesystem.asp
all about the asp file system, you can learn more here then you can from me.