This tutorial plays on the 'hello world' phrase and lists information about planets in the solar system, starting with Earth. To keep it simple, we'll assume that the basic site profile is installed, as that's what comes with ProcessWire (so there's no need to uninstall anything). But we won't start using any of it's files at this stage. Instead, we'll start out by creating our own files.
After completing this tutorial you will have learned how to create and work with templates, fields, pages, and how to output dynamic data via your templates.
Step 1 – Create a template file
Create a new file called: /site/templates/planet.php, and copy+paste the following HTML into that file:
<html> <head> <title>Earth</title> </head> <body> <h1>Earth</h1> <h2>Type: Happy planet, Age: Millions of years</h2> <p>Earth (or the Earth) is the third planet from the Sun, and the densest and fifth-largest of the eight planets in the Solar System. It is also the largest of the Solar System's four terrestrial planets. It is sometimes referred to as the World, the Blue Planet, or by its Latin name, Terra.</p> </body> </html>
The above is just a plain HTML file with nothing specific to ProcessWire. We will use this as the starting point for our template, and we'll go back and modify it later.
Next: Create a Template and a Page »
- Introduction and First Steps
- Create a Template and a Page
- Setting up Custom Fields
- The Template File
- More Pages
Your e-mail is kept confidential and not included with your comment. Website is optional.