Web Hosting Forum | Lunarpages
News: October 6, 2008 - Submit Your Site for the October 2008 Site of the Month!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 11, 2008, 08:04:41 PM


Login with username, password and session length


Pages: [1] 2   Go Down
  Print  
Author Topic: Footer with Global Change  (Read 2227 times)
Sage
Intergalactic Cowboy
*****
Offline Offline

Posts: 58


« on: February 12, 2008, 12:27:48 PM »

Hello Everyone:  Very Happy

I have a new site that I have been working on. The content seems to be increasing and there are plans to make this site rather large. Here's what I'd like to do:

Using a footer, I'd like to have some kind of template (if possible) where I can put my Site Info/Copyright with year, etc. As of now, I have to change each page as it is updated with the new year, etc. and this is consuming. Isn't there some way that this can be done within one file and a global change is done?

I've looked all through DW  Surprised and can't find the feature that I'm looking for -- CSS doesn't seem to be the answer.

Many thanks.
Sage
Logged
Mitch
Lunarpages Traffic Cop
Senior Moderator
Berserker Poster
*****
Offline Offline

Posts: 7949



WWW
« Reply #1 on: February 12, 2008, 12:36:31 PM »

Are you using any type of content management system like Joomla or WordPress or is this all hand written?  If done in PHP I would say a PHP include would do the trick.  Also a server side include might work too. 

Logged

Sage
Intergalactic Cowboy
*****
Offline Offline

Posts: 58


« Reply #2 on: February 12, 2008, 12:40:45 PM »

The only PHP program attached to my site is with a Blog program; other than that, my entire site is done in Dreamweaver.

Why would I need to use PHP?
Logged
Mitch
Lunarpages Traffic Cop
Senior Moderator
Berserker Poster
*****
Offline Offline

Posts: 7949



WWW
« Reply #3 on: February 12, 2008, 12:49:31 PM »

Ah Dreamweaver, never used it myself - but did some searching and ran into this:

http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=546

Hope that helps!
Logged

Sage
Intergalactic Cowboy
*****
Offline Offline

Posts: 58


« Reply #4 on: February 12, 2008, 12:59:43 PM »

Mitch, thank you so much  Clapping this looks like a WINNER!!  This is absolutely perfect. I'm going to try it out.

Again, thank you.
Sage
Logged
Mitch
Lunarpages Traffic Cop
Senior Moderator
Berserker Poster
*****
Offline Offline

Posts: 7949



WWW
« Reply #5 on: February 12, 2008, 01:34:26 PM »

Awesome, if there is anything else we can help with please feel free to let us know!
Logged

Sage
Intergalactic Cowboy
*****
Offline Offline

Posts: 58


« Reply #6 on: February 12, 2008, 02:10:12 PM »

I tried this and followed everything -- in Dreamweaver it works beautifully, but when uploaded it doesn't appear in either browser of Fox or IE.  Sad Any suggestions in getting this to work properly?  Grr..!!

I used this code for my copyright.html file:

<!--#include file="/serversideinclude.html" -->


In the body of another document this is added:

<span class="siteInfo">
      <!--#include file="copyright.html" -->
    </span>

Thanks again for your help.

Sage

Logged
Ibanez Player 85
Galactic Royalty
*****
Offline Offline

Posts: 428


WWW
« Reply #7 on: February 12, 2008, 04:38:06 PM »

Try saving your page as .SHTML rather than .HTML and see if that works for you.
« Last Edit: February 12, 2008, 04:42:55 PM by ibanezplayer85 » Logged

Refined Web Design
http://refinedwebdesign.com
Sage
Intergalactic Cowboy
*****
Offline Offline

Posts: 58


« Reply #8 on: February 12, 2008, 04:55:40 PM »

I tried the shtml -- nada!  Crying or Very sad

My site will be well over 30 pages (possible 100 as a research center) and uploading every page as suggested would be challenging.

I did make a template page yesterday because I thought it would work in html, but you're suggesting PHP? I'm not really familiar with all of PHP -- wouldn't I have to convert all of my html files to PHP? I just want a footer that works. I didn't think this would be so difficult. There has to be something simple that can be done right?  Confused

Sage
Logged
Ibanez Player 85
Galactic Royalty
*****
Offline Offline

Posts: 428


WWW
« Reply #9 on: February 12, 2008, 05:33:24 PM »

Despite the fact that you mentioned you don't know PHP, I think you can still achieve this with little effort (and you don't even need to "convert" anything you already made).  You could achieve something similar to this in Dreamweaver by using templates, but if you wanted to make an update, you'd have to reupload ALL of the pages (this is kind of a pain).  If you did this in PHP, you would only have to change and upload one file to make the change globally.  It's really not difficult, and requires very little knowledge of PHP to implement.  And once you set it up this way, making changes globally will be very easy.

Basically, you would rename all of your .HTML files to .PHP.  (If, for some reason, this isn't possible for you, you can make a change to your .htaccess file to parse PHP in your HTML document).  Then, you would create a file called footer.php and include that file on all of your pages.

Example:

Footer file:

Code:
<span class="siteInfo">Copyright 2008, Your Company. All Rights Reserved.</span>

Wherever you want to include the footer, use this code:

Code:
<? include('footer.php'); ?>

If you're using different paths for files, you would have to append that to the include.  For example, if your footer.php file is in the directory /public_html/inc/, then you would use:

Code:
<? include('inc/footer.php'); ?>

That would be for all the pages in the root of your /public_html/ directory.

If you're calling this include from a deeper folder, such as /public_html/resources/resource.php, then you'd have to call it like this:

Code:
<? include('../inc/footer.php'); ?>

Any questions, just let us know!
« Last Edit: February 12, 2008, 05:44:22 PM by ibanezplayer85 » Logged

Refined Web Design
http://refinedwebdesign.com
wektech
Jabba the Hutt
*****
Offline Offline

Posts: 690


WWW
« Reply #10 on: February 12, 2008, 05:42:20 PM »

It is a fairly simple excersise to add php include(s) for headers, footers, and sidebars to the dreamweaver template. Then each page uses the include files. If you do not want to change the filenames to php, it is a simple task to tell your .htaccess to parse htm and html files as php.
Logged

Sage
Intergalactic Cowboy
*****
Offline Offline

Posts: 58


« Reply #11 on: February 12, 2008, 05:46:48 PM »

Perhaps you should look at the website first -- www.rhrplus.com.

Questions come to mind like, what happens to javascripts, css, etc rules if everything is converted?  What about layout.... does it get changed in anyway? I have an "index.html" and also an "index.php" for my blog -- seems as though things would start to becoming conflicted -- no? I thought php was for database use -- and, html is for texted base purposes.

Hmmm.... changing the htaccess for now seems less scary to me. What code goes into htaccess?
Logged
Ibanez Player 85
Galactic Royalty
*****
Offline Offline

Posts: 428


WWW
« Reply #12 on: February 12, 2008, 05:53:00 PM »

wektech,

You're right about that.  I didn't recommend this as it's really adding onto the complexity.  I've also personally had problems with Dreamweaver templates using PHP includes.  Many times, Dreamweaver will screw up the paths for includes on template files (if you're got your includes in a separate folder, or if you're calling the include from a file in another folder).  It's a known problem and there are workarounds, but it's a hassle for beginners.
« Last Edit: February 12, 2008, 06:00:20 PM by ibanezplayer85 » Logged

Refined Web Design
http://refinedwebdesign.com
Ibanez Player 85
Galactic Royalty
*****
Offline Offline

Posts: 428


WWW
« Reply #13 on: February 12, 2008, 05:59:24 PM »

Quote
Questions come to mind like, what happens to javascripts, css, etc rules if everything is converted?  What about layout.... does it get changed in anyway? I have an "index.html" and also an "index.php" for my blog -- seems as though things would start to becoming conflicted -- no? I thought php was for database use -- and, html is for texted base purposes.

Like I mentioned, you're really not converting anything.  You're simply changing the .HTML file extension to .PHP (just like we tested before by changing the file name to .SHTML).  This does not affect your layout, CSS, Javascript, etc. unless those files are pointing to the old .HTML file (then you just need to point it to the new file with extension .PHP).

More than likely, your index.html file and index.php file are not in the same folder.  Is this correct?  If I'm right, you should have no problem with your blog.

PHP is, in fact, used to communicate with databases, but it's also used for many other purposes. It does things that HTML cannot (just like this).  HTML is static.  PHP is a dynamic, server-side programming language that lets you do things just like this.

Nothing to be scared about Smile  Try it out on a test page first.  If it works out, implement it on all of your pages.
Logged

Refined Web Design
http://refinedwebdesign.com
Sage
Intergalactic Cowboy
*****
Offline Offline

Posts: 58


« Reply #14 on: February 12, 2008, 06:08:17 PM »

Okay, gotcha -- that makes sense. I'll try it out to see what happens and will give you feed back on things.

Many thanks for your suggestions. I look forward to moving along!  Happy Happy Joy Joy
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM