Jump to content

New site project mechanics?


PhotoWebMax
 Share

Recommended Posts

Hi All,

Been away from my learning for a few days. I am about to begin my next local project: redoing an existing client MODx site (education foundation) with ProcessWire. There is no rush but hopefully the new PW site will go live in a couple of weeks or so.

I was just wondering how you guys begin a project. You create the database, install PW, and then what?

What are the common first habits you begin almost every general PW site with? Do you install specific Modules, plugins and helper items? Do you add a commonly used folder of base template files: CSS, scripts and images? Do you create any base template code system? How do you handle includes files? Do you maintain a PW & PHP code clip file/folder for commonly used site elements? How about any answers to questions I am not listing here?

I am really interested in the approaches you might have that streamline the process with site development in general and with PW specifically. 

Thanks!

Max

Link to comment
Share on other sites

Nothing wrong with asking, but the scope of your question here makes it difficult to answer in sensible timeframe. There's also a lot of valuable content floating around here that already answers different parts of your question, but I'm assuming you've browsed through those, considering that you even started a thread about that.

Something you said in that thread made me cringe a bit, though: "I need to chat less and read more".

As I've been repeatedly told, we all learn in different ways, but IMHO you need to read less and do more. As they say, "the best way to improve at building software is to build software", and that applies to sites too. Build a couple of sites of your own and you'll have a lot better idea about what works for you.. and what doesn't.

Nevertheless, this is an interesting subject, so I'll start by trying to answer your questions briefly based on my typical process:

  • I don't "create a database and install PW", I've got a script for that. Repetitive tasks are boring and automating them is fun.
  • I use a previously created site as my starting point. This base site includes common templates, template files organised exactly as I like (something derived from Zend Framework file structure and an implementation of the front controller pattern), various include files (functions.php with common and usually render-related functions etc.) and modules I often end up installing.
  • I don't know what a "base template code system" is, but if you're talking about template engines (Twig, Smarty etc.) the answer is "never". Those things are are horrible and wrong. If you're referring to something like partials (as in "not full template files but files you'll include within your template files") and helper functions, then yes -- both are useful in their own ways.
  • The projects we've built before are my "code clip folder".

I could go on and on about this and probably will at some point post something about the directory structure, template logic etc. but don't really have time for that now. If you'd like to know something more specific, please don't hesitate to ask.

You'll definitely get more (and more helpful) answers if you limit the scope of your questions a bit.. though don't be offended if people point you to existing threads either, as that's just the way things work around here. In some ways this forum serves as our collective data bank and the more discussions about same subject are grouped together the easier it is to dig into that subject later :)

  • Like 10
Link to comment
Share on other sites

I don't "create a database and install PW", I've got a script for that.

Interesting, would you mind telling what script language you use for that, windows or php ?

I use autohotkey and purebasic a lot to make online work easier.

Those things are horrible and wrong.

What´s wrong with smarty template engine ? I think it´s good.

http://www.smarty.net/why_use

Link to comment
Share on other sites

......What´s wrong with smarty template engine ? I think it´s good.

http://www.smarty.net/why_use

Good for? Why add another language on top of an already existing capable language (PHP?)...Yes, I know I used MODx and its templating language and loved it..but that was before I decided to take the plunge and learn PHP.......Anyway, this is like mermite...some people love smarty and similar while others don't. I like Ryan's summary here: http://processwire.com/api/why-php-syntax/. If you know PHP I suggest to forget template engines like smarty. They are just another layer of complexity you don't need...

  • Like 6
Link to comment
Share on other sites

I start with a piece of paper and draw out the site.

Then I work out what templates and fields I need

Then I work out what framework (or none) that I will use.

After that, I install PW with either a blank profile or something useful I might have kicking around and start creating fields, creating blank template files and whatever templates are on my list.

By that point the site is really half created - I just need to make it play nice!

  • Like 4
Link to comment
Share on other sites

Interesting, would you mind telling what script language you use for that, windows or php ?

I use autohotkey and purebasic a lot to make online work easier.

Bash, mostly :)

What´s wrong with smarty template engine ? I think it´s good.

http://www.smarty.net/why_use

Kongondo explained the main reasons already and the rest was pretty much summed up by Paul M. Jones in his 2008 blog post titled "Another Smarty Emigrant":

You may have heard that you need to keep your PHP and HTML separated, but that’s not quite the case. Instead, what you need is to keep your "business logic" separate from your "presentation logic", and that’s a different thing entirely.

Thus, all that’s required is a way to keep your views and controllers separated, and perhaps provide helpers for common view tasks. Then you can use plain PHP in your view scripts (templates), without needing a whole new language.

To be fair templating engines do have valid use cases, but those are almost entirely related to keeping things secure if you need to allow external or otherwise untrusted users (however limited) access to your codebase.

  • Like 2
Link to comment
Share on other sites

To be fair templating engines do have valid use cases, but those are almost entirely related to keeping things secure if you need to allow external or otherwise untrusted users (however limited) access to your codebase.

Not needed in PW so leave them out of the way :)

Outside PW, though, Savant looks interesting since it also uses pure PHP http://phpsavant.com/

--

Edit: :D :D just realised that Savant was first written by the guy that wrote that article you linked to. 

  • Like 4
Link to comment
Share on other sites

Hi Max,

I'm still making my way around PW so I'm nowhere near a power user, but here's my process for now:

1. First plan the site out and try to get a conceptual idea of what its components will be - templates, users, user roles, custom functions, modules, etc.

2. I'm not a front end dev, so I get a design done and coded into HTML/CSS for me, or I purchase one, or a client hands me one.

3. Create the database and install PW on a staging server

4. Create a template and page with fields just for the site configuration stuff - site name, site slogan (if needed), admin email, etc. and other things that the site owner might want to edit later from one central place.

5. Create the fields, templates, user roles, etc that I came up with in the planning stage, install modules

6. Port in the HTML/CSS, create pages, get the basic site skeleton done.  I have a cheat sheet I'm slowly creating for myself as well as a collection of code snippets I reuse from project to project to make my work faster (because I understand things better when I simplify them for myself) and these help me to port templates into PW fast.

7. After I've done the simple template porting in I then code in any custom functions I need that I planned out before.

8. Fix any glitches

I then test the site and move it from staging to production.

This varies from project to project and sometimes I do things completely differently but this is my general process. Hope this helps somewhat

  • Like 5
Link to comment
Share on other sites

I was round at my mother's house earlier in the week and needed to make some notes, so I used her old "portable" manual typewriter.

I had forgotten how much fun it is to use - how tactile and complete.

One of the problems with modern tech is that despite being hugely quicker, it does not have the tactile immediacy or reactiveness off a pen and paper or typewriter or coloured pastels and so on. There is something about not having a delete key and having to put lines through mistakes or rub things out that can really help the creative process.

And I see little point in trying to recreate that using computers - it already exists. We just need to remember to use it.

  • Like 2
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...