Embedding other pages to make changes easier

sitemaniac

New Member
Hi,

I am building a site which will have pages added to it consistantly over time.

My problem is that I have a sidebar and footer in each page which could need to be changed at any stage. I don't want to have to edit every page everytime I make a small change to these.

The site is currently split with divs. A main div floting left and a sidebar div floating to the right. Now that I think of it..... If I ever change the logo or top links I'd have the same problem. Potentially, this site could have 100 - 1000 pages.

I am quite new to web design so I would appreciate any help or advice in the best way to future proof this site.

I'm thinking that having seperate pages for the top area, side bar and footer that are somehow embedded into the page so that I'd only ever have to change those pages?

By the way. I'm not using dreamweaver at the moment. Just coding HTML myself. I'd like to do it all myself as I want to learn properly.
 

ronaldroe

Super Moderator
Staff member
You probably need to go with a CMS. Check out Joomla, Drupal, or Wordpress, to name a few. A CMS will allow your content to be generated dynamically from a database, as opposed to individual pages. Also, it will make creating the individual pages much easier with backend administration. Check out http://php.opensourcecms.com/ to play around with the many CMS's out there.
 

DHDdirect

New Member
I use PHP for this situation. It basically inserts pages from outside of the veiwed file so when you only need to change something in your navigation you only change it in one spot.

PHP:
<?php
 include ("includes/sidebar.tpl");
?>
 

sitemaniac

New Member
Thanks for the replies. I did some googling on this also and am thinking maybe an iframe tag would work if I'm able to get rid of the borders and scroll bars. I need to investigate more.

I'm not really familiar with PHP at the moment so don't know how to implement the above code (but thanks - I will check it out also)

I'm not sure I need a CMS as the main content would not need to be edited - Just the footer, side bar (adverts) and nav sections.
 

DHDdirect

New Member
PHP is fairly straight forward as far as coding goes.

I setup an example for you. You can look at each one of these files and see how the php include works. It doesn't take much except that the file that has the php code tag needs to have the php file extention. You will see in my example before I used a .tpl file extension but that can be anything such as .html, .php etc.

Hope that helps.
 

Attachments

  • php_include_sample.zip
    874 bytes · Views: 12
Top