-
CSS question.
I use Kompozer and ready made free template for my website. I have made few changes to CSS file for the general look of the site. I think it looks OK. Happy with it.
If I want to change some name of the menu link on the left hand side or change the description of the site on top of the page I still manually need to change this page by page.
What do I need to do to be able to do this automatically?
If you need to see the site.
www.ayvalikholidayhouse.com
PS, I am not sure if I am allowed to put above link here. Moderator, please remove it if it is necessary.
-
You can change the words shown with out changing the link and it will go to the same page.
Example: but not the complete line.
a href="map.html">Location
that can be changed to:
a href="map.html">Where we are at on the map
A ref address does not need changing as that is the name of the page.
I know of not automated way of changing all the page. Just have to do it manually myself.
-
CSS can change style attributes globally, but to change text, that it can't do.
-
Ohh that is very disappointing. So, argument sake, if I want to change the name of a particular link on the navigation menu, I have to change 36 pages manually. I wonder how webmasters change LARGE websites...must be a nightmare!!!
Thank you anyway chaps.
-
Yes, and that is one reason we make sure things are aceptable the first time.
We can go through and make all changes in all of our pages. Then upload them. Just as long as the a ref is not renamed or changed all will be OK.
-
You need server side scripting for this. For example PHP. If your webhost supports PHP, email and ask, you can create a file that contains a certain part of the website. you can create many of these files and on each webpage you just "include" the files. basically including a file means it gets the contents of the file and adds it to the page. so if you wanted to change a certain aspect you would just change it in the "links" file for example, and on every page that includes the "links" file, it will appear as changed.
If you're not bored already read the next post for an example :)
-
Well...that's very interesting, I'd love to find out more about it. I think I should start Googling. Thank you.
-
I have 5 web pages. page1.html, page2.html etc
I create a file called "header.html" which contains all of my header html, ie
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Ayvalik Holiday House to let</title>
</head>
I then create another file called footer.html which contains all footer html, ie
Code:
<p align="center">Footer</p>
</body>
</html>
Now in each of page1.html, page2.html etc instead of writing the 2 bits of code in the examples in every page i would just type at the top of the source code
PHP Code:
<?PHP
include("header.html");
?>
and at the bottom
PHP Code:
<?PHP
include("footer.html");
?>
Now change the file extension on your webpages to .php. The source for the actual files will read
Code:
<?PHP
include("header.html");
?>
Blah blah blah blah
<?PHP
include("footer.html");
?>
But when it is run through the webserver, ie when someone goes to www.blah.com, page1.php will read
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Ayvalik Holiday House to let</title>
</head>
Blah blah blah blah
<p align="center">Footer</p>
</body>
</html>
As long as you include the header and footer files in all 5 pages they will appear as they are layed out in the header and footer files. so if you change the title in the header.html file, all 5 webpages will appear to have had the title modified even though you are only changing 1 file
It's not just headers and footers that you can include. Anything on your page can be "included". Links, Title images, this paragraph here can be included if it was to appear on several pages just in case i made a spelling error.
Let me know how it goes :D
-
BIG THANK YOU themanwhowas.
Now it is a great project for me to work on...I'll let you know the result.
Thank you again.
-
Most large sites would just use a serverside include file. You create one file with your nav in it, then just include via php or SSI
<!--#include virtual="/nav.htm"-->
-
After having your opinions and advice I got the basic idea how to go about it. Being relatively a novice over this matter I decided to Google the subject hoping that I could find some sort of step by step instructions.
Came across below two articles. If you have time, would you terribly mind if you have a quick look at them and see which is the one you may approve?
From time to time, I only would like to be able to edit contents of meta name="description", "navcontainer" and "sideBarNewsContent".
http://www.webdevlounge.com/articles...tatic-content/
http://www.handyphp.com/index.php/PH...PHP-Basic.html
-
Well the 2nd link does'nt mention anything about includes so that won't help you.
The first website looks ok, however:
Instead of include("blah.txt") the examples use require("blah.txt"). Both include and require work exactly the same way. The only difference is that if for some reason the php failed to run properly on the server(you know like sometimes you load a webpage and an image isn't loaded and you have to reload the page), include would carry on loading the rest of the page while require would stop at the failure. For your needs i would use include instead of require.
Incidentally, meta tags are ignored by most bots including googlebot. A lot of people don't bother using them anymore
-
Try this 1st.
http://en.wikipedia.org/wiki/Server_Side_Includes
If you can't get that to work, use PHP include. Odds are your host supports PHP. Most do.