1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Editing Multiple HTML Pages at Once?

Discussion in 'HTML & Website Design' started by m1ndless, Nov 25, 2010.

  1. #1
    I am modifying a template, is there a simple way to edit all files at once, for example I am changing out all my header links, so it requires modifying every html page I have so far.
    SEMrush
    Any simple ways to do this, besides copy/paste?
     
    m1ndless, Nov 25, 2010 IP
    SEMrush
  2. GWiz

    GWiz Peon

    Messages:
    359
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If the header is exactly the same across all the pages. You can use "Search and Replace" for all open documents (This feature is in Dreamweaver, but I am sure you can find other tools such as Notepad++ that do the same thing).

    The other option, which would require you to convert your pages to PHP which allow you to use includes. For example, on all your content pages where you want the header to appear, you would use:

    <?php include('header.php') ?>
    PHP:
    Make sure the file that contains this code has a .php extension. Meaning if you are placing that code inside your index.html file, rename the file to index.php otherwise it won't read the php code. This method is good because now you only have to modify header.php and it will show the same result across all your pages.
     
    GWiz, Nov 25, 2010 IP
  3. infoman66

    infoman66 Peon

    Messages:
    58
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This is a general problem when using html pages ...
    Any change you have to perform individually on each page ...
    I think that there is no support in the traditional way ...
    Or to convert your pages to php, as GWiz says, and include custom header, footer etc...
     
    infoman66, Nov 26, 2010 IP
  4. CSM

    CSM Active Member

    Messages:
    1,047
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    55
    #4
    Notepad++ can handle that on all opened pages.
     
    CSM, Nov 26, 2010 IP
  5. rmcs0426

    rmcs0426 Peon

    Messages:
    118
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you use EditPad Pro you can use the Search and replace option for all then you can do all at once.
     
    rmcs0426, Nov 26, 2010 IP
  6. m1ndless

    m1ndless Peon

    Messages:
    1,112
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thank you, I am going to try the search and replace option. The header is the same on all 100 html pages.
     
    m1ndless, Nov 27, 2010 IP
  7. suzyjews

    suzyjews Member

    Messages:
    55
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    43
    #7
    The PHP solution above will work. But dont foget depending on how you have things setup you will prob have to add

    <?php include('header.php') ?>
    <?php include('footer.php') ?>

    to all 100 pages and then save these pages from html to php files. You should be comfortable with PHP and relative paths to us this solution.

    Alternative option if your using Dreamweaver is to create one template page and base all your pages on this one template. When you make any changes to the original template Dreamweaver will update all 100 pages based on this template.

    For example if you make a change to an option in your menu this change will then be reflected across all 100 pages automatically.
     
    suzyjews, Nov 28, 2010 IP
  8. Buax

    Buax Peon

    Messages:
    266
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I use Notepad++, which allows you to open different file types within tabs, but if I were you, I'd of written a header.php/footer.php/sidebar.php/navagation.php files when I first built the site. :)
     
    Buax, Nov 28, 2010 IP
  9. v3t0

    v3t0 Member

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #9
    change all your .html file into .php file..then create file name header.php and put your header code inside the file..

    php is the way to solve the problem BUT you still need to open all your html file to put the php include code in every file..still pain for the first time..but next time, just change the code in the header.php

    thanks,
     
    v3t0, Nov 28, 2010 IP
  10. ronc0011

    ronc0011 Peon

    Messages:
    85
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    This is one of the things I love about ASP. ASP uses "Master Pages". Master pages allows you to have a single page that has the design structure i.e. layout, graphics, menu, etc. where you can make changes to that single page and they are carried across every page in the site. Then all of your content pages are inserted into the master page upon rendering.
     
    ronc0011, Nov 28, 2010 IP
  11. WebPageMistakes

    WebPageMistakes Active Member

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    60
    #11
    You can use the PHP includes idea mentioned a couple of times in this thread but you do not have to save all your files as PHP to get it to work. You put an instruction in your .htaccess file telling the server to parse PHP as HTML. (desilva.biz/php/phpinhtml.html) You will not see the included parts when viewing the page locally from the copy on your computer but it will work on the web server if you have the path to the include correct. Create a test folder on the web server to try it out before going live.

    Changing all your pages to use a different extension (e.g. php) will have a devistating result in the search engines. You will have to start over unless you use a 301 permanent redirect telling the search bots that the pages now have a different extension. Changing the extension will also mess up your incoming links if you don't use 301 permanent redirect.
     
    WebPageMistakes, Nov 28, 2010 IP
  12. omeslawanya

    omeslawanya Peon

    Messages:
    69
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    yes you can edit heder file and its call on theas per like page <?php include 'db.php'; ?>
     
    omeslawanya, Aug 29, 2011 IP
  13. omeslawanya

    omeslawanya Peon

    Messages:
    69
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    yes you can edit heder file and its call on theas per like page <?php include ('db.php'); ?>
     
    omeslawanya, Aug 29, 2011 IP
  14. technoamarie1

    technoamarie1 Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I suggest using NOTEPAD++, its good for editing codes..
     
    technoamarie1, Sep 28, 2011 IP
  15. mmerlinn

    mmerlinn Prominent Member

    Messages:
    2,640
    Likes Received:
    543
    Best Answers:
    6
    Trophy Points:
    320
    #15
    If the only language you know is HTML, then another solution, but usually NOT a good solution, is to use frames. In most cases I would not recommend frames, but in certain rare circumstances they will work fine.
     
    mmerlinn, Sep 29, 2011 IP
  16. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #16
    This is easy. Just open emacs and...oh...wait...
    This is easy. Using 'sed', just....oh...wait...

    I forgot. You guys are Windows users. You don't have good tools like *nix has.
     
    drhowarddrfine, Sep 29, 2011 IP
  17. eddie43302

    eddie43302 Well-Known Member

    Messages:
    1,125
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    160
    #17
    Easy fix for html header and footer use this code and make a seperate header and footer page with just the header and footer code and put this in each's place <!--#include virtual="header.shtml"--> then you will have 1000's of pages pointing to one file and only have to do edit one page.. but the kicker is first you will have to change the code on all pages one last time. Also can be done with sidebar. Example site that i created for a dog rescue footer,sidebar and header all use this option can be seen at www.asaprescue dot org
     
    Last edited: Sep 29, 2011
    eddie43302, Sep 29, 2011 IP