Thursday 23 February 2012

Geek time!: Starting off with Drupal

This is a blog to just point you in the right direction when it comes to developing sites with Drupal.
If you've heard about Drupal you'll have probably heard there is a steep learning curve, but that it is ultimately worth the effort. I think I'm about half way up the curve now, and am starting to see what people are talking about. Thought I'd just note a few things that threw me, and a couple of pointers and the like. I apologise for the structure and flow of what your are about to read...

Here's a little list of the steps I took learning Drupal, they've worked for me: 
  • Set up a XAMPP test server (other servers are available) 
  • Install Drupal 6 (or 7, look into what modules are available, they're not all there for 7 yet)
  • Don't worry too much about Theming yet, it's hard and you won't know how to do it until you realise how the site functions, so...
  • Create some nonsense content
  • Mess around breaking things 
  • Move things about
  • Install lots of modules
  • Mess about and break it some more
THEN
  • Start to read up about it
  • Watch some youtube videos
  • Mess around some more while reading and watching youtube videos (some great youtube videos out there, and can be great for learning fast)
Once you've done this, have a day off, go for a walk, eat some exotic foods, just do something non-drupal. 

First stumbling block (that's a pun, which you might not appreciate, which makes it an even better pun) is getting your head around the terminology and architecture of Drupal. I won't go mad, you're probably busy, just a couple of bits of infomation...

Some terminology:
  • Content Types
    • These are what define your content. So if you list bands, then you might have a band content type called Band that has available fields for Band Name, Genre, bio etc. A bit like classes in C# (other languages are available)
  • Content
    • This is what happens when you fill in the form that the content type creates, so you enter a Band Name, a Genre and a Bio, you save it, and you have a Band.
  • Blocks
    • Now, I thought blocks were used to place your content, like a Band on the page. Not quite true, it's more for the things like Header, Footer, Sidebar etc. You can place blocks in these predefined areas.. So you might make a menu that lists the bands youve created and put that in the header area. When it comes to viewing the content you've created, then you use Panels and views etc. Anyway, like i say, mess around and watch videos.
  • Modules
    • Modules add the functionality you need to your site, the UI, admin, database, search and so one. If Drupal was Microsoft Word, then you  might start with being only able to have12pt Font and a white page you can type on. If you want to delete, then you download a module called "delete" and enable it, now you can delete. You'd do this for different fonts, the ability to add headers and footers etc........ I think that analogy works. Anyway, there are loads of modules, look out for how they are maintained, "actively maintained" is the best. If they're not, then there's probably another module that does the same thing but better (not always true)
    • To install a module, download it (choose the one that corresponds to your version of Drupal), unzip it and upload it to sites/all/modules, navigate to site building > modules, find your new module and enable it. It'll then usually show up somewhere in the menu system (check documentation to find it).
The community is your friend, and Drupal has a very large community of developers and users, all blogging and using forums. Look for the ones that deal with the specifics of your problems, they are the best, general ones like this are just rubbish. 

Check out the Drupal Documentation...

Here's some more practical advice for starting off:
Get your filing right, don't put the modules you download in the root modules folder, but them in sites/all/modules (create this if not there). Basically, if you don't, then updating is much harder, and you're not supposed to "hack the core", they get really irate about that on forums. The same goes for themes you add or create, put them in sites/all/themes. 

Some modules to find out about first, you'll most likely need them:
  • CCK
    • So you can make add what ever you like to you content types
  • Views
    • So you can bring together, relate and list the content you make
  • Panels
    • So you can layout your content however you like.
Obviously there are lots more modules, and modules that extend the ones above, but these are very powerful and you should really have them in you configuration.

Oh, If you think you know the way to do something, it's probably not the best way, there's probably a better way of doing it, and you'll feel a fool, a FOOL when you realise.

Anyway, this might not have been useful. But it's a start, I'll post some more about this in the future, once I have my head around it a bit more. Just remember, don't worry, it is quite hard, and I feel your pain. 

M


No comments:

Post a Comment