次の方法で共有


Getting started with Drupal and WebMatrix

la drupal Nov 2011WP_000813
lightning talks

Last week I had the opportunity to present to the LA Drupal group on building a Drupal site with WebMatrix.  The session was also recorded, but unfortunately there was a problem with the audio.  Although you can look forward to a recording with audio, hopefully this preliminary version gives you a good idea of how to get started with Drupal and WebMatrix.  In the meantime, here are some easy-to-follow screen shot instructions and clear code snippets from of the beginning of my demo, based on Laurence Maroney's video.

First, if you don’t have WebMatrix, get it free!  I’m using v2 Beta released September 2011.

Select App Gallery.

01

Select Acquia Drupal.  Give your site a name and click Next.

02

Select a database or let WebMatrix take care of the installation for you if you don’t have one installed.

3a

Accept the end-user license agreement.

04

05

06

Run your site in your preferred browser.

07

08

Fill out Site Information.  Since I don’t have an Acquia subscription, I left those two entries blank.

09

10

Click on Visit your new site.

11

Let’s customize our Drupal site within the Acquia Drupal framework.  Click on Modules at the top.

12

Deselect Acquia site information.

14

Save configuration.

15

Deselect Acquia agent.

16

Save configuration.

17

Let’s add the Lightbox2 module by searching for it in contributed modules.

18

You can also download the Lightbox2 module here.

19

Extract the lightbox2 module into the modules folder of your website.

20

21

Notice that the lightbox2 module has been added in WebMatrix.  Click Run.

22

Select Modules.

23

Enable the Lightbox2 module and Save configuration.

24

Back in WebMatrix, add a New Folder to your website and name it images.

25

Add Existing File… and add a few images to the images folder.

26

27

Go back to your site running locally, and click Content.  We’re going to edit a basic page.

28

Click on the default page.

29

Click Edit.

30

Let’s edit the default page by giving it a new title and adding some code leveraging the Lightbox2 module.

<a href="#" onclick="Lightbox.triggerLightbox('lightshow', 'mypics');">Start Slideshow</a>

<a href="\images\pic1.png" rel="lightshow[mypics]">image #1</a>
<a href="\images\pic2.png" rel="lightshow[mypics]">image #2</a>
<a href="\images\pic3.png" rel="lightshow[mypics]">image #3</a>

Click Save when you’re done.

31

When I click on Start Slideshow, my slideshow of images starts.

32

And here I am with some happy raffle winners from the SoCal Code Camp at USC in October 2011.

33

Finally, let’s see how easy it is to modify your code in WebMatrix by adding some code to the page template.  In the template I’m using (Barthik by default), I’m going to add a Twitter Follow button based on code from Twitter Resources found here.

34

Notice the Twitter Follow button has been added to the footer of the template when you run your site.

35