How to create a "template" for pages? [duplicate]

0

I'm new to site development, programming, etc., my beach is Design, but I'd like to know how you do when you need to repeat some layout on all pages of the site.

  

For example: I need to repeat this menu on every page of the site. I   I copy his HTML and paste it on every page I need? Or is there another way   practice?

    
asked by anonymous 07.02.2017 / 18:21

2 answers

0

I do not know anything about PHP , but I've read a bit about reusing parts of the sites on other pages.

A site is divided into Top, core and footer. The parts that repeat the most on the page are the top and the bottom.

So the developers separate the code from a part that will repeat itself over all the pages and put it in another file. They include% w / w%

To do this you will have to rename your main .html file to .php and separate that sidebar as above. If you follow this path you will also have to use an apache server.

    
07.02.2017 / 22:40
0

That's a very comprehensive question! There are several ways.

In PHP, ASP, C # and other languages:

  • Create Includes
  • Loading via ajax

in javascript frameworks:

  • Angular
  • Ionic
  • Laravel

You can all work with templates. It is not possible to detail much, because it is too extensive the subject, but if you search for templates in these frameworks on youtube you will find a lot of cool stuff.

    
07.02.2017 / 23:04