Getting started with Drupal 7

2 minutters læsning

Recently I have been investigating Drupal - and great things has been introduced with Drupal 7. So I started using it for several websites. However, the learning curve is fairly steep. Here is what I have found useful:

Documentation

The documentation is very large, but it is also somewhat fragmented if you want to do some specific stuff. There is a very large community, but searching for documentation on Google will get me results for other versions of Drupal than the one I am interested in, namely no. 7.

Theming

It is really fairly easy to create a theme, and you can find several documents around the net on how to do that. One thing I struggled with was finding the variables to print. The devel module rescued me, and after enabling that, I can just put in the following snippet of php code in the template, and it will show all the variables available for the template:

<span style="display: none;"> </span><?php print dpm($variables); ?><span style="display: none;"> </span>

Installation profiles

Install drush. That will save you bundles of time. I spend some time getting familar with install profiles after reading Drupal deployments & workflows with version control, drush_make, and Aegir, and I have found a couple of really useful commands when you want to test your profile.

I followed the approach suggested in the article, where you have a site.build file describing which drupal version to use and what profile to get. Then you have a site.make describing which themes and modules to use.

After building your site with:

drush make site.build ~/workspace/site_build

Next time you change your .make file, just rebuild your site with the following command:

<span style="display: none;">&nbsp;</span>drush make --no-core --contrib-destination=. site.make

This will make it possible to quickly see whether your site.make changes work. You also create a site.install file. To make sure that the changes you make to this file work, you can run this command (Just remember that the above command destroys your current site and flushes the database, so only perform this during development):

<span style="display: none;"> </span>drush si site<span style="display: none;"> </span>

I am hosting the installation profile for larsolesen.dk on github.org. Take a look to see, what I how I do some stuff.

Skriv en kommentar

Din e-mail bliver ikke offentliggjort. Obligatoriske felter er markeret *

Indlæser...