Skip to Content

Planet Drupal

Syndicate content
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 1 day 19 hours ago

Marzee Labs: Blueprinting Drupal projects

6 January 2015 - 11:00am

Planning the structure of a Drupal project is important. At Marzee Labs, we've developed some pretty robust methodologies over time to approach new Drupal projects, and in this post we'll outline some of these tools and processes that help us get off the ground in no time. While some of the topics are probably familiar (Drupal makefiles, installation profiles and such) you might learn some new tips and tricks to make your next Drupal project just that tiny bit more automated and run smooth.

The blueprint of any Drupal project: the makefile

Any project we start has to have a makefile. Full stop. Requiring that every module, library or theme we use - be it from drupal.org, github, or any other source - is documented in a single file, is a great way to quickly get the gist of any drupal project.

Even though you might want to version your contributed modules (more on this below), the Drupal makefile should form the backbone of your website.

As an example, check out the makefiles of our MZ profile, our boilerplate profile that can be used to kickstart a new project. For a Drupal profile that can be contributed and packaged on drupal.org, we typically have 3 different Makefiles, but now we’re only interested in mz.make.

Here are the instructions to make the link module.

projects[link][version] = 1.3 projects[link][subdir] = "contrib"

Everyone inspecting the site running this profile now knows that you are using the 1.3 version of the Link module.

Need to patch the link module because you encountered a bug or missing functionality? Sure thing. First we scan the drupal.org issue queue for patches. An example is this issue, with a working patch. We add this to our makefile, with a one-liner comment and a link to the issue on d.o.

projects[link][version] = 1.3 projects[link][subdir] = "contrib" ; Provide the original_url when loading the field. ; @see https://www.drupal.org/node/1475790#comment-7743415 projects[link][patch][] = "http://www.drupal.org/files/7.x-1.x-_link_sanitize-bandaid-1475790-16.diff"

And we rebuild our project to test the patch in our Drupal sandbox, passing --projects=link (and also --no-core since we don’t want to rebuild Drupal core)

drush make profiles/mz/mz.make --projects=link --no-core .

Or we download the nifty Drush Patchfile to apply patches directly and work with a patch file (our makefile, in this case).

If you want to use the latest development version of a module, you can also do that. If you do however, always specify the revision hash as well (you find it in the commit log), so you make sure you’re working with that specific development release that you tested.

projects[link][version] = 1.x-dev projects[link][subdir] = "contrib" projects[link][revision] = 7dc306c

Feel the power of this? You can quickly evaluate community contributed patches, roll your own (and contribute them as a Gist if they don’t fit on drupal.org), and not be dependent anymore on the module maintainers to publish that new release.

Since you also document every patch used, you’re making this knowledge available to the other developers in the team, to the reviewer of your Pull Request (if you are using the github branching model), or generally as part of the Git history of your project. You can often revisit your makefile to remove patches if they’ve been rolled out in a new release, and update your modules. Make this a habit and it will pay off eventually.

Bundling using profiles

All your custom code and modules, themes and libraries to be installed should be bundled as an installation profile, so your site can be installed over and over.

If you haven’t started organizing your sites as Drupal profiles, you probably should. Have a look at our boilerplate MZ profile. We use it to bundle our favourite contributed modules, but it also has some custom features and part of our common worfklows we find often useful. Other examples of great Drupal profiles are Commerce Kickstart or Drupal Commons.

Organizing your code in a git repository

It’s time to dive in the organization of your git repository (we love GitHub). If you’ve followed along so far, contributed code is documented in your makefile, while your custom features and code lives in your profile. It would be enough to version these, and that is the recommended way if you want to package your code as a profile or a base profile upon which to build new sites.

However, most of the time, you will also need to deploy off this repository directly, so we suggest that you store all your code - including Drupal core & contrib - in the git repository. Your directory structure could look like

profiles/mz/modules/contrib profiles/mz/modules/custom profiles/mz/modules/features profiles/mz/libraries profiles/mz/themes ... sites/default/settings.php sites/default/settings.prod.php sites/default/settings.test.php sites/default/settings.dev.php ... index.php ... README.md

We also store settings.php in the git repository, and include an if statement to load the right settings.phpdepending on the environment that is available.

Another advantage of versioning environment-dependent settings is that you can force certain variables to be set in code, e.g. for production you might want to add

// Caching settings $conf['page_cache_without_database'] = TRUE; $conf['page_cache_invoke_hooks'] = FALSE;

to your settings.prod.php, making all these settings directly available in git and thus for review by your peers, and it avoids having to wonder what setting is active on which environment

Finally, create a settings.local.php file that is loaded from settings.php, with your local database settings.

// For local development if (file_exists('./sites/default/settings.local.php')) { include_once('./sites/default/settings.local.php'); } What’s next?

Now that we have given an overview of our favourite project architecture in Drupal (makefiles, profiles, and github), some of the next topics we’d like to talk about our setting up a continuous integration pipeline (using Travis CI), writing a couple of Behat tests to assert your site works fine, and reviewing our worfklows with Github (pull requests, issues, releases).

Did you miss our “Coding as a Team” series? Check out pt.1: automation workflow using Phing, pt. 2: using content fixtures and pt. 3: code workflow.

Featured image credit: brianbutko / Flickr

Categories: Drupal

Drupal core announcements: This Month in Drupal Documentation - December 2014

6 January 2015 - 8:46am

Here's an update from the Documentation Working Group (DocWG) on what has been happening in Drupal Documentation in the last month or so. Sorry... because this is posted in the Core group as well as Documentation, comments are disabled.

If you have comments or suggestions, please see the DocWG home page for how to contact us. Thanks!

Thanks for contributing!

Since November 28, (our previous TMIDD post), 232 contributors have made 733 total Drupal.org documentation page revisions, including 8 people that made more than 20 edits (lolandese, Francewhoa, webchick, kreynen, YesCT, Pierre.Vriens, Wim Leers, and PsyCode) -- thanks everyone! Most of these people are seasoned Drupal contributors, but PsyCode is a Google Code-In participant who has been editing pages. That's great -- we love it when our old friends come back to help, and when new people get involved!

In addition, there were many many commits to Drupal Core and contributed projects that improved documentation -- these are hard to count, because many commits combine code and documentation -- but they are greatly appreciated too!

Documentation Priorities

The Current documentation priorities page is always a good place to look to figure out what to work on, and has been updated recently.

Of special note: We're trying to get the Help pages inside Drupal 8 updated -- check the priorities page and events section below on this page for details.

If you're new to contributing to documentation, these projects may seem a bit overwhelming -- so why not try out a New contributor task to get started?

Upcoming Events Report from the Working Group

The Working Group meets monthly via Google Hangouts, and our next meeting is January 14. Contact Boris if you'd like to join the meeting. We're currently discussing how we and the community can address several big problems:

  • The lack of documentation for Drupal in languages other than English.
  • The difficulty of locating documentation that answers specific Drupal questions.
  • The overwhelming size of Drupal documentation for newcomers (not knowing where to start).
Categories: Drupal

Blink Reaction: Getting up and VMing

6 January 2015 - 8:32am

Last time we overviewed virtualization and its advantages for Drupal developing. It was all theory stuff, so I’m sure you’re itching to actually get a VM going. Let’s get started.

Categories: Drupal

Gábor Hojtsy: 2014 in review from a multilingual Drupal perspective

6 January 2015 - 6:30am

Whew! 2014 was a fantastic year for the Drupal multilingual team. We had some great events with huge sprints, including but not limited to: Global Sprint Weekend, the amazing Drupal Dev Days Europe, NYC Camp, DrupalCon Austin, DrupalCon Amsterdam and BADCamp.

A fun fact about people on the multilingual team is that even though we usually turn out in big numbers at sprints, there are numerous great mentors among us, so we don't work on code that much at mentored sprints. We do a great job helping people get started and move into more serious core work though. Our most famous mentee this past year is 2014th Drupal 8 core contributor Holly Ross, Executive Director of the Drupal Association who contributed her first and second core patches fixing multilingual issues.

Categories: Drupal

Conocimiento Plus: Drupal 8 Web Services and Context Core (WSCCI) Initiative

6 January 2015 - 4:07am
Web services and mobile are more important than ever, and with that comes the need to have more flexible page and layout capabilities – Dries Buytaert Introduction The future is a world where content management systems need to output data to many more devices and integrate with more and more systems and services. Drupal 7 […]
Categories: Drupal

IXIS: Looking forward to a Drupaltastic 2015

6 January 2015 - 3:20am

It was an exciting and busy year here at Ixis in 2014 as we continued to build our portfolio of Drupal clients

Highlights have included celebrating our tenth birthday and building on and growing the team’s expertise which has allowed the company to win more clients across a variety of sectors. We also celebrated one of our best financial quarter since Ixis was founded in 2004. 

read more

Categories: Drupal

Blair Wadman: How do you create a single on/off checkbox field?

6 January 2015 - 1:29am

Simple on/off checkbox fields where you want the user to select or deselect a checkbox are a common requirement. Yet it is not so obvious how to create them in Drupal.

On/off checkbox fields are often used to toggle for things like:

Categories: Drupal

Nextide Blog: Standalone Drupal 8 script using Guzzle

5 January 2015 - 2:24pm

Drupal 8 will have web services as part of core which will provide native support for all entity types including custom entity types. Drupal 8 will have support for different serialization formats like HAL+JSON, XML and JSON.

A couple good article references:

Categories: Drupal

Pivots recommendations: Drupal Recommender API: Roadmap for 2015 and beyond

5 January 2015 - 9:54am

I have seen slow but steady adoption of the new release of Drupal Recommender API module over the past few weeks after the announcement. This post will explain my plans about future development of Recommender API in order to help the audience make informed decisions. This is also an update to an older post on 2012-2013 roadmap.

I will categorize all my development plans into three tiers.

Read more
Categories: Drupal

Lullabot: Lullabot's 2014 Year In Review

5 January 2015 - 9:43am

Wow! What a Year!

As we throw away the empty champagne bottles and start retraining ourselves to write a different year on our checks, it’s always a good time reflect upon the past year. 2014 was Lullabot’s 9th year in business and it was our biggest year ever. We contributed to projects for MSNBC, Pac-12, NBC.com, Bravo TV, Saturday Night Live, Tesla Motors, NAMM, CNBC, Hotwire, Harvard University, American Booksellers Association, Intel, Comcast, GE, Qualcomm, and Teach For America, amongst others.

Our project with The Tonight Show Starring Jimmy Fallon won a Creative Arts Emmy for Outstanding Interactive Program.

Next month’s GRAMMY night will mark Lullabot’s 5th year as part of GRAMMY.com. Over the years, we have been responsible for development and site performance. This year, however, Lullabot's design team takes charge of the GRAMMYs' site design and UX. It’s been really rewarding to work with the Recording Academy for so many years on such a high-profile project.

Categories: Drupal

Blink Reaction: Virtualizing your Drupal Dev Environment for Cleanliness and Consistency

5 January 2015 - 8:52am

Too many versions of PHP on your system? MAMP got you down? Can’t find that .ini file? Don’t fret, go Vagrant! Many Drupal developers use a web developer stack such as WAMP, Acquia Dev Desktop, or MAMP to host their projects locally. When working with multiple clients, your hard drive can turn into a dorm room nightmare of multiple copies of PHP, MySQL, and Apache in order to assure compatibility with the client. Instead, simplify and standardize your workflow — and your team’s — by using freely available virtualization tools.

Categories: Drupal

Tyler Frankenstein: DrupalCamp Michigan 2015

5 January 2015 - 8:43am

Let's get together for DrupalCamp Michigan 2015. This year the camp will be hosted at Henry Ford College in Dearborn, MI on Saturday January 31st. Please visit the camp's website for more details:

http://2015camp.michigandrupal.com/

Tickets are only $15.00, The deadline for session proposals is January 11th, and sessions will be chosen on the 12th. JetBrains will be giving away 3 personal PHPStorm licenses at the camp, so be sure to attend for a chance to win.

We hope to see you there, cheers and happy coding!

Categories: Drupal

Appnovation Technologies: Understanding Personalization

5 January 2015 - 8:32am

In recent weeks I have had the opportunity to work closely with some great opportunities along side our sales team allowing me time to explore some potential solutions way ahead of any full blown development cycle can kick off.

var switchTo5x = false;stLight.options({"publisher":"dr-75626d0b-d9b4-2fdb-6d29-1a20f61d683"});
Categories: Drupal

ThinkShout: The Power of a Collaborative Community

5 January 2015 - 8:00am

Originally published on NTEN.org on December 10th, 2014.

My Year in Drupal

I’ve been fortunate to attend some of the biggest Drupal events in the U.S., and I always walk away from them with plenty of food for thought. Months ago, NTEN afforded me the space here to sing the Drupal community’s praises and I haven’t stopped since. I’m constantly reminded of how much I value its existence. More recently, I flew down to San Francisco to take part in the Nonprofit Summit at BADCamp that I’d co-coordinated, where I got to hear from the Bay Area folks about Drupal and nonprofits in their neck of the woods.

Once Again, The Drupal Community is Awesome

Events like BADCamp remind of the value of discussion and the exchange of ideas. Struggling to find a solution? Look to your community. One of the reasons I so appreciate the Drupal community specifically is how wonderfully they collaborate. Out of resources? Speak up in your discussion group or start a thread on a forum and watch the outpouring of support and ideas. The next thing you know, you’re looking at a list of new modules and tools that you’ve never heard of, and they might be exactly what your site needs.

There’s something wonderfully exciting about being in a room full of people with the same idea: let’s create and use technology to help people. This kind of collaborative atmosphere can make even the tallest of technological hurdles seem surmountable. If you enjoy events like BADCamp for networking and learning about nonprofit tech, then there are a couple of other events you'll want to put on your calendar.

NYC Camp

If you are a fan of BADCamp, then NYC Camp is just your speed. It's a free, week-long Drupal conference in New York City from March 16-22, 2015. There's also a nonprofit summit on the Friday of that week, which you definitely won't want to miss.

Drupal Day at NTC

For the last three years, we've been coordinating Drupal Day at NTEN's Nonprofit Technology Conference, so I may be a little biased when I say this is an excellent opportunity to learn more about Drupal for nonprofits. You'll hear from Drupal experts as well as nonprofit technologists sharing their Drupal stories and successes. This is a chance to learn about what exactly goes into building a Drupal site and how you can leverage it to further your organization’s mission with case study-style presentations throughout the day. But it’s not just about code - it’s about everything else that goes into making a successful website: content strategy, user experience, responsive design, infrastructure, the whole nine yards. If you’re curious about taking that first step toward Drupal, this event is a great place to start - and get ready for a whole lot of excellent information.

This year, join us on March 3rd, the day before NTC, in Austin, Texas. Registration for Drupal Day is free when you purchase a ticket to NTC. If you’ve already registered for the NTC, but didn’t sign up for Drupal Day, never fear - just contact NTEN event staff and ask to be put on the registration list.

Never Stop Learning

I never cease to be amazed at how much I still have left to learn. I know I’ll never truly be done learning, as is the nature of technology. It’s always in motion, always evolving with us and our ideas. I’m constantly surprised by even the simplest of tools. For instance, if you’re organizing a meetup or hosting a summit of your own, it’s a great idea to provide attendees with a site for collective notes, like and etherpad. This is especially helpful if you have multiple sessions happening concurrently. That way, even if your attendees can’t attend every session, they can read their peers’ notes. One of the most rewarding parts of the BADCamp Nonprofit Summit for me was opening up our once-blank etherpad after the summit and finding pages and pages of notes, tools, and URLs from discussions throughout the day. In a matter of hours, we created an amazing nonprofit tech resource.

I really hope you’ll take the time to immerse yourself in a Drupal Camp or Drupal-themed event and really immerse yourself in this community. These camps are often highly affordable (or free, in the case of BADCamp and NYC Camp), so it’s just a matter of finding one near you. Need help with that part? Build-a-Module’s got you covered. Yes, that same site I mentioned months ago offers online Drupal training as well as a calendar of Drupal events all over the world.

I also hope those of you who are NTC-bound will consider adding Drupal Day to your schedule - it’s a wonderful introduction to the Drupal Community. Even if you can’t make it to NTC or Drupal Day, take a chance on a Drupal Summit. Meet new peers, exchange ideas and concerns, and join in on this ongoing conversation. When you speak up, you become part of the change we all need to make this community, and Drupal, even better.

Categories: Drupal

Code Enigma: Google Analytics Custom Events

5 January 2015 - 7:23am
Many Drupal sites use Google Analytics to capture statistics on page views, but often, that's as far as it goes. That's fine if the only events that you're interested in are page loads, but what about all the other user interactions that happen on pages? With a bit of extra work, we can capture statistics on those too using the custom events feature built into the Analytics API.
Categories: Drupal

Drupalize.Me: The Creative Process is Scary and That's Ok

5 January 2015 - 7:00am

Staring at a blank screen, notebook, or any other space flooded with emptiness can conjure feelings of worry, confusion, and definitely fear. Yet this is a ritual anyone who considers themselves a creative willingly puts themselves through on a regular basis. Some may dread these less than pleasant feelings, but I am sure there are also many who embrace them, and I am one of them. Full disclosure, creating something is a scary process for me, and that's ok. From beginning to final product there are plenty of uncomfortable moments that I find extremely beneficial and rewarding to a successful creative process. Hopefully after I share how these often referred to as negative emotions are helpful, you, too, will see how essential they are to your creative process, and why they should be embraced and not avoided.

Categories: Drupal

Drupal core announcements: No Drupal 6 or Drupal 7 core release on Wednesday, January 7

5 January 2015 - 6:30am

The monthly Drupal core bug fix release window is scheduled for this Wednesday. However, the last bug fix release was two months ago, and there haven't been enough changes to the development version since then to warrant a new release.

Upcoming release windows include:

  • Wednesday, January 21 (security release window)
  • Wednesday, February 4 (bug fix release window)

For more information on Drupal core release windows, see the documentation on release timing and security releases, and the discussion that led to this policy being implemented.

Categories: Drupal

3C Web Services: Introduction to the EntityForm Module for Drupal 7

5 January 2015 - 4:00am
The Entityform module allows you to build forms using any available fields from Drupal core or contributed modules. For example, you can create a form using the Address Field module to collect user addresses with properly formatted address fields that change dynamically for each country the user may select.
Categories: Drupal

Code Drop: Test Driving Drupal 8: Writing an Install Profile

4 January 2015 - 8:43pm

Recently I have been test driving some Drupal 8 development to get a feel for some of the new concepts and APIs that have been introduced. I find the best way to learn and get motivated about a new technology is to dive right into a fun side project, where you can be free to experiment and break things at your own leisure. You also have the advantage of selecting a set of features which touch a variety of APIs.

In this post I’ll go over the approach I took to building a Drupal 8 install profile and some of the issues I faced.

Install Profile

I decided to write an install profile in an attempt to keep HEAD up to date. This would allow me to replace core and reinstall my website and be more resilient to upgrade issues.

Categories: Drupal

Gizra.com: Hedley Generator - PhantomCSS and UI regression

3 January 2015 - 2:00pm

What's fun about having a tool like Hedley is that every new best practice we acquire can be easily added to our ever evolving, versioned, and codified knowledge base - and it's there for the community to use and improve.

So, as if it didn't have enough of best practices bundled in it already, we've taken another step to get PhantomCSS a "CSS regression testing" tool in.

PhantomCSS in action

Continue reading…

Categories: Drupal


Google+
about seo