Jump to content
Peter Knight

PW Cookie Cutter

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 :)

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Good ideas and advice. Thanks.

In truth, I actually like the manual setup and the blank slate approach but sometimes it's great to have "something I prepare earlier" too :)

Share this post


Link to post
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)...

Share this post


Link to post
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

Share this post


Link to post
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.

  • Like 1

Share this post


Link to post
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

Share this post


Link to post
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...;)

Share this post


Link to post
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

Share this post


Link to post
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!

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

- install latest stable PW with a custom profile

- install modules - I usually use: AIO, CropImage, PageDelete (should really be core :), Redirects, TemplateNotes

Share this post


Link to post
Share on other sites

Interesting, I didnt know that. Doesnt seem intuative from a UX point of view but cool anyway

  • Like 1

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By alan
      Short tip
      Use the ajax powered search to find pages you want to edit—it's a super-fast way to get around the admin.
      Longer (but same) tip
      I was on the cusp of not writing this because it is likely so obvious to so many, but just in case you are like me in terms of navigation in the Admin for editing pages...
      In PW 2.4 the new search makes finding pages lightening fast. While some themes from before 2.4 was released display recently edited pages to help speed navigation, the new default theme in 2,4 doesn't; and I missed that a bit.
      But the new search is super fast so now whenever and wherever I am in the Admin, if I want to edit a page I just type in the search box, it ajax-pops, one click and I'm in the page ready to edit—no need to visit the page tree
      Thanks to Ryan and crew for this small but great advance
      OK, back to work.
    • By Vineet Sawant
      Hello,
      I've been developing sites with ProcessWire for a while now, and all those sites have been performing really well.
      It's a good enough proof that PW itself is very efficient & well performing system but I'm not sure how efficient coder I'm.
      Just wanted to learn from you guys,
      what are the things you do to keep PW's page structure clean, few good practices you follow & how do write smarter code that reduces server load, etc.
      For example, I learnt following things from tutorials that I always do for every site:
      Creating a site settings page to store all global static variables in one place such as site logo, site title etc. Using globals.inc file for regularly needed variables, functions & information Under home, creating ajax/json (locked & hidden) pages for processing forms Using tags to group fields & templates Prefixing field names with template name for easy identification Naming similar or related templates & template files with similar prefixes Thanks!
    • By demiansan
      Hello to all Processwire people, i'm from Spain, migrating from drupal to PW, looking for something less PHP memory heavy (yes, still there are servers with less than 32MB of PHP memory). And for now, quite happy with it, flexible, fast, friendly and fun.
      But one thing a did not found easily was a starting guide or something like that (till now, just discovered wiki.processwire.com), so my question is, ¿why there is no link to it in any of the main pages? and for a basic website tutorial?
      The videos are nice but they mostly show a couple of functions and characteristics.
      By no means i'm trying to rant, be picky, annoy or start a flame war; just the thought about newcomers like myself, looking into a new CMS and not finding a direct link to the wiki or basic tutorial.
      Best regards.
×
×
  • Create New...