English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Hey everyone. I have been searching and searching the web for this.

When news breaks, CNN places a red alert banner on the top of every page. I know they do it somehow from one exteral file using CSS or XML, then it pops up on every page, because they can't go to every single pages and update it, etc.. How would I do that? Does anyone know how CNN and all them other news sites do it?

I know the same concept would be the same for a navigational menu on my web site. If I ever need to add or delete something, I can't go to every single page, especially if it has hundreds of pages. If anyone could even direct me to a web site with specific intructions, etc. that would be great. Thanks for your help!!

2007-05-08 02:04:22 · 6 answers · asked by Sam B 1 in Computers & Internet Programming & Design

6 answers

If you were to use PHP, it would be as easy as this:

1) Cut and paste the navigation menu into an external file, called navigation.php.

2) In the original file, in the space where the menu once was, view source and write

Then, whenever you wanted to tweak the navigation file, you would only change navigation.php, and the change would be reflected across all pages with the include code in, as, it's including this file into the page.

There are many, many other ways of doing things like this with other languages etc.

XML is just a text file that looks roughly like this:






It is used to store information, and that's it.

A CSS file looks like this:

.bluetext
{
color: blue;
}

It is a file that stores layout and visual data relating to the tags/code in a html file.

I suggest visiting these guys http://www.w3schools.com/ and reading through to see the differences in the technologies. If you want to do the funky 'dynamic' stuff like includes, databases, stuff that makes pages look different at runtime etc, you should do a tutorial on PHP.

Good luck.

2007-05-08 03:03:26 · answer #1 · answered by midsojo 4 · 0 1

With an advanced text-editor program, it is easy to modify text every place it appears in a web site, even it it's on every page and there are thousands of pages. Look for a feature called something like multi-file search and replace.

It is possible to do this kind of thing with PHP, dynamic HTML, etc., but if you do it that way you should really take a couple of weeks to test it to make sure it works reliably, and it sounds like you are trying to save time. Multi-file search and replace takes only a minute or so if you have a fast computer or only a few hundred pages on the site.

2007-05-08 03:13:55 · answer #2 · answered by ra 3 · 0 1

there are a few ways to do it.
1 a lot of find and replaces. this is the idiot's method.
2 external css, and script links in the head of each html. this is the textbook recommendation.
3 content management, by removing the content from the presentation and applying it at the last minute (or when the info is changed), you get automation. This is how the Big Dogs do it!

Even the little guy can get to level 3 with xsl as at http://worldofwarcraft.com where the scripts and css are not mentioned in the code for each page.

2007-05-08 05:32:53 · answer #3 · answered by Anonymous · 2 0

There are certain things you can do with CSS stylesheets, and there are certain things you can. If you point all your pages to a particular CSS template then yes, you can make changes to that template alone and it will show up on every page. How effective this is depends on exactly what changes you want to make. You can try this site for more information - http://www.w3schools.com/css/default.asp. They have the most detailed CSS tutorial that I've come across online.

2007-05-08 02:19:26 · answer #4 · answered by NNP 2 · 0 1

CSS is only used for layout and design (changing the color or font of a whole site). New content (the banner) is generally added using a scripting language such as PHP or ASP.

A good PHP tutorial can be found here:

http://www.w3schools.com/php/default.asp

2007-05-08 02:21:02 · answer #5 · answered by Kenneth 3 · 1 1

With css it could be as simple as, in each page's display file place:


Latest news!!!



...then in external css place

#urgent { display: none; }
#urgent h1 { color: #f00; }

...and when an urgent headline breaks, all they'd have to do is change the "display: none;" to "display: block;"

...is that, what you're asking?

2007-05-08 05:26:21 · answer #6 · answered by fjpoblam 7 · 0 1

fedest.com, questions and answers