How to create a "template" for pages?

Asked

Viewed 1,024 times

0

I am new in website development, programming, etc., my beach is Design, but I would like to know how you do when you need to repeat some layout in all pages of the website.

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

inserir a descrição da imagem aqui

  • Only using pure HTML (without js or server side) is not reusable. Now with js or some server side link is easy, give a read on the topic that Bacco passed that has several tips.

  • @Neuberoliveira Believe me, I took a look. I’m not using any server side, only pure HTML. In this case the reuse is called "include"?

2 answers

0

I don’t know anything about PHP, but I’ve read a little bit about reusing parts of the sites on other pages.

A site is divided into Top, Top and Bottom. The most repeating parts across the page are the top and bottom.

Then the developers separate the code from a part that will repeat itself during all the pages and put in another file. They include with <?php include('includes/topo.php');?>

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

0

That is a very comprehensive question! There are several ways.

In PHP, ASP, C# and other languages:

  • Criar Includes
  • Loading via ajax

in javascript frameworks:

  • Angular
  • Ionic
  • Laravel

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.