page pour vérifier le titre, body, ect

When we want to utilize the convenience of direct output, but don't want to repeat the same markup in every template file, we move the code that we want to re-use into separate files. That way we can have multiple template files that pull in the same bits of code without us having to repeat ourselves. The benefit is that if we need to change something, we only need to change it in one place rather than in all of our template files.

To get started, lets figure out the parts of our basic-page.php template file that we want to re-use in other template files. In this case, we know that the markup at the top of all our template files will be the same, so lets move that to a _head.php file (or whatever you want to name it). We'll use the underscore prefix on that filename just to clarify that it is a file meant to be included in others, rather than a dedicated template file. While this is not required, it's a common convention and recommended primarily because it enables both you and ProcessWire to differentiate template files from include files.

/site/templates/_head.php

<html>
  <head>
    <title><?php echo $page->title; ?></title>
  </head>
  <body>
    <h1><?php echo $page->title; ?></h1>

We also know that the markup at the end of all our template files will be the same, so we'll move that markup into a _foot.php file:

/site/templates/_foot.php

</body>
</html>

Where the template files will vary is what's in-between the _head.php and _foot.php. So we'll use our basic-page.php template file to do the following, in this order: