Forum Moderators: open

Message Too Old, No Replies

Add one line on all 200 pages

Do I have to edit each site individually?

         

websiteguy

10:20 pm on Feb 13, 2006 (gmt 0)

10+ Year Member



I currently need to add one line of text above some ads that are running on my site. I have 200 seperate pages on my site. Am I going to need to edit each individual page or is there some short cut that can save me hours of boring work and allow me to add it to all the pages at once? Thanks for your help.

FrostyMug

10:26 pm on Feb 13, 2006 (gmt 0)

10+ Year Member



site-wide replace if you have the same piece of code in all of them, i.e. </body> etc. or add an include file now and save more pain later.

Hester

9:36 am on Feb 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use PHP.

mattglet

5:38 pm on Feb 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use PHP.

Use anything that supports Server Side Includes.

rocknbil

7:07 pm on Feb 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Server side programming is overkill on a goverment-managed level for what you need to do, especially if it's not something you need to do frquently. SSI is a wasted suggestion because you'd have to edit all the files anyway to put the <!-- #include --> line on every page, and probably have to rename all the files or change the server config.

If you have Macromedia Homesite, it will rip through thousands of files and traverse subdirectories in a matter of 10-20 seconds on a Find-Replace function.

If you have command-line access and it's Linux, you can do many things directly from there, or indeed a perl script executed on command line can do this (again, overkill if you don't know perl.)

There are other search and replace programs out there, and this has been asked after many times on this forum, do a search for them for some suggestions.

mattglet

8:52 pm on Feb 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



especially if it's not something you need to do frquently

The problem with this is that you never know the next time you have to make a change. I'm sure the OP didn't think of the consquences of this after he made 200 pages of static content.

While IDEs have good find/replace methods these days, you absolutely can't discount the flexibility (and possible future necessity) of SSIs.

g1smd

9:04 pm on Feb 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Go with the includes, and for PHP includes you do NOT have to rename the pages. A server setting can see .html named pages as being parsed for their PHP content.

If you ever need to change what is being included again, then the next edit will be to simply change the one thing that is included, not the 200 places that it is mentioned.

Moosetick

9:18 pm on Feb 14, 2006 (gmt 0)

10+ Year Member



This looks like a job made for PERL. You can get PERL for free and it is fairly easy to use. It is made for text manipulation.

As others have said, I would use an include. Then you could add or remove text more easily in the future.

mattglet

10:44 pm on Feb 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A server setting can see .html named pages as being parsed for their PHP content.

Again, you don't NEED PHP for this ;) You can map any extension to any parser (for example, you can map it so that ASP uses it).

Just making sure things are clear, and that you PHP guys don't convert the whole world that easily ;)

g1smd

11:21 pm on Feb 14, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>> You can map any extension to any parser <<

Look closely. That is what I said.

lmfzor

7:51 am on Feb 23, 2006 (gmt 0)

10+ Year Member



hello Websiteguy

There was this old HOTDOG HTML editor that has the
changing for multiple files function in a folder
(and subfolders) without openning
[sausage.com...]

There is also the Crimson Editor that can be freely downloaded from [crimsoneditor.com...]

It has the 2 remarkable function
- "Find in Files" (finds all files in a folder
containing the search string )

: this is painfull - open all files by clicking
all lines on the search results

- "Replace in All Open Files" (replaces the string
to another string in
all opened files)

/LMFZOR

wmuser

4:42 pm on Feb 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You may wish to use php includes on the code in order to change something once and have sitewide effect
Also there are a number of scripts to perform the same update on all files on the same server
Switching to a content management software is also the way out

Sabie

8:57 pm on Feb 24, 2006 (gmt 0)

10+ Year Member



I have php includes in my nested templates and they work well. Worth the intial setup.