Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,615 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 981 people online right now. Registration is fast and FREE... Join Now!




Help with a *template* .. perhaps database? Read please...

 
Reply to this topicStart new topic

Help with a *template* .. perhaps database? Read please...

CarpeD1em500
post 12 Jul, 2008 - 04:42 AM
Post #1


New D.I.C Head

*
Joined: 12 Jul, 2008
Posts: 7

Hey guys - I'm new here but I googled for a good community to help me out so here goes...


I'm building a website thats gonna have numerous articles over the next few years, and each article is going to be posted in a new html file, etc. However, every page on the site is going to have the same "wrapper". Basically, its a giant table, but the top is a logo/nav bar, the sides are two ads, and the bottom is a footer, with all the edited and new content in the middle of this "template" i guess is the best way to put it.

My question is this....I know it's easy to set up this template and then copy + paste into every new html document I create, but is it possible to somehow store this template on my server, and queue up pages so they load from this one file (the *wrapper*), and then load the specific content (i.e. a new article) for that page, into the template?

Basically, I figured this would cut down on server loading times, as well as storage space (even though this would be very minimal), but the MAIN concern would be if I wanted to ever change this template, I could do it site wide by changing one simple html file, as all of the articles and whatever look to this file for the template first, then fill in the other info.


Hopefully this makes sense. Please help and thanks x a million in advance. You guys are the best!

((oh and I know it says to show my code, but that's not really an issue. I have a page that I can code, I just don't have any idea how to code a webpage to "grab" (for lack of a better word) from another webpage...thanks!!))
User is offlineProfile CardPM

Go to the top of the page

ahmad_511
post 12 Jul, 2008 - 11:36 AM
Post #2


D.I.C Regular

Group Icon
Joined: 28 Apr, 2007
Posts: 351



Thanked 8 times

Dream Kudos: 400
My Contributions


hello.
if th articles are pure html you can just use ajax to load the articles on a div which is the contents part in the middl of your template

there are may ways to accomplish that depending do want to store the articles and how do you want to call it

Good Luck
User is offlineProfile CardPM

Go to the top of the page

CarpeD1em500
post 12 Jul, 2008 - 12:33 PM
Post #3


New D.I.C Head

*
Joined: 12 Jul, 2008
Posts: 7

QUOTE(ahmad_511 @ 12 Jul, 2008 - 12:36 PM) *

hello.
if th articles are pure html you can just use ajax to load the articles on a div which is the contents part in the middl of your template

there are may ways to accomplish that depending do want to store the articles and how do you want to call it

Good Luck



Is it possible to do the reverse...and load the "frame" of the page, i.e. the header, footer, etc....

In the future, the old article content will never change, but if I update the header, to say, a new logo, that WOULD change...and I'd like to not have to go manually edit like 1000 html files to make sure the site look and feel remains consistent throughout, ya know?

This ajax thing sounds promising though...could you please point me in the right direction in terms of where to learn more and stuff? Maybe a link / tutorial?

I really appreciate all the help.
User is offlineProfile CardPM

Go to the top of the page

CarpeD1em500
post 13 Jul, 2008 - 03:33 PM
Post #4


New D.I.C Head

*
Joined: 12 Jul, 2008
Posts: 7

Bump please smile.gif
User is offlineProfile CardPM

Go to the top of the page

ahmad_511
post 13 Jul, 2008 - 07:18 PM
Post #5


D.I.C Regular

Group Icon
Joined: 28 Apr, 2007
Posts: 351



Thanked 8 times

Dream Kudos: 400
My Contributions


take a look at the snippet / javascript sction

you can send xmlhttp request to a server side script which will sen you back the necessary infos as responseText,

in case you send arequest to a .txt or .html or... any text file you'll recieve the whole file as response text
User is offlineProfile CardPM

Go to the top of the page

BenignDesign
post 14 Jul, 2008 - 11:45 AM
Post #6


Bubble wrapped for your safety.

Group Icon
Joined: 28 Sep, 2007
Posts: 931



Thanked 2 times

Dream Kudos: 150
My Contributions


QUOTE(CarpeD1em500 @ 12 Jul, 2008 - 08:42 AM) *

the MAIN concern would be if I wanted to ever change this template, I could do it site wide by changing one simple html file


Your best bet for this one is a stylesheet (CSS). You can edit your site's colors, divisions, heights, widths, etc, in one CSS file. If you are looking for something that will allow you full redesign abilities with just one file though, I am afraid there is no easy solution. Something on the server end may work - a CMS perhaps, or even just your site laid out in PHP so you can update the header for the entire site by changing one included file... or the footer... or the menu, etc, etc .... just my thoughts... maybe someone else has something more informative to say....

This post has been edited by BenignDesign: 14 Jul, 2008 - 11:46 AM
User is offlineProfile CardPM

Go to the top of the page

CarpeD1em500
post 14 Jul, 2008 - 06:32 PM
Post #7


New D.I.C Head

*
Joined: 12 Jul, 2008
Posts: 7

Thank you both so very much.

Since the project I'm working on is not a 100% guaranteed success, I've decided to built it using the basic html and css knowledge I have, and then revisit the code during Winter Break (in college still) and see if I need to a) tweak things, or cool.gif just blow up the whole site.

In between now and then I'll update the manual way, and then take all that time to learn as much as I can, so I can be prepared for the best case scenario, which is our site takes off and I need to re-do it in a much better fashion!!

Thanks so much, I'll go back to lurking and learning now! smile.gif
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 03:02AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month