Oscon Can Be Worth the Investment
Blog postIn a few short weeks I'll be headed on the road once again for two great events: Twin Cities DrupalCamp and OSCON. On the surface these two events couldn't be more different. One is intimate, inexpensive, and full of Drupal. The other is big, an investment, and has hardly any Drupal. Seems like an obvious win for Twin Cities DrupalCamp, right? Well, let's dive a little deeper into what makes OSCON worth the price tag.
Setting up Your Developer Environment
Blog postIn my new position at Drupalize.Me I have the luxury of helping a lot of projects in little ways. Being able to context switch quickly helps a lot. This means I've put a lot of time into how my workstation is setup so that I can easily move from one project to another. With the new job I also decided to add OSX to the mix of computers that I use on a daily basis.
In episode 20 of the Drupalize.Me podcast, we're fortunate to be joined by guest Chris Eppstein, the creator of Compass, and part of the core Sass team. We also have three Lullabot front-end developers on the podcast, Micah Godbolt, Kris Bulman, and Carwin Young.
A month or so ago the Drupalize.Me team started a discussion on how to start helping others learn Drupal 8. We knew Drupal 8 wasn't ready for our typical curriculum and video production process, but thought you would be interested to learn along with us about Drupal 8 as it continues to evolve. This blog post is the kick off to that series. As we stated in a recent podcast where we announced this idea, we need everyone to understand that the things we discuss are still in development and could change, or even be removed from D8 altogether.
During the week June 24th a mass of Drupal folks will converge on Dublin, Ireland for Drupal Dev Days. This year, in addition to the three days of DrupalCamp that is happening (June 28-30), there is also a week of sprints leading up to the camp, and to the Drupal 8 code freeze deadline. This is it. If it's going to be in Drupal 8, it needs to happen before the end of June.
See You at Drupalcamp Austin
Blog postWe're pleased as punch to be sponsoring DrupalCamp Austin in Austin, Texas from June 21st through 23rd. This year's camp is packed, with one day of all-day workshops, several half-day workshops, three tracks of sessions over two days, and two keynotes.
We'd Like to Sponsor Your User Group
Blog postWe're happy to announce a new program to sponsor user groups around the world: Meetup Memberships. We're giving user groups FREE access to the entire Drupalize.Me library on days that you have meetups or camps planned. It's like having a Drupalize.Me instructor show up at your event, anywhere, anytime! Here's how it works:
In this podcast episode, Building Lullabot.com, Addi is joined by the Lullabot team that worked on the new Lullabot.com redesign and upgrade. The conversation covers a lot of the lessons learned from doing an internal project on the side of regular client work.
NOTE: Support of Dreditor has been nominal for a while. It's still the preferred tool for enhancing Drupal's issue queue, but keeping track of what the "official" version is can be tricky. For now, we recommend https://dreditor.github.io/. There's also been work happening to incorporate many of Dreditor's features right into Drupal.org itself. See https://www.drupal.org/project/drupalorg/issues/1673278
Dreditor is a great community tool that assists with things like patch reviews, and generally interacting with the Drupal.org issue queue. Dreditor is not a Drupal module, but is a plugin script you use in your browser. In this lesson, Joe walks through how to get Dreditor installed (on Chrome and Firefox), and then shows you how to use it to make your work in the issue queues more efficient.
Additional resources
On the eve of DrupalCon Portland, we're happy to be able to get another free community video out, Installing and Using Dreditor. What's more exciting though, is that this video is part of our Community Tools workshop, and in an effort to spread Drupal community involvement further than where we can show up to run this free workshop, we're putting all of our materials and notes online for everyone to use freely, with the Community Tools curriculum.
A Workshop is Born
This Friday's podcast, The Mysterious Drupal Entity has Kyle, Joe, and Blake joined by Greg Dunlap to talk about Drupal entities. What are they? Why do we have them? What do they look like in Drupal 8? We look at it from both the developer and site builder sides to try and get a grip on a topic that leaves a lot of people scratching their heads.
Revisions are an important concept in a content management system. Keeping track of all the edits that have been made to a particular entity over the course of its lifetime. A paper trail or sorts. This lesson takes a look at what is required in order to make our Entities support revisions.
If you've worked with Drupal's node system and enabled revisions then you've seen Drupal's basic revision handling in action. Every time you save a node, it creates a new version of that node. You can roll back to previous versions and keep track of how a piece of content has changed over time. Entity API also supports the concept of revisions and in this lesson we're going to take a look at adding revision support for our video entities.
In order to take advantage of this feature, we'll need to modify our database schema to accommodate storing multiple versions of the same entity. We'll move all fields that we want to make "revisionable" into a separate table and set up a new unique version ID field so that we can keep track of revisions.
Then we will update our hook_entity_info
implementation to tell the API that we want to use the revision system and make some changes to the code in our VideoEntityController
so that when an entity is updated we save a revision instead of overwriting the current data.
Finally we'll need to write a simple UI for viewing older versions of our video entity because the Entity API does not provide us with this code by default.
If you've done any module development, you're probably familiar with hook_node_view and Drupal's arrays of doom. In this lesson we'll show you how to get easier access to the same information using entity metadata wrappers. We will use the entity_metadata_wrapper function to retrieve a new EntityMetaDataWrapper
object that provides an interface for easily accessing an entities property and field values. We'll use the getPropertyInfo
method to expose information about individual properties, and the getIterator
method to access fields that contain multiple values, such as tags. You'll see that by using meta data wrappers you can also access properties on referenced entities, such as the email address of the author of a node, without having to load that information independently.
Metadata wrappers also provide a consistent way to access properties common to all entities. For example, every entity in Drupal has a unique ID property or a human readable label, but these properties often have different names. User name vs. node title. Metadata wrappers allow you to access this information in a consistent way.
Additional resources
In order to make the most of the entity APIs integration with other modules, such as Views, we need to describe the properties of our entity in more detail. The API can infer some information about a property based on our schema but we need to tell it that the integer stored in the updated_at column is actually a timestamp. We will do this by implementing hook_entity_property_info()
and describing each of our entities properties. With these definitions in place you will be able to use the formatters in Views much like you would for individual fields on content types provided by core.
Note: Before you implement hook_entity_property_info()
the API makes an educated guess about each property but once you've defined a single property, the API expects you to define all of the properties for your entity. Use the .install
file in your module to get a complete list of the properties you need to define with hook_property_entity_info
. You can also define additional properties that aren't mapped to fields in the database (these can be used for static properties).
Additional resources
Well, today we finally wrap up our custom entity we've been working with in the Working with Entities in Drupal 7 series. To finish things up, we will be improving our entity property information, so that other parts of Drupal, like Views, can really make the best use of the data we have to present. We'll also explore entity metadata wrappers, which will make it much easier for us, and others, to get access to the info about our entities.
In a few short days we're heading to Portland, Oregon for the annual North American DrupalCon. We're really looking forward to seeing everyone there. We hope you'll stop by our booth (#408) and say "hello!". It will be a great opportunity for us to meet you, and for you to meet some of the personalities behind your favorite videos and blog posts. We're also gearing up for a great sale on annual accounts during the 'con, which you can take advantage of whether you are in Portland or online.
php[tek] Conference Is Next Week
Blog postWith the addition of Symfony to Drupal core, many Drupal developers are beginning to explore beyond the confines of our own amazing CMS. But where do you start? Conferences can be a great opportunity to step outside of your day-to-day time crunch and learn about new technologies. php[tek] is one of those great opportunities for module developers in the mid-west United States. This conference, now in its 13th year, has over 50 sessions spread over four days, May 14-17, in Chicago, Illinois.
This lesson takes a look at exposing the data in our entities to views. Lucky for us the entity API handles a lot of this for us. We’ll take a look at what we get for free, using the EntityDefaultViewsController class provided by Entity API module. We'll also discuss ways that we can customize this controller, which we'll tackle in a later lesson.