Jump to content

PW Cookie Cutter


Peter Knight
 Share

Recommended Posts

Anyytime I start a new PW project, I have a very repetitive process to setup the base folder with assets, database and modules.

The design of new sites is something I like to keep bespoke but the following can probably be streamlined a bit

  • download modules (config, formbuilder, listerpro, upgrade, profields etc)
  • create folders for CSS frameworks, Jquery scripts, 
  • create includes (header, footer, navigation

I'm decided to create a base prototype folder and database with the essential assets.  I can cookie-cutter this rapidly and duplicate it as the basis for new projects.

Just curious about other peoples process for spinning out a new PW project. Some of you probably use task runners or Git etc? It's an area I need to explore.

Cheers :)

Link to comment
Share on other sites

I do always start from a blank state as I'm not using any frameworks consistently throughout multiple frameworks. But siteprofiles are an easy way to save an own baseline, which can be installed by pw, so no copy pasting and replacing things in the database by hand.

  • Like 1
Link to comment
Share on other sites

For shure not the best way - but i'm no pro who work on projects every day....so it works good for me and my skills.

got a local installation with uptodate core + my standard modules + german language files at one place

1. install new blank pw installation

2. copy and paste the /site/modules/ and /site/templates/ folder

3. install all new modules + language

4. if needed import special content from my local repository with https://github.com/adrianbj/ProcessMigrator (like site-settings-page, fields/templates for a imagegallery and so on)

5. ready to work on the new page

as you can see not really fancy not really streamlined but for a one man show with less projects it did the job.

  • Like 3
Link to comment
Share on other sites

I do always start from a blank state as I'm not using any frameworks consistently throughout multiple frameworks. But siteprofiles are an easy way to save an own baseline, which can be installed by pw, so no copy pasting and replacing things in the database by hand.

the main time siteprofiles don't fit complete on every project....so this could be not the best thing to setup content faster...

with PW a website is more like crafting a concept than install only a software.

With ProcessMigrator you could choose a Page (with children) and get all relevant fields and template on import/export so you can reuse special content better than the whole siteprofile.

  • Like 1
Link to comment
Share on other sites

for this special kind ProcessMigrator is the right tool for you - check it out - it is great!! ;)

and build in import/export of fields and templates is also not bad for quick transfers of a setup (for eg. a slider pagetable/repeater or such stuff)...

Link to comment
Share on other sites

the main time siteprofiles don't fit complete on every project....so this could be not the best thing to setup content faster...

with PW a website is more like crafting a concept than install only a software.

He means this, which will potentially be a quicker way I think of what you are describing with your process: http://modules.processwire.com/modules/process-export-profile/

So set up a new install with "basic business site features" and export that as a site profile, then when you do a new site requiring simmilar features, upload a fresh copy of PW to a server, copy your exported profile before installation and it should (I think) appear during the installer as an option :)

  • Like 1
Link to comment
Share on other sites

The other tool to add to your belt is ModulesMigrator: https://processwire.com/talk/topic/8410-modules-migratorinstaller/

It will install, configure settings, and update to the latest versions all modules that you have selected. I have tagged it as alpha, but mostly because I haven't had any feedback on it. Maybe if this brings it back to life and I get some reports on it, I can get it released - it really is pretty straight-forward.

  • Like 5
Link to comment
Share on other sites

yes tried that workflow, too - but exact like you wrote it only works on simliar sites with similar features...for separate features Migrator do a better job.

It always depend on the sort of sites you build or on the specific project.

For me as PW beginner i've learned a lot between my first project last year and now - so i only could use some parts of my former websites...;)

Link to comment
Share on other sites

We're using a pretty opinionated yeoman generator somewhat similar (but different... i.e. no coffescript :) ) to the one from fixate. It's more or less like fireshell. The generator pulls a fresh copy of processwire + evergreen modules, sets up the directory structures, downloads npm & bower modules and creates basic templates + includes that we need for most of our projects. For the database part we're currently planig to integrate wireshell as soon as it leaves the beta status.

  • Like 4
Link to comment
Share on other sites

At the moment, the sites I build with PW can be quite different and front-end approach seems to evolve all the time. I build professionally and personally/for fun, and I mostly do projects the same way.

I typically start with the latest dev branch, blank/default profile, install at least AIOM, and possibly CroppableImage if images are a main focus for the site.

Then I'll typically look at how I structured the most recent couple of projects. I'll borrow most of the _init.php code, nav/general helper code, and the base HTML structure for the _main.php template. I'm up and running fairly quickly and ready to start front-end, or delve into template & field setup.

It works OK for me, and is probably more efficient than me getting a profile "just right" that I could start from. And then there's keeping that up-to-date with the latest PW dev, modules, and any useful reusable code developed per-project - I don't think I would personally gain anything from doing that!

Link to comment
Share on other sites

This is the organization we've put in place at work. The structure is pretty much fixed now, we're still grabbing parts of things we like elsewhere. It's basically a bootstrap kit. Workflow goes at this :

1) clone latest pw and setup project with https://github.com/plauclair/pwscripts

2) clone our site profile

3) remove extra, configure grid or else from less mixins, select which layout to use and import html presets that match these

4) marvel at all the time saved

5) code

6) ??

7) happy customers, happy devs!

templates/
|-- styles/
|   |-- styles.less                 // general styles, calls parts in inc/
|   |-- styles.css                  // compiled from styles.less
|   |-- inc/
|   |   |-- layout-one-pager.less   // standard layouts
|   |   |-- layout-standard.less
|   |   |-- content.less            // regular h1, p, ul, etc..
|   |   |-- template-name.less      // each template has its own less file
|   |   |-- template-...less
|   |   |-- vendor/                 // decoupled parts from different frameworks
|   |       |-- bootstrap/
|   |           |-- grid.less       // decoupled grid system, generator w settings
|   |-- images/                     // images called from css
|
|
|-- scripts/
|   |-- main.js                     // main js stuff for global things
|   |-- vendor/
|       |-- vendor-name/
|           |-- files...
|
|
|— inc/                            // php includes, has ready-made classes like a recursive menu generator and other helpers
|-- views, controllers, classes, etc../     // depends on the project's complexity
|
|-- _header.php | _init.php         // config->prepend
|-- template-name.php               // typical PW template files
|-- template-...php
  • Like 4
Link to comment
Share on other sites

Just to echo what's already been said, the site profile option works great. I have my own "blank slate" profile, which really just has a few baseline things setup.

Based on the popularity of this, it's probably a great starting point.

Link to comment
Share on other sites

 Share

×
×
  • Create New...