HI What's the fastest way to add pages to a static html website? If I am building a 100-page website using Nvu, how to effectively add page 85 and at the same time all other pages will have page 85 on it. Do I have to do it manually to every page? That would it a long time? Is there anyway around it? Pls advise! Thanks
That is one of the downsides to static web sites. Creating the new page would have to be all manual but adding that link on all your other pages (assuming they all have the same basic format) can be done with one click of a button. Many text editors out there will allow you to do a massive search and replace on multiple files. Just find where you want your new link, and place it on all your pages. To help keep the code down, you can create a php or even javascript headers, sidebars, and footers so that all changes to all pages in those areas are all controlled by one file. Your site is still static but uses "dynamic" sidebars and so forth.
That's what I'm saying... If I built page 10, I would need to manually add page 10 to page 1, page2, page 3..etc . What you said sounds like a good solution to me though I'm not sure what it is. How do I add this function? Where can I find info about this . Thanks
what you want to do is create a header or footer or whatever, a file containing all the links to all the pages and than include it in every page. this way, whenever you add a new page you just add the new link to the header file and it will show up on every page that includes the header.. etc.. http://www.boutell.com/newfaq/creating/include.html this is a random page i just found dealing with server side includes
Or use a php system such as were it outputs the links like: index.php?page=home All you need to do this is to add the following code to the content area in your index.php file. And then to create a new page you just need to create a document with JUST the content in it and call it "Pagename.php": Code: <?php $page = $_GET['page']; if($page){ $site = file_exists($page.'.php') ? $page.'.php' : 'error.php'; } else{ $site = 'home.php'; // default site } include($site); ?> PHP: So all the links, images and everything are in the index.php file and all content is in the pagename.php file. Note: home.php is the home page error.php is the error page (404 Not Found)
Generally you would use a template system to do what you require and therefore the links etc all exist within a single file so after adding a new page you only have one page to update. PHP does this via includes or .Net will allow you to do it using the .Master file etc. Taken to the next level of cause is using a CMS system where the seperate page does not technically exist but are all run from a database so "adding a page" will simultaniously add the content of the new page and add the link to the template.
Create a template and do it manually... copy/paste the template and rename for every page and edit the content... no software could do this fast if it is on static html pages...
Wouldnt do Silveraden's suggestion as this means that if you ever change your template you have to change every single page where as other's suggestions keeps the template and content seperate so changing the template for the whole site requires only one file to be changed.
Use a program with "Find/replace in all files" Find: <a href="page84.htm">Page 84</a> Replace with: <a href="page84.htm">Page 84</a> <a href="page85.htm">Page 85</a> Change as necessary. Seriously though, you should use server side scripting as everyone has been suggesting. The above technique could also be useful to replacing your static menu with a call to the include file, e.g. <?php include 'menu.php'; ?> Still far from an ideal system but should be fine for your needs.