cssabc123 Posted September 28, 2015 Share Posted September 28, 2015 Why the header and footer comes after body when rendered? (Planets Tutorial). The planets who are using the planet.php template are children of a page Planets which is based on basic-page.php template. The About page children pages works fine though. site/templates/planet.php <html> <head> <title><?php echo $page->title; ?></title> </head> <body> <h1><?php echo $page->title; ?></h1> <h2> Type: <?php echo $page->planet_type; ?>, Age: <?php echo $page->planet_age; ?> years </h2> <p><?php echo $page->planet_summary; ?></p> </body></html> Link to comment Share on other sites More sharing options...
Christophe Posted September 29, 2015 Share Posted September 29, 2015 Are you using "includes"? Have you, for example, put this part in the header?: <html> <head> <title><?php echo $page->title; ?></title> </head> <body> And this part in the footer?: </body></html> Please give more details about your approach, your structure(, the profile you use as a basis), etc. 1 Link to comment Share on other sites More sharing options...
cssabc123 Posted September 29, 2015 Author Share Posted September 29, 2015 No I'm not using includes at this time, I'm just following the tutorial and I'm on page 4 (http://processwire.com/docs/tutorials/hello-worlds/page4) when I get this output. Link to comment Share on other sites More sharing options...
mr-fan Posted September 29, 2015 Share Posted September 29, 2015 Please give more details about your approach, your structure(, the profile you use as a basis), etc. let me add some more information you could provide as there was... PW version, screenshots of your template settings. but christophe has wrote the right and important hint already... What profile you used as start for the tutorial? If you get header and footer rendered you should check the settings for prepending and apending templates or includes....so check if you have a _init.php or something else in your profile. For a beginner it could be very strange to get started in face of the many many many options you can take. If you are getting more familiar with the system and find your own way to use templates and site profiles you will love the given freedom. Like in many other topics wrote a: Site profile is only the place to play for your own frontend. Template "files" in the profile are only showing content or data in the way you build it (html,css,json,file,everything you want) Templates itself - with or even without a file (for special contenttype or backend only content...) are a kind of building your content and data model for different needs, you have the power to give them the fields you need, you could connect templates(contenttypes) with Pagefields (example template autor is connected with a pagefield to every article this autor wrotes), you could setup the given fields with various field dependencies, using hooks and much more to get what is needed or should be the final result. Pages are every piece of data, object and could represent every type of content you "preset" with given fields and settings on the used template... Best place to read for beginners is a great writeup for beginners on every important topic....the footer/header includes, too it's a big topic from pwired but it helped me very very much at the starting questions....so take a good read on this. What helped me very fast to get started on the template/field/page thing are some couple of videos, too. Best regards mr-fan 3 Link to comment Share on other sites More sharing options...
pwired Posted September 29, 2015 Share Posted September 29, 2015 https://processwire.com/docs/tutorials/how-to-structure-your-template-files/page3 https://processwire.com/api/templates/ 2 Link to comment Share on other sites More sharing options...
cssabc123 Posted September 29, 2015 Author Share Posted September 29, 2015 Thanks for the input everyone, big help. I just found softacolous from my webhost provides different structure from what I can download from processwire.com. Link to comment Share on other sites More sharing options...
pwired Posted September 29, 2015 Share Posted September 29, 2015 I just found softacolous from my webhost provides different structure from what I can download from processwire.com. Don't use any script or structure from softacolous. All you need is the webspace from your hoster. Make sure you delete any welcome html/ php file and scripts from your hoster. If you see any default .htaccess file open it first to see any hosting restrictions/configurations from their side. Then delete the .htaccess file also. So when you have empty webspace then upload the processwire files and install processwire. If this is not what it is about in your case then post some more information to help you out. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now