|
|
Post a Project »
Find a Professional HTML Freelancer!
Find a Freelancer to help you with your HTML projects
| |
|
Is there a way to automatically update all pages...
11-24-2006, 10:50 AM
|
Is there a way to automatically update all pages...
|
Posts: 45
Name: Julie
|
Is there a way to automatically update all pages with, say, copyright info by using CSS? I mean, can you put it somewhere and then it will change for every page if you change just that one file?
Thanks!
Jules
|
|
|
|
11-24-2006, 12:27 PM
|
Re: Is there a way to automatically update all pages...
|
Posts: 5,935
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
|
Through CSS? Yes, but not in the way you're thinking. You'd have to save your copyright info as an image, and then have that image loaded as a background image through CSS. That way, to change the copyright info, you edit the image.
But that...that's a silly way to do it.
Your best angle is to learn a server-side programming language (ASP, PHP, even SHTML in this case will do) and have it stored in an include file. An include file is called up from within another file and included as part of that file. In effect, the include file (or portions of it, depending on how you create and play with it) is called and merged with the other file, making one file. It's a totally transparent process to the end user.
Include files are your friend. Use your friend. Abuse your friend. Smack your friend around with a wet noodle and teach him what's right and wrong.
|
|
|
|
11-24-2006, 12:50 PM
|
Re: Is there a way to automatically update all pages...
|
Posts: 1,611
Name: Michael (mik) Land
Location: England
|
You could cheat by using content: ""; in CSS to edit the copyright holder, etc to get it to work. However this would muck-up when styles are disabled.
I agree with ADAM though, you're best going for server-side scripting.
__________________
Please login or register to view this content. Registration is FREE - Tumblog with thoughts, quotes, links, videos, images and my creations.
Please login or register to view this content. Registration is FREE - The best free web browser.
Please login or register to view this content. Registration is FREE - Firefox is now Firefail.
|
|
|
|
11-24-2006, 03:09 PM
|
Re: Is there a way to automatically update all pages...
|
Posts: 45
Name: Julie
|
Awesome info Adam and 'Moo'! Php scripting was next on my list to "learn" (going to be doing a forum)...glad to know there is a way to do it when I get to that point.
Quote:
|
Include files are your friend. Use your friend. Abuse your friend. Smack your friend around with a wet noodle and teach him what's right and wrong.
|
And I'm gonna have fun doing it!  -  -  !!
Thanks so much,
Jules
|
|
|
|
11-24-2006, 03:11 PM
|
Re: Is there a way to automatically update all pages...
|
Posts: 1,611
Name: Michael (mik) Land
Location: England
|
Doing a forum?! As in you are wanting to make one from scratch or as in use a pre-made one? If you're wanting to make from scratch, I suggest you give it a couple of years of experience with PHP/MySQL before attempting it.
I love the idea of abusing PHP...
__________________
Please login or register to view this content. Registration is FREE - Tumblog with thoughts, quotes, links, videos, images and my creations.
Please login or register to view this content. Registration is FREE - The best free web browser.
Please login or register to view this content. Registration is FREE - Firefox is now Firefail.
|
|
|
|
11-24-2006, 03:56 PM
|
Re: Is there a way to automatically update all pages...
|
Posts: 6,521
Name: Dan
Location: Swindon
|
Why does everyone go for a more complicated method. why not just save your copyright info in a javascript file?
just have somin like the one i use:
Code:
<!-- Begin
copyright=new Date();
update=copyright.getFullYear();
document.write("© Copyright 2005-"+ update + " Dan's Galaxy / Dan. All rights reserved.");
// End -->
(alter the text to fit your site)
all u have to do is save the above code as a seperate .js file and the add
Code:
<script language="JavaScript" type="text/javascript" src="NAMEOFFILE.js"></script>
and it will insert a copyright thing with the date current wherever u insert the javascript tag thing.
hope this helps
|
|
|
|
11-24-2006, 04:08 PM
|
Re: Is there a way to automatically update all pages...
|
Posts: 1,611
Name: Michael (mik) Land
Location: England
|
Because not every browser supports/has it enabled (javascript).
And php would be even simpler.
PHP Code:
<?php include('./page.html'); ?>
The only issue being that not every server supports PHP.
__________________
Please login or register to view this content. Registration is FREE - Tumblog with thoughts, quotes, links, videos, images and my creations.
Please login or register to view this content. Registration is FREE - The best free web browser.
Please login or register to view this content. Registration is FREE - Firefox is now Firefail.
Last edited by Mooofasa; 11-24-2006 at 04:10 PM..
|
|
|
|
11-24-2006, 08:25 PM
|
Re: Is there a way to automatically update all pages...
|
Posts: 59
Name: Jaryth
Location: Canada
|
hmm.. I can think of a bad way of doing it... And I would advise against it...
(And it falls into the hole thing that not every browser supports it and all but still...)
Create a page. As single page. With JUST the info that you wan to be able to change...
Then on all of the other pages, create an Iframe linking to the content...
Then, when the 'copyright.html' (or whatever page you want) is changed, it will update for the hole site...
This is just one way of doing it, and NOT the best way.
Code:
<IFRAME WIDTH="200" FRAMEBORDER="0" HEIGHT="100px" src="copyright.html" name="about"></iframe>
Change that to whatever your information is.
__________________
Please login or register to view this content. Registration is FREE My personal website
-Jaryth (UID590)
Last edited by Jaryth000; 11-24-2006 at 08:29 PM..
|
|
|
|
11-24-2006, 08:59 PM
|
Re: Is there a way to automatically update all pages...
|
Posts: 45
Name: Julie
|
Mooofasa wrote:
Quote:
|
Doing a forum?! As in you are wanting to make one from scratch or as in use a pre-made one? If you're wanting to make from scratch, I suggest you give it a couple of years of experience with PHP/MySQL before attempting it.
|
Oh Mooofasa, I am going to use phpBB/pre-made, but am/will customize it to my liking; I don't have two years to learn php/MySQL. I have been checking out vBulletin, too. I do have a "dummy" forum setup and have set up the administrative end of it and created topics, etc. So, not totally going in blind on this. I just don't know the coding behind it all.
So, that short little code you wrote:
Quote:
|
<?php include('./page.html'); ?>
|
is all I need to put in a file?? In the CSS file or where, if I might be so bold to ask?  My server supports php...
Image, javascript, Iframe...oh my!
I do have some javacript embedded in my main page now, but don't like to use a lot of it because not all browsers/users support/have it.
Using an image could be do-able.
Iframe I know absolutely nothing about.
Thanks again you guys for helping out this newbie!
Jules
|
|
|
|
11-24-2006, 11:49 PM
|
Re: Is there a way to automatically update all pages...
|
Posts: 64
Name: Timothy Nerbonne
|
Quote:
Originally Posted by Mooofasa
Because not every browser supports/has it enabled (javascript).
And php would be even simpler.
PHP Code:
<?php include('./page.html'); ?>
The only issue being that not every server supports PHP.
|
So your saying that if I make a page called index.php and then put your above code in it, that it will write the contents of page.html once I load index.php?
|
|
|
|
11-25-2006, 04:11 AM
|
Re: Is there a way to automatically update all pages...
|
Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
|
Yes (providing your host server supports php of course)
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
|
|
|
|
11-25-2006, 04:59 AM
|
Re: Is there a way to automatically update all pages...
|
Posts: 1,611
Name: Michael (mik) Land
Location: England
|
Quote:
Originally Posted by Jules
Mooofasa wrote:
Oh Mooofasa, I am going to use phpBB/pre-made, but am/will customize it to my liking; I don't have two years to learn php/MySQL. I have been checking out vBulletin, too. I do have a "dummy" forum setup and have set up the administrative end of it and created topics, etc. So, not totally going in blind on this. I just don't know the coding behind it all.
So, that short little code you wrote: is all I need to put in a file?? In the CSS file or where, if I might be so bold to ask?  My server supports php...
Image, javascript, Iframe...oh my!
I do have some javacript embedded in my main page now, but don't like to use a lot of it because not all browsers/users support/have it.
Using an image could be do-able.
Iframe I know absolutely nothing about.
Thanks again you guys for helping out this newbie!
Jules
|
Right, you could put it in the CSS, but that would be pointless unless the CSS appeared between the <head></head> tags of your HTML. This is because files with the extension .css aren't usually parsed by the PHP engine.
If you can use PHPBB on your site, then it is PHP enabled (as well as MySQL) as PHPBB was developed using PHP (hence the PHP bit).
Here's an example of how to use the include() function (php).
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title>Site Title</title>
<link rel="stylesheet" type="text/css" title="default stylesheet" href="/mystyle.css" />
</head>
<body>
<h1>Site Name</h1>
<p>Some content...</p>
<?php include('copyright.html'); ?>
Where you see <?php include('copyright.html'); ?>, simply replace copyright.html with the actual file and path to your copyright part.
Here is an example of the copyright.html file:
HTML Code:
<hr />
<p>Copyright© You 2006. All Rights Reserved.</p>
</body>
</html>
When the browser loads your page (the main one), the copyright.html will automatically be put into the original file. And will look like the below.
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
<title>Site Title</title>
<link rel="stylesheet" type="text/css" title="default stylesheet" href="/mystyle.css" />
</head>
<body>
<h1>Site Name</h1>
<p>Some content...</p>
<hr />
<p>Copyright© You 2006. All Rights Reserved.</p>
</body>
</html>
Play about with the include() function. There is a similar PHP function called required(). This will stop the page from loading and produce an error automatically when the file you want to be included isn't found.
I suggest that you read up on at least the basics of HTML/CSS/PHP to get a good feel of how things work.
Iframe (<iframe>) is simply a frame but with the advantage(?) that it can be placed anywhere and be any size, not taking up the whole of the segment of page. However, iframes are nasty when styles are turned off and server no real great purpose. Whoever invented them needs to be shot  .
__________________
Please login or register to view this content. Registration is FREE - Tumblog with thoughts, quotes, links, videos, images and my creations.
Please login or register to view this content. Registration is FREE - The best free web browser.
Please login or register to view this content. Registration is FREE - Firefox is now Firefail.
Last edited by Mooofasa; 11-25-2006 at 05:02 AM..
|
|
|
|
11-25-2006, 10:41 AM
|
Re: Is there a way to automatically update all pages...
|
Posts: 45
Name: Julie
|
Mooofasa wrote:
Quote:
|
I suggest that you read up on at least the basics of HTML/CSS/PHP to get a good feel of how things work.
|
I have the basics (and a bit more) of HTML/XHTML/CSS down, but php is a whole new "language" for me. Can you recommend any books on php? I have the book 'Building Online Communities with phpBB 2', but there isn't much in the way of teaching coding in the book; what is there pertains to Forums.
Thank you for the coding that you gave me, I will mess around with this to see if I can figure it out ~ it sounds pretty straight-forward. Awesome ~ you rock!
Hey, if you want to see a site that I am working on (the first one in about 10 years!) you can go to www.whollycat.com ~ all I have is the main page there and it is in progress, especially the footer area (and that is my web addy, not the sites web addy). Most of the links do work, and will go to the Holisticat site, but those pages are not re-designed yet. My coding needs to be cleaned up, and I haven't validated it because I have quite a ways to go. Your (and others') comments would be appreciated...I have only tested it in Firefox and IE, but will test in others and other versions before I upload it to Holisticat.
Again, thank you very much for your help!
Jules
|
|
|
|
11-25-2006, 01:45 PM
|
Re: Is there a way to automatically update all pages...
|
Posts: 1,611
Name: Michael (mik) Land
Location: England
|
I haven't used any books to build up my knowledge, I simply used the beginner tutorials at Zend.. I've just built up my knowledge and application from that (and from learning VisualBasic6 at college which are similar).
I couldn't recommend any book seeing as though I haven't used one, sorry.
I suggest you head on over to Website Review and Suggestions forum, where I'll happily provide feedback and suggestions on your site.
__________________
Please login or register to view this content. Registration is FREE - Tumblog with thoughts, quotes, links, videos, images and my creations.
Please login or register to view this content. Registration is FREE - The best free web browser.
Please login or register to view this content. Registration is FREE - Firefox is now Firefail.
|
|
|
|
11-25-2006, 02:17 PM
|
Re: Is there a way to automatically update all pages...
|
Posts: 45
Name: Julie
|
Quote:
|
I haven't used any books to build up my knowledge, I simply used the beginner tutorials at Zend.. I've just built up my knowledge and application from that (and from learning VisualBasic6 at college which are similar).
|
Woohoo ~ what a great site! Thank you so much for this, Mik!
Quote:
|
I suggest you head on over to Website Review and Suggestions forum, where I'll happily provide feedback and suggestions on your site.
|
I figured this was an "oops" when I put that there ~ sorry about that. I will move it to the other forum.
Thanks again ~ too bad ya can only do 1 talkupation, cuz you would be getting raves from me,
Jules
|
|
|
|
11-25-2006, 02:23 PM
|
Re: Is there a way to automatically update all pages...
|
Posts: 1,611
Name: Michael (mik) Land
Location: England
|
Quote:
Originally Posted by Jules
I figured this was an "oops" when I put that there ~ sorry about that. I will move it to the other forum.
Thanks again ~ too bad ya can only do 1 talkupation, cuz you would be getting raves from me,
Jules
|
You'll get more responses on your website if it's in the right place, that's all. No real problems caused by not doing it.
I enjoy helping others, especially those that I were in the same position as not so long ago.
__________________
Please login or register to view this content. Registration is FREE - Tumblog with thoughts, quotes, links, videos, images and my creations.
Please login or register to view this content. Registration is FREE - The best free web browser.
Please login or register to view this content. Registration is FREE - Firefox is now Firefail.
|
|
|
|
11-25-2006, 05:35 PM
|
Re: Is there a way to automatically update all pages...
|
Posts: 45
Name: Julie
|
Quote:
|
You'll get more responses on your website if it's in the right place, that's all. No real problems caused by not doing it.
|
Aw, thanks, Mooosafa!
I am working on my 3 site reviews...fun!
Jules
|
|
|
|
11-25-2006, 07:12 PM
|
Re: Is there a way to automatically update all pages...
|
Posts: 313
Name: Dustin
Location: GA
|
There are lots of good tutorials out there for PHP and Mooofasa's way of doing the copywrite is definate the best. Include files are great especially when doing a large site for mine I have 4 files for every page a header, content, footer, and a CSS file and it works great so the body of my pages are made up something like this...
header.inc
HTML Code:
<html>
<head> <title> using include files </title> </head>
<body>
<div id="maincontent">
footer.inc
HTML Code:
</div>
<div id="navbar">
<a href="http://www.google.com>google</a>
<a href="http://www.yahoo.com">yahoo</a>
</navbar>
<div align="center"> Copywrite 2007 </div>
</body>
</html>
style.css
HTML Code:
.navbar {
width: 20%;
left: 0px;
}
.content {
left: 20%;
width: 80%;
}
index.php
HTML Code:
<? include("./header.inc"); ?>
Here is the main body of my page that will be in the conent area
<? include("./footer.inc"); ?>
something like that would cover all basis you've got a navbar that now can be changed by just updating one file and it's updated across your site same with the copywrite.
.nav
|
|
|
|
11-25-2006, 07:19 PM
|
Re: Is there a way to automatically update all pages...
|
Posts: 45
Name: Julie
|
Awesome info! Thank you very much!
I will be living at the php site that Mooosafa so kindly provided...
Jules
|
|
|
|
11-25-2006, 08:45 PM
|
Re: Is there a way to automatically update all pages...
|
Posts: 1,611
Name: Michael (mik) Land
Location: England
|
ASP is just as effective as PHP. It all depends on which one you feel more comfortable with.
Code:
<!--#include file="somefile.html"-->
Works just the same as PHP.
__________________
Please login or register to view this content. Registration is FREE - Tumblog with thoughts, quotes, links, videos, images and my creations.
Please login or register to view this content. Registration is FREE - The best free web browser.
Please login or register to view this content. Registration is FREE - Firefox is now Firefail.
|
|
|
|
|
« Reply to Is there a way to automatically update all pages...
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|