Feed aggregator

Flickr: Drupal Yorkshire 14 May 2013 (109)

Drupal Talk - Thu, 2013-05-16 02:55

PHH Sykes posted a photo:

On Tuesday 14 May 2013 I went to my first Drupal Yorkshire meetup. Stefan van Hooft gave a great presentation on Drupal Without Coding via a Google+ Hangout. The presentation clearly showed the way he builds geotagging into his Drupal sites. The whole evening was a great success. A recording of Stefan’s presentation is available here; youtu.be/h7fk2TjFg8o

Drupal Yorkshire hold regular meetups on the second Tuesday of each month do check the website
www.drupalyorkshire.org.uk

Photographs and Words 2013 PHH Sykes
www.phhsykes.co.uk
phhsykes@googlemail.com


This work by PHH Sykes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Categories: Drupal

Flickr: Drupal Yorkshire 14 May 2013 (108)

Drupal Talk - Thu, 2013-05-16 02:55

PHH Sykes posted a photo:

On Tuesday 14 May 2013 I went to my first Drupal Yorkshire meetup. Stefan van Hooft gave a great presentation on Drupal Without Coding via a Google+ Hangout. The presentation clearly showed the way he builds geotagging into his Drupal sites. The whole evening was a great success. A recording of Stefan’s presentation is available here; youtu.be/h7fk2TjFg8o

Drupal Yorkshire hold regular meetups on the second Tuesday of each month do check the website
www.drupalyorkshire.org.uk

Photographs and Words 2013 PHH Sykes
www.phhsykes.co.uk
phhsykes@googlemail.com


This work by PHH Sykes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Categories: Drupal

Flickr: Drupal Yorkshire 14 May 2013 (107)

Drupal Talk - Thu, 2013-05-16 02:55

PHH Sykes posted a photo:

On Tuesday 14 May 2013 I went to my first Drupal Yorkshire meetup. Stefan van Hooft gave a great presentation on Drupal Without Coding via a Google+ Hangout. The presentation clearly showed the way he builds geotagging into his Drupal sites. The whole evening was a great success. A recording of Stefan’s presentation is available here; youtu.be/h7fk2TjFg8o

Drupal Yorkshire hold regular meetups on the second Tuesday of each month do check the website
www.drupalyorkshire.org.uk

Photographs and Words 2013 PHH Sykes
www.phhsykes.co.uk
phhsykes@googlemail.com


This work by PHH Sykes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Categories: Drupal

Flickr: Drupal Yorkshire 14 May 2013 (106)

Drupal Talk - Thu, 2013-05-16 02:55

PHH Sykes posted a photo:

On Tuesday 14 May 2013 I went to my first Drupal Yorkshire meetup. Stefan van Hooft gave a great presentation on Drupal Without Coding via a Google+ Hangout. The presentation clearly showed the way he builds geotagging into his Drupal sites. The whole evening was a great success. A recording of Stefan’s presentation is available here; youtu.be/h7fk2TjFg8o

Drupal Yorkshire hold regular meetups on the second Tuesday of each month do check the website
www.drupalyorkshire.org.uk

Photographs and Words 2013 PHH Sykes
www.phhsykes.co.uk
phhsykes@googlemail.com


This work by PHH Sykes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Categories: Drupal

Flickr: Drupal Yorkshire 14 May 2013 (105)

Drupal Talk - Thu, 2013-05-16 02:55

PHH Sykes posted a photo:

On Tuesday 14 May 2013 I went to my first Drupal Yorkshire meetup. Stefan van Hooft gave a great presentation on Drupal Without Coding via a Google+ Hangout. The presentation clearly showed the way he builds geotagging into his Drupal sites. The whole evening was a great success. A recording of Stefan’s presentation is available here; youtu.be/h7fk2TjFg8o

Drupal Yorkshire hold regular meetups on the second Tuesday of each month do check the website
www.drupalyorkshire.org.uk

Photographs and Words 2013 PHH Sykes
www.phhsykes.co.uk
phhsykes@googlemail.com


This work by PHH Sykes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Categories: Drupal

Flickr: Drupal Yorkshire 14 May 2013 (104)

Drupal Talk - Thu, 2013-05-16 02:55

PHH Sykes posted a photo:

On Tuesday 14 May 2013 I went to my first Drupal Yorkshire meetup. Stefan van Hooft gave a great presentation on Drupal Without Coding via a Google+ Hangout. The presentation clearly showed the way he builds geotagging into his Drupal sites. The whole evening was a great success. A recording of Stefan’s presentation is available here; youtu.be/h7fk2TjFg8o

Drupal Yorkshire hold regular meetups on the second Tuesday of each month do check the website
www.drupalyorkshire.org.uk

Photographs and Words 2013 PHH Sykes
www.phhsykes.co.uk
phhsykes@googlemail.com


This work by PHH Sykes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Categories: Drupal

Flickr: Drupal Yorkshire 14 May 2013 (102)

Drupal Talk - Thu, 2013-05-16 02:55

PHH Sykes posted a photo:

On Tuesday 14 May 2013 I went to my first Drupal Yorkshire meetup. Stefan van Hooft gave a great presentation on Drupal Without Coding via a Google+ Hangout. The presentation clearly showed the way he builds geotagging into his Drupal sites. The whole evening was a great success. A recording of Stefan’s presentation is available here; youtu.be/h7fk2TjFg8o

Drupal Yorkshire hold regular meetups on the second Tuesday of each month do check the website
www.drupalyorkshire.org.uk

Photographs and Words 2013 PHH Sykes
www.phhsykes.co.uk
phhsykes@googlemail.com


This work by PHH Sykes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Categories: Drupal

Flickr: Drupal Yorkshire 14 May 2013 (103)

Drupal Talk - Thu, 2013-05-16 02:55

PHH Sykes posted a photo:

On Tuesday 14 May 2013 I went to my first Drupal Yorkshire meetup. Stefan van Hooft gave a great presentation on Drupal Without Coding via a Google+ Hangout. The presentation clearly showed the way he builds geotagging into his Drupal sites. The whole evening was a great success. A recording of Stefan’s presentation is available here; youtu.be/h7fk2TjFg8o

Drupal Yorkshire hold regular meetups on the second Tuesday of each month do check the website
www.drupalyorkshire.org.uk

Photographs and Words 2013 PHH Sykes
www.phhsykes.co.uk
phhsykes@googlemail.com


This work by PHH Sykes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Categories: Drupal

Flickr: Drupal Yorkshire 14 May 2013 (101)

Drupal Talk - Thu, 2013-05-16 02:55

PHH Sykes posted a photo:

On Tuesday 14 May 2013 I went to my first Drupal Yorkshire meetup. Stefan van Hooft gave a great presentation on Drupal Without Coding via a Google+ Hangout. The presentation clearly showed the way he builds geotagging into his Drupal sites. The whole evening was a great success. A recording of Stefan’s presentation is available here; youtu.be/h7fk2TjFg8o

Drupal Yorkshire hold regular meetups on the second Tuesday of each month do check the website
www.drupalyorkshire.org.uk

Photographs and Words 2013 PHH Sykes
www.phhsykes.co.uk
phhsykes@googlemail.com


This work by PHH Sykes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Categories: Drupal

Web Wash: Create A Call To Action Block Using The Field As Block Module

Drupal Planet - Wed, 2013-05-15 23:00

Field as Block is a lightweight module that allows you to display a field as a block. The same results can be achieved by using Panels, Display Suite or custom code but this module offers a lightweight alternative.

CCK Blocks offers similar functionality, however on the project page they recommend that you use Field as Block for new projects. It looks like CCK Blocks will be deprecated in favour of Field as Block. For more details read issue #1920636 (comment #4).

Categories: Drupal

Jimmy Berry: Drupal on Google App Engine

Drupal Planet - Wed, 2013-05-15 21:03

Today Google announced PHP support for Google App Engine! I have been one of the lucky folks who had early access and so of course I worked on getting Drupal up and running on GAE. There are a few things that still need to be worked out which I will continue to discuss with the app engine team, but I have a working Drupal setup which I will detail below. Note that much of this may also apply to other PHP frameworks.

Getting up and running

I will cover the steps specific to getting Drupal 7 (notes for Drupal 6 along with branches in repository) up and running on App Engine and not how to use the SDK and development flow which is detailed in the documentation. For an example (minimal profile from core) of Drupal running on Google App Engine see boombatower-drupal.appspot.com.

Sign up to be whitelisted for PHP runtime

Currently, the PHP runtime requires you to sign up specifically for access. Assuming you have access you should be able to follow along with the steps below. Otherwise, the following steps will give you a feel for what it takes to get Drupal running on GAE.

Create an app

Create app by visiting appengine.google.com and clicking Create Application, see the documentation for more details.

Create a Cloud SQL Instance

Follow the documentation for setting up a Cloud SQL Instance. Be sure to give your application access to the instance.

Once the instance has been created select the SQL Prompt tab and create a database for your Drupal site as follows.

CREATE DATABASE drupal;

Download Drupal

There are a few tweaks that need to be made to get Drupal to run properly on GAE which are explained below, but for the purposes of this walk-through one can simply download my branch containing all the changes from github.

git clone --branch 7.x-appengine https://github.com/boombatower/drupal-appengine.git   # or for Drupal 6 git clone --branch 6.x-appengine https://github.com/boombatower/drupal-appengine.git

or download as a zip or for Drupal 6 download as a zip.

Configure Drupal database settings

Since GAE does not allow the filesystem to be writeable one must configure the database settings ahead of time.

Copy default.settings.php as settings.php and add the following bellow <?php $databases = array(); ?> around line 213.

<?php
$databases = array();
$databases['default']['default'] = array(
  'driver' => 'mysql',
  'database' => 'drupal', // The database created above (example used 'drupal').
  'username' => 'root',
  'password' => '',
  // Setting the 'host' key will use a TCP connection which is not supported by GAE.
  // The name of the instance created above (ex. boombatower-drupal:drupal).
  'unix_socket' => '/cloudsql/[INSTANCE]',
//  'unix_socket' => '/cloudsql/boombatower-drupal:drupal',
  'prefix' => '',
);
?>

For Drupal 6 around line 91.

<?php
$db_url = 'mysql://root:@cloudsql__boombatower-drupal___drupal/drupal';
?> Push to App Engine

Update the application name in the app.yaml file to the one you created above and upload by following the documentation.

# See https://developers.google.com/appengine/docs/php/config/appconfig.   application: drupal # <-- change this to your application version: 1 runtime: php api_version: 1 threadsafe: true   handlers: # Default handler for requests (wrapper which will forward to index.php). - url: / script: wrapper.php   # Handle static requests. - url: /(.*\.(ico$|jpg$|png$|gif$|htm$|html$|css$|js$)) # Location from which to serve static files. static_files: \1 # Upload static files for static serving. upload: (.*\.(ico$|jpg$|png$|gif$|htm$|html$|css$|js$)) # Ensures that a copy of the static files is left for Drupal during runtime. application_readable: true   # Catch all unhandled requests and pass to wrapper.php which will simulate # mod_rewrite by forwarding the requests to index.php?q=... - url: /(.+) script: wrapper.php appcfg.py update drupal/ Install

Visit your-app.appspot.com/install.php and follow the installation steps just as you would normally except that the database information will already be filled in. Go ahead and ignore the mbstring warning and note that the GAE team is looking into supporting mbstring.

Explanation of changes

If you are interested in what changes/additions were made and the reasons for them continue reading, otherwise you should have a working Drupal install ready to explore! There are a few basic things that do not work perfectly out of the box on GAE. The changes can be seen by diffing the 7.x-appengine branch against the 7.x branch in my repository.

File directory during installation

The Drupal installer requires that the files directory be writeable, but GAE does not allow for local write access thus the requirement must be bypassed in order for the installation to complete.

Author: boombatower <boombatower@google.com> Date: Wed May 15 15:49:03 2013 -0700   Hack to trick Drupal into ignoring that file directory is not writable.   diff --git a/modules/system/system.install b/modules/system/system.install index 1b037b8..9931aad 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -333,6 +333,8 @@ function system_requirements($phase) { } $is_writable = is_writable($directory); $is_directory = is_dir($directory); + // Force Drupal to think the directories are writable during installation. + $is_writable = $is_directory = TRUE; if (!$is_writable || !$is_directory) { $description = ''; $requirements['file system']['value'] = $t('Not writable'); Clean URLs

In order to take advantage of clean urls, of which most sites take advantage, mod_rewrite is required for Apache environments. Since GAE does not use Apache it does not support mod_rewrite and thus another solution is needed. The app.yaml can configure handlers which allow for wildcard matching which means multiple paths can easily be routed to a single script. Taking that one step further we can alter the <?php $_GET['q']?> variable just as mod_rewrite would so that Drupal functions properly. Rather than modify core this can be done via a wrapper script as show below (this should work well for other PHP applications).

<?php
/**
 * @file
 * Provide mod_rewrite like functionality and correct $_SERVER['SCRIPT_NAME'].
 *
 * Pass through requests for root php files and forward all other requests to
 * index.php with $_GET['q'] equal to path. In terms of how the requests will
 * seem please see the following examples.
 *
 * - /install.php: install.php
 * - /update.php?op=info: update.php?op=info
 * - /foo/bar: index.php?q=/foo/bar
 * - /: index.php?q=/
 */

$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);

// Provide mod_rewrite like functionality. If a php file in the root directory
// is explicitely requested then load the file, otherwise load index.php and
// set get variable 'q' to $_SERVER['REQUEST_URI'].
if (dirname($path) == '/' && pathinfo($path, PATHINFO_EXTENSION) == 'php') {
  $file = pathinfo($path, PATHINFO_BASENAME);
}
else {
  $file = 'index.php';

  // Provide mod_rewrite like functionality by using the path which excludes
  // any other part of the request query (ie. ignores ?foo=bar).
  $_GET['q'] = $path;
}

// Override the script name to simulate the behavior without wrapper.php.
// Ensure that $_SERVER['SCRIPT_NAME'] always begins with a / to be consistent
// with HTTP request and the value that is normally provided (not what GAE
// currently provides).
$_SERVER['SCRIPT_NAME'] = '/' . $file;
require $file;
?> PHP $_SERVER['SCRIPT_NAME'] variable

The <?php $_SERVER['SCRIPT_NAME'] ?> implementation differs from Apache mod_php implementation which can cause issues with a variety of PHP applications. The variable matches the HTTP spec and not the filesystem when called through Apache.

For example a script named foo.php contains the following.

<?php
var_dump($_SERVER['SCRIPT_NAME']);
?>

When executed from command line here are the results.

$ php foo.php string(7) "foo.php"   $ php ./foo.php string(9) "./foo.php"

When invoked through Apache like http://example.com/foo.php.

string(8) "/foo.php"

The documentation does not talk about this behavior (although many comments demonstrated the expected Apache behavior), but it is definitely depended on.

The difference causes Drupal to format invalid URLs.

example.com.foo.css (instead of ...com/foo.css) example.comsubdir/foo.css (instead of ...com/subdir/foo.css)

Drupal derives the URL from <?php dirname() ?> of <?php $_SERVER['SCRIPT_NAME'] ?> which will return . if no slashes or just / for something like /index.php.

The wrapper script above solves this by ensuring that the SCRIPT_NAME variable alway starts with a leading slash.

HTTP requests

GAE does not yet support support outbound sockets for PHP (although supported for Python and Java) and if/when it does the preferred way will continue to be streams due to automatic caching of outbound requests using urlfetch. I have included a small change to provide basic HTTP requests through drupal_http_request(). A proper solution would be to override the drupal_http_request_function variable and provide a fully functional alternative using streams. Drupal 8 has converted drupal_http_request() to use Guzzle which supports streams. Making a similar conversion for Drupal 7 seems like the cleanest way forward rather than reinventing the change.

php.ini

GAE disables a number of functions for security reasons, but only softly disables some functions which may then be enabled. Drupal provides access to phpinfo() from admin/reports/status and uses output buffering, both of which are disabled by default. The included php.ini enables both functions in addition to getmypid which is used by drupal_random_bytes().

# See https://developers.google.com/appengine/docs/php/config/php_ini.   # Required for ob_*() calls which you can find by grepping. # grep -nR '\sob_.*()' . output_buffering = "1"   # See https://developers.google.com/appengine/docs/php/runtime#Functions-That-Must-Be-Manually-Enabled # phpinfo: Provided on admin/reports/status under PHP -> "more information". # getmypid: Used by drupal_random_bytes(), but not required. google_app_engine.enable_functions = "getmypid, phpinfo" Future

I plan to continue working with the GAE team to ensure that support for Drupal can be provided in a clean and simple manner. Once current discussions have been resolved I hope to provide more formal documentation and support for Drupal.

File handling

I worked on file support, but there were a number of upcoming changes that would make things much cleaner so I decided to wait. GAE provides a stream wrapper for Google Cloud Storage which makes using the service very simple. Assuming you have completed the prerequisites files on GCS may be accessed using standard PHP file handling functions as shown in the documentation.

<?php
$file = 'gs://my_bucket/hello.txt';
file_put_contents($file, 'hello world');

$contents = file_get_contents($file);
var_dump($contents); // prints: hello world
?>

Unfortunately, the wrapper does not currently support directories nor does file_exists() work properly. Keep in mind that the filesystem is flat so a file may be written to any path without explicitly creating the directory. Meaning one can write to gs://bucket/foo/bar.txt without creating the directory foo. With that being the case it is possible to get some hacky support by simply disabling all the directory code in Drupal, but not really usable. It should be possible to hack support in through the stream wrapper since directories are simply specially name files, but the app engine team has indicated they will look into the matter so hopefully this will be solved cleanly.

Assuming the stream wrappers are fixed up then support can be added in much the same way as that Amazon S3 support is added except that no additional library will be needed.

Additionally, the documentation also notes the following.

Direct file uploads to your POST handler, without using the App Engine upload agent, are not supported and will fail.

In order to support file uploads the form must be submitted to the url provided by CloudStorageTools::createUploadUrl() and the forwarded result handled by Drupal. A benefit of proxying requests through uploader service is that uploaded files may be up to 100TB in size.

Other

There are a number of additional services provided as part of GAE of which Drupal could take advantage.

Closing

Hopefully this will be useful in getting folks up and running quickly on GAE with Drupal and understanding the caveats of the environment. Obviously there is a lot more to cover and I look forward to seeing what others publish on the matter.

Tags:
Categories: Drupal

Drupal Association News: Drupal.org D7 team at DrupalCon

Drupal Planet - Wed, 2013-05-15 17:30

Come meet Drupal.org team in person at DrupalCon Portland!

We’re hard at work upgrading Drupal.org to Drupal 7. DrupalCon is a perfect opportunity for you to find out what is going on with the upgrade, give us feedback on the new issue page layout and, of course, help us in the issue queue.

Where to find us:

  • Weekend before DrupalCon - We are taking part in the extended sprints, come and help us close some issues
  • Tuesday, May 21, 4:30pm - We’re having a BoF, Drupal.org improvements and D7 upgrade (Room B112)
  • Wednesday, May 22 at 6pm - I’m presenting D7 upgrade report at the Drupal Association board meeting
  • Thursday, May 23, 10:15am-1:15pm - I’ll be at the Drupal Association booth in the Exhibit Hall’s Community Village
  • Friday, May 24 - We'll be closing more issues at the Contribution Sprint

Come and learn how you can help out with development, site building, or QA!

Categories: Drupal

Acquia: Voices of Drupal Camp Alpe-Adria 2013

Drupal Planet - Wed, 2013-05-15 17:03

Here are the highlights from a few of the conversations I had with attendees of the 2013 Drupal Camp Alpe-Adria, held in April in Ljubljana, Slovenia. The camp was a wild success and attracted a large, international crowd. I'll post a couple more interviews I did at this event in coming weeks.

alpe-adria-voices.mp3
Categories: Drupal

Aten Design Group: Project Review Wednesday: Subscriptions by Reference

Drupal Planet - Wed, 2013-05-15 15:43

There are currently 99 new Drupal contributors awaiting review of their first project. This is a great place to contribute to the community and learn about interesting upcoming projects, for example...

Module: Subscriptions by Reference What does it do?

The Subscriptions module allows you to subscribe directly to nodes, but what if you want to subscribe to one node referenced by another? Previously, you could do that with a moderate amount of custom code, maybe with the help of a blog post explaining the process. Now, the Subscriptions by Reference module promises to make that even easier. Just tell it which content types and field you want to use in the subscription and it does the rest.

Look Useful? Review it!

If you would like to see this module readily available on Drupal.org, you should review it and help make that happen.

Review It

Pro Tip: If you've never reviewed a project application before, you can find instructions for reviewers on Drupal.org and the Code Review group is happy to help more people get involved.

Categories: Drupal

Friendly Machine: Learning to Work with Views

Drupal Planet - Wed, 2013-05-15 15:41

In this lesson we're going to talk about what is possibly the most useful Drupal site building module of them all - Views. If you're coming from a WordPress or Joomla background, you won't have experienced anything quite like it. Not only does Views allow you to easily build queries on your site's content, but it gives an amazing degree of control over the display of those query results.

We're going to begin by creating a very basic view just to get acquainted with the interface and some of the settings we'll be using the most often. If you've been following along and are using my free installation profile, then everything you'll need is ready to go. If you're using your own site, make sure you have Views installed along with some content you can work with. If you have a fresh install of Drupal, the Devel module is great for generating dummy content.

Once you're all set, let's get started creating our first view.

Creating a View

To begin, let's head to Structure > Views. You should see something like the screenshot below. At the upper left of the page is a link that says, "Add new view". Go ahead and click it.

You'll next be directed to the screen below. If you wanted to keep things super easy, you could just add a title and then save to have a view of all your site's content presented as teasers. We're going to do something a bit different, however. Take a look at the settings below.

You'll see that I've named the view "Blog grid" and set it to only show content of the Article type. Often you may want to create an additional display, such as a block, but in this example we're going to just stick with the default Page view.

The ability to create multiple displays is one of the really cool things about Views. We're building one query, but we have the option to display it in multiple ways - a page, a block or even a feed - and then tweak the display of each as needed.

We'll go with what we have here and click "Continue and edit". You'll next see the view edit form as in the screenshot below.

OK, there's a lot going on with this form, but we're only going to focus on a few of these settings to keep it simple this time around. Let's begin with two that we're not going to edit in this lesson, but that I'd like you to take a moment to check out. These are the Filter Criteria and the Sort Criteria settings.

You'll see that they determine the type of content we're working with, the publish status and how the results will be sorted (in our case, by date with the newest displayed first). These settings make it very easy to add criteria to further filter our results.

For example, one thing that is often useful to do is only include nodes in your view that have been promoted to the front page. This allows you to do something like publish a post but not include it in the main list of your blog articles. I do this occasionally when I don't want a post distributed to email subscribers, but do want it available through my Categories menu.

Take a look at these options, play around with them bit and see what changes you can come up with. Experimenting is a great way to figure out all the things Views is capable of doing.

Editing a Field Display

In our last tutorial, we talked about content types and the Fields UI. In this lesson we're circling back a bit on that subject by using fields to create our view. That's what a view mostly boils down to - a query where we ask Drupal to return certain fields so we can use them in a display we place on our site. You'll see that in this view all that we currently have being displayed are the titles of our articles. The preview (down at the bottom of the page) also shows us that our titles are being displayed as simple, unformatted links. 

Although it's a good idea to have the title as a link, we should probably change the display style to a heading. To do this, click on Content: Title under Fields. You'll see something like the screenshot below.

You'll notice that I've expanded the Style Settings tab and checked "Customize field HTML" and set it to display the title as an H2. I could have done a lot of other customizations, including adding a class, changing the field wrapper and more.

Farther down this screen you'll see the Rewrite Results tab and that is where things get really interesting. You can pretty much go nuts with how you want to customize a field's display. This is super powerful stuff! The only criticism I'll offer is that by default, Views generates markup that is quite bloated - it has a serious case of divitis. Fortunately, we have the Semantic Views module to tidy things up. We won't get into using that module in this lesson, but I recommend you take a look at it on your own.

I'm going apply these settings for all displays, but note that by using the drop down at the top of this screen you could choose to instead apply it to a specific display. This is very useful when you're using the query to create multiple displays (pages, blocks or feeds) and modifying how each one outputs the view.

After applying the changes, you should notice in the preview that the titles have been successfully changed to headings. So far, so good. But let's add another field to our display to make it a bit more useful. You'll see in the screenshot below there is an arrow pointing to the link that adds a new field to our view.

After clicking that button, you'll see a long list of options pop up. Let's select Content: Body and then continue by clicking the, "Apply (all displays)" button. You'll next see the same screen as when we edited the Title field. One difference this time is that "Create a label" is now checked. In most cases I uncheck that so that my views don't add labels, but you may find situations where it comes in handy.

Another difference this time is that we're going to make a change to the format of the field. We probably aren't going to want the entire Body field to be displayed in our view, so instead we'll set it to only display a summary. You'll see a drop down under Formatter. Go ahead and select, "Summary or trimmed". In this case the default settings are fine, but I encourage you to play around with some of these a bit and see what you come up with. Now we'll click, "Apply (all displays)" to continue.

After saving that, take a look at the preview - looking pretty good, huh? We've come far enough that we should see what this Page view we've created actually looks like on our site. First, however, make sure you save your view! That's an important thing to remember - none of your changes are applied until you save the view, so if you ever get off track, just click cancel and start over.

After saving, look for a small link at the upper right of the view edit screen that says, "view Page". Let's click that and take a look at the view we've created as it will appear on our site.

That was pretty easy, right? I'll bet that you can think of a lot applications just using what we learned today, but in future lessons we'll be coming back to the Views module and adding to our bag of tricks. In fact, our next lesson will cover some advanced features of views (contextual links and relationships) and in a few weeks we'll use Views and the Flex Slider module to add an image slider to our front page.

Until then, you can keep up with this series either via the RSS feed or subscribing to blog updates (at the top of the sidebar).

If you'd like to comment on this post, you can do so on this discussion forum.

Categories: Drupal

Drupal Association News: Growing Drupal's adhesion in China: Feedback for Global Training Day March 15, 2013 in Shanghai (Guest Blog)

Drupal Planet - Wed, 2013-05-15 12:05

Guest blogger Yvonne Chen of Dayvin Internet Solutions shares the results of the Shanghai Global Training Day event this past March.

Following-up with the Global Training Day series, we were glad to be able to organize the Drupal Training Day on March 15, 2013 in Shanghai.

Personal blog tags: Drupal Global Training DaycommunityChinaguest blog
Categories: Drupal

Rootwork.org: Grow your own: Learning custom base themes at Drupalcon Portland

Drupal Planet - Wed, 2013-05-15 11:26

Ah, base themes.

If there's an analogue to the Windows/Mac/Linux battle in Drupal land, it's probably Zen vs. Omega vs. AdaptiveTheme.

Garrett Dawson and John Ferris have a way out of that eternal struggle: Custom base themes. As they put it in their Drupalcon Portland session description:

"By necessity, base themes make assumptions about how teams and individuals work. By rolling your own, you’ll become much more comfortable and informed about the Drupal theming layer, and have a better launchpad for your front-end projects."

Here in Portland we take home gardening and permaculture seriously, so what better place to talk about "growing your own" custom base theme!

I spoke with John and Garrett about how creating your own base theme can make work for you and your team easier. Take a gander at their session, “Dapper Drupal: Custom Tailored Themes,” on Thursday at 2:15 PM for the full story!

IB: Base themes that are out there make some assumptions about how you want to theme. What's the advantage to rolling your own base theme rather than finding the theme that already makes the assumptions you do?

JF and GD: If you can find a base theme in contrib that fits perfectly into your workflow, by all means, use it. There's a lot of solid tools out there. We don't want to deter people from using and contributing to them. With that said, we feel it's unlikely a contributed base theme will be ticking all the boxes and making all the right assumptions about your workflow.

There's no one-size-fits-all approach. Your front-end process is heavily influenced by team dynamics, contrib module choices and a whole host of other considerations. The majority of base themes cannot account for those variables like you can. We want front-end developers to take a critical look at their tools to see where they can make improvements. That may mean creating a custom base theme; a custom starter theme for use with an existing base theme; or even a set of helper modules.

All the popular base themes started because someone wasn't happy with what was available at the time. The ultimate goal is increasing efficiency while improving the quality of the final HTML, CSS and JS.

IB: Do you recommend custom base themes for big shops? Small distributed teams? Freelancers? Everyone?

JF/GD: Yes, all of the above. At least consider it as an option. If you find yourself doing any kind of repetitive work, there's an opportunity for improvement. The only people who should steer clear of custom base themes are those new to Drupal. You need to be familiar with the tools that are available before setting out to create your own.

IB: Besides your the custom base themes you developed yourselves (Center and Prototype) what other custom base themes have you seen in the wild?

JF/GD: Yes! We've learned a lot working with and iterating on Center and Prototype. They work well for the structure of our team and the type of work we do at Aten. However, we realize every team is unique. We were really interested in seeing how other organizations were approaching the front-end problem space. We chatted with a range of teams of varying sizes working across different industries. Everyone has their own unique set of tools based on their own strengths and constraints. We're excited to share those with you, but you'll just have to come and see for yourself!

Images: National Archives and Flickr user McBeth.

Join Rootwork on Twitter, Facebook and SlideShare.

Learn about Rootwork's services for nonprofits and social change.

Categories: Drupal

Flickr: Drupal Drop Pizza at Drupal Yorkshire (109)

Drupal Talk - Wed, 2013-05-15 11:22

PHH Sykes posted a photo:

If it is possible to have a deep and meaningful relationship with a thin crust pizza then this is the pizza of choice for Drupal enthusiasts. You can argue about the topping if you need to, but a pizza creation in the shape of a Drupal drop served with beer is to be scoffed on and definitely not at if scoffing be the art of enjoying a tech inspired superbly well executed culinary delight.

This pizza was served at the Drupal Yorkshire meetup on Tuesday 14 May 2013. Stefan van Hooft gave a great presentation on Drupal Without Coding via a Google+ Hangout. The presentation clearly showed the way he builds geotagging into his Drupal sites. The whole evening was a great success. A recording of Stefan’s presentation is available here; youtu.be/h7fk2TjFg8o

Drupal Yorkshire hold regular meetups on the second Tuesday of each month do check the website
www.drupalyorkshire.org.uk

The Drupal icon shown here has been requested for non-profit use. These pictures may need to be amended.

Photographs and Words 2013 PHH Sykes
www.phhsykes.co.uk
phhsykes@googlemail.com


This work by PHH Sykes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Categories: Drupal

Flickr: Drupal Drop Pizza at Drupal Yorkshire (108)

Drupal Talk - Wed, 2013-05-15 11:22

PHH Sykes posted a photo:

If it is possible to have a deep and meaningful relationship with a thin crust pizza then this is the pizza of choice for Drupal enthusiasts. You can argue about the topping if you need to, but a pizza creation in the shape of a Drupal drop served with beer is to be scoffed on and definitely not at if scoffing be the art of enjoying a tech inspired superbly well executed culinary delight.

This pizza was served at the Drupal Yorkshire meetup on Tuesday 14 May 2013. Stefan van Hooft gave a great presentation on Drupal Without Coding via a Google+ Hangout. The presentation clearly showed the way he builds geotagging into his Drupal sites. The whole evening was a great success. A recording of Stefan’s presentation is available here; youtu.be/h7fk2TjFg8o

Drupal Yorkshire hold regular meetups on the second Tuesday of each month do check the website
www.drupalyorkshire.org.uk

The Drupal icon shown here has been requested for non-profit use. These pictures may need to be amended.

Photographs and Words 2013 PHH Sykes
www.phhsykes.co.uk
phhsykes@googlemail.com


This work by PHH Sykes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Categories: Drupal

Flickr: Drupal Drop Pizza at Drupal Yorkshire (107)

Drupal Talk - Wed, 2013-05-15 11:22

PHH Sykes posted a photo:

If it is possible to have a deep and meaningful relationship with a thin crust pizza then this is the pizza of choice for Drupal enthusiasts. You can argue about the topping if you need to, but a pizza creation in the shape of a Drupal drop served with beer is to be scoffed on and definitely not at if scoffing be the art of enjoying a tech inspired superbly well executed culinary delight.

This pizza was served at the Drupal Yorkshire meetup on Tuesday 14 May 2013. Stefan van Hooft gave a great presentation on Drupal Without Coding via a Google+ Hangout. The presentation clearly showed the way he builds geotagging into his Drupal sites. The whole evening was a great success. A recording of Stefan’s presentation is available here; youtu.be/h7fk2TjFg8o

Drupal Yorkshire hold regular meetups on the second Tuesday of each month do check the website
www.drupalyorkshire.org.uk

The Drupal icon shown here has been requested for non-profit use. These pictures may need to be amended.

Photographs and Words 2013 PHH Sykes
www.phhsykes.co.uk
phhsykes@googlemail.com


This work by PHH Sykes is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Categories: Drupal
Syndicate content

Powered By