Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Help with "News" section
Old 04-14-2004, 12:26 PM Help with "News" section
Rubbinio's Avatar
Novice Talker

Posts: 5
Trades: 0
Hi,

i am curently designing a website. And one of the pages has a lot of news titles which link to a new page with the full article of the news.

On the main page, I have an area in which i diplay the title of the latest news as well as the first cople of lines.

Is there any way to do this such that i do not have to change the main page evry time when i update my news section.

I was thinking to use a TXT file to hold the paragraph but i can not figure any way of reading it and posting it in a formated way.

Any suggestions are apreciated.

Thx
Rubbinio is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-14-2004, 12:51 PM
Skilled Talker

Posts: 93
Trades: 0
Can you find out if your server supports server side includes (SSI)?

If they do, you can put the information in another html file and reference it from the page where you want it to display.

On my sites, I have a folder set up called "includes" and in it I have files that contain the stuff I want to insert. These files are saved as html files, but you don't need the <html>, <head>, <body> tags, etc. Just put whatever you want to appear on the page.

One of my includes holds that little bit of text I keep on the bottom of each page saying "this site designed and maintained by..." - I called it "design.html". clever name, huh?

Anyway, wherever I want that information to appear, I just insert the following code:

<!--#include virtual="../includes/design.html" -->

Or something approximately similar. (like of course I don't use the ../ if I don't need to go up in the directory structure to get to the includes folder.)

A couple things you have to do to make this work, besides making sure your server supports it at all:

Be aware that if no adjustments are made, includes will not work on html pages. I'm not talking about the fact that the include pages themselves are html files - that's ok. I'm talking about the pages where you want to insert the include's content.

They will work on shtml files, so one option is to change your extensions to shtml. There are problems with this, especially since you're talking about your main page. Even on secondary pages, if you've got the page up already you probably don't want to go changing the names. People may be looking for certain pages by the old name, and you don't want to lose anyone.

Another option is editing what's called your htaccess file so that includes *will* work in html files. (or asking support at your host to do it) This may be too heavy, but in case you venture in that direction, your main directory needs a file called .htaccess (right - nothing before the dot) which need a line in it that reads

AddHandler server-parsed .html

(again, no tags or anything, just that.)

Well this was probably more than you wanted to hear, huh? I hope you can get the SSI stuff going - it's really a great tool. I've got a million pages (well not a million, but it felt like it when I was hand coding every one every time I changed my email address...) but anyway, for example, if I want to change my contact information, I don't have to edit every page where I want it to display. Now that I have it set up to just call on an include, I just go in and change the include - *once*. (of course you have to put the includes there in the first place, but well, we wanted to do web design )

Ok, I think that's all (!)
Good luck,
AmyD
AmyD is offline
Reply With Quote
View Public Profile
 
Old 04-14-2004, 02:43 PM
Rubbinio's Avatar
Novice Talker

Posts: 5
Trades: 0
Thx AmyD. It works perfectlly.

Rubbinio

Last edited by Rubbinio; 04-14-2004 at 03:59 PM..
Rubbinio is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help with "News" section
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12324 seconds with 12 queries