Write once to multiple pages
Is there some way to have a central location for the HTML code, so if I change the menu in one spot it propagates down to all pages without having to copy and paste the new menu set up on each and every page of the website?
You need to change your page to either .php or .asp (depending on your server type) rather than .htm/.html and create a new page file in which you place all the code for the menu - for the sake of argument let's say you name that page mainmenu.php
Then on the main pages you replace what you had in place for the menu with the following (in the case of php)
<?php include("mainmenu.php"); ?>
Now, when you update the page mainmenu.php all pages that include it will update from the one page. Here's more info which may help you https://css-tricks.com/snippets/php/php-include/
Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.