0

Is there a way I can change code in multiple static HTML files? I just added two new pages to the site, and the side bar containing links to all the pages need to be updated in all files. Is there a easy way to do it? Thank you very much.

Update: Also the side bar has an active row, which should be different in each file, is there a easy way to change that in each file as well?

Anton
  • 559
  • 2
  • 15

3 Answers3

1

notepad ++ allows you to search and replace and also has a reg-ex search and replace function you can use to replace all or replace via file extensions

vico
  • 2,152
  • 2
  • 17
  • 38
0

Microsoft Visual Studio Express can find and replace in files.

But maybe it's time to refactor your pages and put the common information in a distinct file.

Steve Wellens
  • 20,506
  • 2
  • 28
  • 69
0

The question you are asking has two good answers.

The first simple answer for your level of HTML knowledge would be to use a text-editors Find & Replace functionality to simply change identical pieces of code so all pages match. This would be the simplest answer for your question.

The larger answer would be to introduce you to the idea of a layout file. With this layout file(s) you could define your entire page layout, links, headers, etc. Then with each page you load you simply call the content you want to show inside the layout file. This is a high level concept and should ultimately be your goal to reduce issues like those which you stated in your question.

You can accomplish this with a variety of technologies such as PHP, ASP.Net, or Java EE development which are all very advanced stacks. The best starting point I would suggest is Server Side Includes. This will allow you to simply call the required layout text. While this solution is rather legacy; it might help you accomplish your task with grater efficiency.

JeffreDodd
  • 244
  • 5
  • 12