Log in

View Full Version : help



histing
10-23-2018, 01:34 AM
how can i make it so that all i have to do is edit one page & the menus on both sides of each of my pages changes? because addind 1 affiliate means i have to go through every page on my site, is there a way i can change it so all i have 2 do is change 1 page? (the web host won't let me use phtml or shtml)

styxlawyer
10-23-2018, 09:17 AM
You could do it by running a JavaScript program inside your page but using either PHP or shtml is the best way to do this.

Your best option is to change your hosting company to one that will allow either PHP or shtml.

If you do want to use JavaScript & jQuery then it is probably best to look at this page (https://stackoverflow.com/questions/39447411/how-to-load-nav-menu-from-an-external-file-no-wamp-all-code-must-be-browser).

molendijk
10-23-2018, 12:18 PM
There are many ways to do it. Here's one method that doesn't rely on any library. Put your menu in an external file, for example menu.html, then on the page where you want to include the external file (=menu.html) put:
<div>
<iframe src="menu.html" style="width:0; height:0; border:0; opacity: 0; " onload="this.parentNode.innerHTML=this.contentWindow.document.documentElement.innerHTML"></iframe>
</div>
The CSS and javascript that make the menu work must be put in the main file.

Important:
With certain browsers, this does not work on your hard disk. But on the Internet it works everywhere.