Hi, I was wondering if anyone could help me with this. I can design websites, and code them in xhtml and css. Now lets say I have a two column site. One the second column lets say I have partner links. Now if I want to edit those partner links, I have to go through each and every individual page and do it. Its boring and time consuming. Is there a better way to this?
Something like <?php include("filename.php"); ?> PHP: might work. That way you can make a file for the links, then edit that one file to edit it on every page.
my only suggestion is use php and then implement the 'php include' function..... haha we posted at the same time
if you are new to php, you should know that you can take your current .html files and rename them to .php, then add php tags (<?PHP include('url'); ?>)
I definitely recommend PHP like the above. I remember being in the same boat and that's why I got into PHP to begin with. However, if you are looking for a CMS, then Joomla or Mambo are pretty good ones.
You need to learn how to build websites using some kind of "architecture". By architecture, I mean that there has to be some structure to how your pages are developed/generated/displayed etc ... . For example, when I design webpages, I have the header, footer, left/right navigation (ie: things that tend to stay the same across many web pages) defined in separate files. Then you can make an individual page file for the unique content of a particular page. When a change needs to be made to the header, footer, or left/right navigation of a page, you just have to change one file. I also define important constants in a separate file (ie: MAX_USERNAME_LENGTH) which I can then refer to in each individual page. This enables me to change values across all pages by just changing the constant value in the file containing the constants.
Using php includes is definitely the way to go. You can create a separate file for each common part of your site (header, footer, navlinks etc) and call them up on the pages using the method Unreal gave above. Then when you want to change something you only have one file to change. Using php includes along with an external CSS stylesheet can make your job much easier. Unfortunately, changing all your files to .php can be a hassle so it is best to start using this method from the beginning.
As previously stated use PHP includes function and learn to structure your website. What I do is create a new page and call it anything I want. In your case I'd call it partnerlinks.inc (or .php, .html, .txt, .htm it's up to you). I'd place that in a file called Content or Includes. On my actual page such as index.php my coding would look like this <html> <head> <title>Home</title> 'CSS Code here' </head> <body> <div> <?php include ('includes/header.php'); ?> </div><div> <include ('includes/menu.inc'); ?></div> <table> <tr> <td> <?php include ('includes/content.inc'); ?> </td><td> <?php include ('includes/partnerlinks.inc'); ?> </td> </tr> </table> <div class="footer"> <?php include ('includes/footer.inc'); ?> </div> </body> </html> I do everything with includes. So I can just edit the basic content of each page. I also organize it like this index.php (only files changed are content.inc) order.php (only files changed are order.inc) contact.php (replaced main content area with php form code but I could also do an include here as well) So if anything ever changes you don't have to worry about screwing up your code.