I've been playing with PW for a couple weeks and reading through the site and watching some videos etc, but I wanted to ask a few specific things.
One thing I want to know is, what is the best way to start a completely blank project? When I unzip PW into a web folder, I spend more time renaming things, removing things, file shuffling, editing existing pieces, than if I could just start with a blank project. What is the best way to do this? Do I just empty everything from the templates folder? Not sure what is required and what is optional.
Second, I build websites in PHP/MySQL and mainly work on administrative websites, or sites that are heavily user-access controlled. That said, almost every page in my website has very different content that does not seem to lend itself to the template/pages system of PW, unless I'm doing it wrong.
For example, on one website there is a "Documents" top-level page with a few sub-pages like "Policies" and "Forms" and "Media". All the pages have their own landing page. So for example if I click Documents, it will not only show the three subpages in a submenu, but it will show a main page as well with things like statistics, recent downloads, recent updates etc. All 4 of these pages would be quite dynamically built, with information pulled from a database and assembled on the fly. How do I do this in PW?
I can write lots of PHP inside templates and do a lot of PHP/MySQL work there, but I can't do that in Pages. So I'm confused, it sounds like for my sites all my "pages" are actually templates because that is where I do a lot of dynamic PHP stuff, and then I match each template to one page to show it. This doesn't seem right.
Here is what my brain is saying should happen: I would create one single template, just one, because all the pages of my site share the same general symantic structure and main menu system, logo, header, footer, login box, search box, etc. Then I create lots of pages for each section and sub-section of the site. However, I can't do all my PHP work inside pages, I can only put basic info inside fields, which isn't even all that helpful, but seems to be the driving benefit of PW in the first place. In other words, I don't want to fill in some predefined fields for all of my pages, I need to write a crap ton of PHP code for each one of my pages. How do I do that? It seems that Pages are not actual files, but Templates are, so I can code in templates but can't code in pages. I don't know what I'm missing here.
The idea is that when a page loads such as Home->My Profile, this is where a user is logged in and goes to edit their profile. In a normal PHP project, I would log them in, and use some kind of dynamic "profile.php" file that would be included in the main template, then I would grab all the user's info from a DB and let them edit it. The profile.php page would probably call some PHP class file, use a bunch of methods and so on. In a normal PHP project, everything would start with an index.php file, which would then build the template structure, and finally include the "page" PHP file for the dynamic information that needs to be shown. I'm not sure how this structure works for PW. Do I create separate "templates" for every dynamic page on the website so that I can do PHP coding in them? If I do all my coding in the template, that what is the purpose of the page? And it's also not good to have 25 template files all duplicating basic symantic structure. I like to write DRY code so the PW template/page system is not making a lot of sense to this PHP programmer.
Where do I write my PHP code for all my pages in a PW site?
Thanks for any advice!