Jump to content

Process Wire file structure


Simon Love
 Share

Recommended Posts

Hi

I've just installed the blank option and I've been examining the file structure with a reverse engineering mindset trying to understand why things are like they are. I notice the home.php uses the php include tag to load basic-page.php

My question is this - Is it necessary to do things this way as per so called best practices? Will PW not function correctly if I did it another way like for example using index.php instead of home.php and having no include tags? is this the best way to do things for a typical multi page php website using includes?

Any advice greatly appreciated.

Simon

Link to comment
Share on other sites

The only thing necessary is that you have files `/site/template/{template_name}.php`. Most templates use php files of the same name as the template, but you can also use an "alternative name" you can set for certain templates. The latter is certainly less common though.

What you do after that is 100% up to you, which is a boon as well as a pain at the same time. It's nice to not be prescribed how to do things, but it's bad to not have a fixed structure as each project may very well be build differently.

Link to comment
Share on other sites

Well said, @LostKobrakai, things getting even more complicate for "beginners" when it comes to the various output strategies, only few are mentioned here:

https://processwire.com/docs/front-end/output/

I'd probably recommend to jump into the tutorials and create some pages/templates to find out what fits your individual needs and requirements:

https://processwire.com/docs/tutorials/

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...