Change 20 HTML files at once?

Discussion in 'HTML & Website Design' started by Teunel, Aug 21, 2007.

  1. #1
    Hi,

    I had a website for about 3 years, which has been really popular the last weeks. I want to expand this by adding a forum. I only have one problem:

    All my files are plain HTML files, and if I want to add a menu, I have to edit all the files manually.

    I don't have the time to change it all to includes, because this website doesn't interest me anymore. (But because this niche is very popular at once, I want to get a little revenue from it).

    Is it possible to search trough all the files, and add the code automatic to all the files? (Or, replace all the words "guestbook.html" with "forum.html"?)

    Thanks!
     
    Teunel, Aug 21, 2007 IP
  2. Lethal7

    Lethal7 Active Member

    Messages:
    2,262
    Likes Received:
    56
    Best Answers:
    0
    Trophy Points:
    90
    #2
    in dream weaver there is an option called replace but you can only do one page at a time.

    it basically says replace "..." for this ".." you write in what you want and it does it on the whole page. might help you out a little..
     
    Lethal7, Aug 21, 2007 IP
  3. Teunel

    Teunel Guest

    Messages:
    246
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes, I thought about that too, but it may be easier to replace it all with one click.
     
    Teunel, Aug 21, 2007 IP
  4. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #4
    You can use a product called multi-replace to replace a given phrase or word for another in a batch of files. Takes only a few seconds.
     
    Colbyt, Aug 21, 2007 IP
  5. Teunel

    Teunel Guest

    Messages:
    246
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thank you very much! That was exactly what I was looking for! :D
     
    Teunel, Aug 21, 2007 IP
  6. Kuldeep1952

    Kuldeep1952 Active Member

    Messages:
    290
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    60
    #6
    Another Program which does this is Note Tab, which we have used in the past for HTML editing. They have a Free version also. It can also do search and replace in opened files, or from disk.
     
    Kuldeep1952, Aug 21, 2007 IP
  7. Cypherus

    Cypherus Peon

    Messages:
    1,551
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You could probally just hire some freelance kid here on DP to do it for a couple of bucks, to re-code it... Sound easier in the long run.
     
    Cypherus, Aug 21, 2007 IP
  8. flippers.be

    flippers.be Peon

    Messages:
    432
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    gsar.exe also finds and replaces strings in multiple files..
     
    flippers.be, Aug 21, 2007 IP
  9. shotazi

    shotazi Peon

    Messages:
    422
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #9
    the bes way is to make php site buy some CMS or free CMS and make your site with this CMS then you will make evrythng very easily everything and you will do this only once.
     
    shotazi, Aug 21, 2007 IP
  10. sogastic

    sogastic Peon

    Messages:
    202
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Well Dreamweaver can be used for this. You choose the folder where all the files are and then choose "Replace all".
     
    sogastic, Aug 21, 2007 IP
  11. moonty

    moonty Peon

    Messages:
    63
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Or if you set your files as a site in dreamweaver you get more powerful replace options as well as templates which help manage static html files.

    Josh
     
    moonty, Aug 21, 2007 IP
  12. twistedspikes

    twistedspikes Notable Member

    Messages:
    5,694
    Likes Received:
    293
    Best Answers:
    0
    Trophy Points:
    280
    #12
    dreamweaver find and replace. Replace all. Set it to do it for open files (just make sure you have all 20 files open...)
     
    twistedspikes, Aug 21, 2007 IP
  13. Teunel

    Teunel Guest

    Messages:
    246
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Ah, I didn't knew Dreamweaver could do this too! Thanks all!
     
    Teunel, Aug 21, 2007 IP
  14. thehen

    thehen Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    If you manage your sites correctly in Dreamweaver you can 'search and replace' 'current local site'. I do this instead of dynamic content management.

    You could also use dreamweaver templates to begin with, then when you change one thing on the original template it changes the whole local site.
     
    thehen, Aug 22, 2007 IP
  15. flippers.be

    flippers.be Peon

    Messages:
    432
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Does anyone know if there's a more advanced tool to move content from one site to another using a template ?

    I was thinking of making it myself if it doesn't exist, as html files can be parsed as they're xml files.

    What I need is: for all pages I select from my existing site, content will be extraced and put in a new template.. but with the option to specify what you want to copy in what way.
    Ie copy title and meta tags.. then what's in the 'maintext' div in the old page, should be copied into the 'mainbox' div in the new template.. and similar copy events. So the content from one layout with specific div/span classes can be converted quickly into a new layout with other named div's.

    And if something like this doesn't exist, how many could use it ?
     
    flippers.be, Aug 24, 2007 IP
  16. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #16
    I dunno if there's any point to mentioning this, but for anyone who write their html pages in vi or emacs or any of those sorts of text editors, you can also use grep and sed commands to find and change the text. I suppose to do all files at once, you could append all the files one right after the other onto one file, then later take them back apart...

    For flippers: Funny, one could do this in CSS. That is, copy the html, changing the way the page looks with CSS (using the same classes and id's that are in the html files). Anyway, I thought you meant something like www.csszengarden.com where the content stays the same but people everywhere copy the html and apply their own design templates to it (the CSS Hen Garden is hilarious).
     
    Stomme poes, Aug 24, 2007 IP
  17. flippers.be

    flippers.be Peon

    Messages:
    432
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #17
    stommepoes (leuke nick trouwens): I know, but that's only possible but if the htmlpage itself stays the same.

    On my site the whole html structure became totally different, new div's where added, some divs like the menu got totally new content.
    But the main text and titles stayed the same so could be automatically copied from the old pages into the new template.
     
    flippers.be, Aug 24, 2007 IP
  18. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #18
    dank je... I thought the name suited me well, esp when I was beginning with HTML and CSS.

    So you want selected parts of your html file copied, then given a new template on top of that. I'd still use text editor commands to do that, using grep to search for example "div id="nameofid" and copying until it encounters "</div>" or so (maybe with comments after so that it stops copying at
     </div> <!--nameofid div-->
    Code (markup):
    in case there were other </div>s within the div you want to copy, but that would require you to have already put such markers in your html file)...

    If there's a graphical version or Dreamweaver-style extension, I dunno if it exists but if it doesn't, it could be popular with webmasters of multiple, similar sites (for instance people who make sites for companies like Coca Cola where every country gets its own, different page, with text often being the same). You're thinking of making such a thing?

    But the class and id names stay the same, right? For instance, if the menu was <ul class="menu"...> then regardless of what content changed, you could still change the design with a new css file.

    I guess another option is to keep a copy of the original html file somewhere, so that whatever changes you made are only on the current site and you can always go back and copy stuff from the original. Possibly any software that would do this for you would always keep an html.orig file somewhere.
     
    Stomme poes, Aug 24, 2007 IP
  19. jac4593

    jac4593 Peon

    Messages:
    202
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #19
    Why not use PHP's post get echo? Thats what i use to change my footer everytime i get a new link exchange and it changes on every page instantly.
     
    jac4593, Aug 24, 2007 IP
  20. just-4-teens

    just-4-teens Peon

    Messages:
    3,967
    Likes Received:
    168
    Best Answers:
    0
    Trophy Points:
    0
    #20
    i think you could make use of this > http://www.rjlsoftware.com/software/utility/search/

     
    just-4-teens, Aug 24, 2007 IP