What To Do As Your Website Gets Bigger

by Neil S
7 replies
  • WEB DESIGN
  • |
One big problem with expanding websites is that when you make a change to the navigation bar, you then have to change the bar on every single web page.

For smaller sites this isn't a big deal. But as your site gets larger it can be quite a pain in the neck. Is there anyway to change the navigation bar for all pages automatically in HTML?


Thanks!
#bigger #website
  • Profile picture of the author yogurt
    Use a good text editor for to search and replace certain portion of your HTML codes and plain text content. An even better alternative, without the need to open individual files in text editor, is to use text search and replace utilities. Here are some useful links:

    Search and Replace for Windows - Funduc Software
    Free Text Search and Replace Utilities (thefreecountry.com)

    Hope you find them useful
    {{ DiscussionBoard.errors[698034].message }}
  • Profile picture of the author Aronya
    I like to use php includes. One line inserted into each page will point to a file (where you create your navigation), and that file is then included in the resulting web page. One change to that file, and it's changed across all pages in your site.
    {{ DiscussionBoard.errors[698368].message }}
    • Profile picture of the author Neil S
      Originally Posted by Aronya View Post

      I like to use php includes. One line inserted into each page will point to a file (where you create your navigation), and that file is then included in the resulting web page. One change to that file, and it's changed across all pages in your site.
      Would I have to re-write all the code in PHP or is that a small edit I can make in the HTML?
      {{ DiscussionBoard.errors[698541].message }}
  • Profile picture of the author Aronya
    It's pretty small, relatively speaking. It's easier to implement if you use it from the beginning, but not hard. Google it & you should be able to find examples pretty easily.

    What you WILL have to do is recreate your navigation bar. If you're using a table, it's copy & paste. Make a copy of you existing page before you start making changes.

    Save the new navigation file (with the only code being the table - no <html>, <body> or other tags) as a .htm file. Then you should be able to replace that code with the include statement. It will look something like this:
    <?php include('/nav.htm'); ?>

    Save your page as whatever.php. It will be a little work up front if you're going to have to replace existing code in multiple pages, but it's a lot less work in the long run. Once you get the hang of it, you'll start to look for ways to modularize your pages with this technique, and it can make life much simpler.

    HTH,
    Tim
    {{ DiscussionBoard.errors[698750].message }}
  • Profile picture of the author mywebwork
    In your situation with an existing HTML site a PHP include is the best way to go.

    If you were starting from scratch you would be wise to use WordPress, Joomla or some other CMS. It makes it much easier to expand when the site needs to grow.

    Bill
    {{ DiscussionBoard.errors[699319].message }}
    • Profile picture of the author Neil S
      Originally Posted by mywebwork View Post

      In your situation with an existing HTML site a PHP include is the best way to go.

      If you were starting from scratch you would be wise to use WordPress, Joomla or some other CMS. It makes it much easier to expand when the site needs to grow.

      Bill

      Do you know if XsitePro has any kind of feature that helps with this?
      {{ DiscussionBoard.errors[699373].message }}
      • Profile picture of the author mywebwork
        Originally Posted by Neil S View Post

        Do you know if XsitePro has any kind of feature that helps with this?
        Hi Neil

        As far as I can tell it doesn't have any features to allow you to turn your site into a WordPress template, which is what you would need to do to convert to WordPress.

        If you decide to split the site and use include tags I'd use a good text editor that is "HTML aware" like PS Pad

        editor PSPad - freeware HTML editor, PHP editor, XHTML, JavaScript, ASP, Perl, C, HEX editor

        Take the original HTML and split the header, footer, menu bars, opt-in boxes and other common elements into separate files, save them with a .inc or .php extension. Then use a PHP Include statement to "include" the files where they are needed.

        PHP: include - Manual

        Again, in the future I'd strongly recommend WordPress or Joomla to create a site that can be infinitely expanded with minimal effort. If your host includes a CPanel with Fantastico you can get this setup in literally a few seconds, even a manual installation just takes a few minutes. In the long run it will be worth it.

        Software like XSitePro is still useful for simple squeeze pages.

        Bill
        {{ DiscussionBoard.errors[699466].message }}

Trending Topics