Planet Drupal

Syndicate content
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 18 hours 34 min ago

Drupal Watchdog: The Angry Themer

Tue, 2014-12-16 10:38
Column

Sometimes CSS feels like it stands for “Complete Sh*t Show.”

Lucky for us, there’s a tool to help get our CSS under control. This tool is Sass; Simply Awesome Style Sheets. Well, actually: Syntactically Awesome Stylesheets.

Sass is a preprocessor for CSS. Just like PHP & Drupal create Drupal’s Very Rich and Enhanced Markup™, Sass does the same for CSS, but properly, by taking your .scss (sass) files and turning them into super .css files, with variables, functions, and other fancy powers.

.sass files -> [magic thingie] -> .css

Install Sass

Installing Sass on your machine is straightforward, if you’re not afraid of the terminal. Simply do a "sudo gem install sass".

Boom.

You’re ready to get Sassy.

But if the terminal gives you agita, you can install Sass with a GUI, a complete list can be found on sass-lang.com/install or LiveReload.com.

Here’s a video showing how this process works: http://wdog.it/4/1/video

Setup your Drupal theme


In order to make Sass work in your theme, you need:

  • a Ruby config.rb file, for configuration;
  • a Sass folder for all your Sass files;
  • a CSS folder where all your compiled CSS files will be created.
Say Good-bye to Your CSS Files

First, accept that once you convert your CSS files to Sass, you will never again have to look into the CSS folder.

Your days of fiddling directly with CSS are over, and everything is gonna be OK.

Categories: FLOSS Project Planets

3C Web Services: Creating a Faceted Search View in Drupal

Tue, 2014-12-16 09:43
Faceted Searching is a method that allows a user to apply multiple filters of varying dimensions to a list of items on your website. In this tutorial we'll show you how create basic search facets in Drupal using the Search API module.
Categories: FLOSS Project Planets

Digett: Which Base Theme We Use (and Why)

Tue, 2014-12-16 09:34

There are so many website themes, frameworks and opinions out there ... how do you decide which is the best foundation for your next project?

read more

Categories: FLOSS Project Planets

Drupalize.Me: Embed YouTube Videos with Media and Media Internet Sources

Tue, 2014-12-16 09:30

YouTube is a great service for storing and managing your videos. While this is handy, many people want to be able to display their videos within their own website as well. In this tutorial we'll see how the Media, Media Internet Sources, and Media: YouTube modules can help give you a nice, seamless way to integrate YouTube videos into your site, and give really nice control over how those videos look, along with some built-in media management tools.

Categories: FLOSS Project Planets

Paul Booker: Hiding view records based on the value of a new field

Tue, 2014-12-16 07:36
function mymodule_views_query_alter(&$view, &$query) { global $user; if (($view->name === 'coaches') || ($view->name === 'trainers')) { if (!in_array('trainer', $user->roles) && !in_array('admin', $user->roles)) { $view->query->fields['field_data_field_profile_hidden'] = array( 'field' => 'field_profile_hidden_value', 'table' => 'field_data_field_profile_hidden', 'alias' => 'field_data_field_profile_hidden' ); $join = new views_join; $join->table ='field_data_field_profile_hidden'; $join->left_table = 'users'; $join->left_field = 'uid'; $join->field = 'entity_id'; $join->extra = array( 0 => array('field' => 'entity_type', 'value' => 'user'), ); $join->type = "LEFT"; $join->extra_type = 'AND'; $join->adjusted = 'TRUE'; // add the join $view->query->table_queue['field_data_field_profile_hidden'] = array( 'table' => 'field_data_field_profile_hidden', 'num' => 1, 'alias' => 'field_data_field_profile_hidden', 'join' => $join, 'relationship' => 'users' ); $view->query->tables['node']['field_data_field_profile_hidden'] = array( 'count' => 1, 'alias' => 'field_data_field_profile_hidden' ); $view->query->where[2]['conditions'][] = array( 'field' => 'field_profile_hidden_value', 'value' => 0, 'operator' => '=' ); } } } /** * Implements hook_update_N(). */ function mymodule_update_7001(&$sandbox) { $uids = db_select('users', 'u') ->fields('u', array('uid')) ->execute() ->fetchCol(); foreach ($uids as $uid) { db_insert('field_data_field_profile_hidden') ->fields(array( 'entity_type' => 'user', 'bundle' => 'user', 'entity_id' => $uid, 'revision_id' => $uid, 'language' => 'und', 'delta' => 0, 'field_profile_hidden_value' => 0, )) ->execute(); } } Tags:
Categories: FLOSS Project Planets

Code Drop: Thoughts on taking the Acquia Drupal certification exam

Mon, 2014-12-15 20:52

Earlier this week I had the opportunity to be the first developer at Code Drop to sit an exam to become an "Acquia Certified Developer". I managed to clear the exam with the following results:

  • Section 1 - Fundamental Web Development Concepts: 87%
  • Section 2 - Site Building: 87%
  • Section 3 - Front end development (Theming) : 92%
  • Section 4 - Back end development (Coding) : 81%

Like many others who have done the exam, I will briefly run over my experience and thoughts on the whole process.

Categories: FLOSS Project Planets

Tag1 Consulting: yumrepos Puppet Module

Mon, 2014-12-15 15:12

Earlier this year we undertook a project to upgrade a client's infrastructure to all new servers including a migration from old Puppet scripts which were starting to show their age after many years of server and service changes. During this process, we created a new set of Puppet scripts using Hiera to separate configuration data from modules.

read more

Categories: FLOSS Project Planets

Drupal Association News: Meeting Personas: The Drupal Newcomer

Mon, 2014-12-15 14:01

 This post is part of an ongoing series detailing the new personas that have been drawn up as part of our Drupal.org user research.

Bronwen Buswell is a newcomer to Drupal. Based out of Colorado Springs, Colorado, Bronwen works as a Conference and Communications Coordinator at a nonprofit called PEAK Parent Center, which is dedicated to supporting the families of children with disabilities. While Bronwen’s role isn’t technical, she needs to use her company’s website as part of getting her work done.

“We’re federally designated by the US Department of Education, so we try to be a total one-stop shop information and referral center,” Bronwen said. “Families can call us about any situation related to their child, and we will either refer them to the right agency or provide what they need. We’re focused on helping families navigate the education and special education systems, and we serve families with children ages birth through 26, with all sorts of disabilities, including autism, down syndrome, learning disabilities, and so on."

Keeping Up With Technology

In the past few years, PEAK Parent Center’s website became very outdated, and this was a problem. Bronwen’s clients were very dependent on being able to receive assistance over the phone, as many of the resources that the center provides are not readily available online. When updates needed to be made, Bronwen and her company were forced to rely on their tech vendors to make changes to the website, as they were working with a custom solution rather than a CMS.

“Our website was pre-cutting edge, made by local vendors, all in HTML code and SQL database. We had excellent tech vendors who helped us create what we needed, and this was before the CMS options came along so it was really good at first. However, in the past 5 to 6 years, it has gotten really archaic, and we’re super reliant upon our vendors for updating our website. What’s simple in a CMS is complex for us,” Bronwen said.

After doing lots of research and working with the federal government to find the best solution for PEAK Parent Center and other centers like it, Bronwen and her colleagues decided to explore using Drupal to create a site template that could be deployed for PEAK Parent Center  and for other similar centers that it supports across the country.

“We're the technical assistance center for parent centers like ours in a 12 state region,” said Bronwen. “When [Drupal Association Executive Director] Holly Ross was at NTEN we started going to their conferences, which led us to launch a tech leadership initiative where we supported participating parent centers across the nation. As part of that, we got connected with great consultants and thinkers in tech, and we were asked by the US Department of Education to participate in the creation of website templates in 2 content management systems — Wordpress and Drupal — that could be used in other parent centers in the future."

Getting Experienced Assistance

With help from Aaron Pava and Nikki Pava at Alegria Partners, the staff at PEAK Parent Center has been learning to use their new Drupal website. Aaron has advised Bronwen and her colleagues every step of the way, from proposing solutions in the discovery process to walking Bronwen and her coworkers through specific tasks.

Occasionally, Bronwen encounters small problems due to updates or little glitches with distributions, which is why Aaron has encouraged her to get involved and do some training on Drupal. Unfortunately, most of Bronwen’s time is spent trying to get the website ready to launch, as she’s under pressure from the federal government and her board of directors to deploy the new site. Though Bronwen isn’t working on the technical side of the website, she’s busy populating it with content and making sure that it will be a useful tool for her clients.

“What I haven’t done is specific Drupal training,” said Bronwen. “I know about Lynda and Build A Module, but I’ve only had time to do sessions one-on-one with Aaron, for example, ‘Here’s how to upload content in this template.’

"I have learned a lot on Drupal.org, but it’s been primarily through Aaron sending me a link— for example, he’ll send me links about Red Hen since we’re exploring our CRM options— but I haven’t surfed around it much,” Bronwen added.

Areas For Improvement

Bronwen wishes there was a recommended Drupal 101 section on Drupal.org, something that would help content editors like herself learn to use the CMS better, but for now, she is limited to relying on more educated ambassadors for Drupal to point her in the right direction.

“It’s delicate to recommend vendors,” said Bronwen, "but it seems that the community is really powerful, and is certainly one of the most unique aspects that sets Drupal aside from other CMS options. Even a few vendors recommended by the community, or a recommend Drupal 101 lesson where you can go through it, go off and work in Drupal, and come back and get Drupal 201 would be really valuable for me.

“I know that there are local Drupal meet-ups that happen all over the country” Bronwen added. “[One group we talked with] told us that nonprofits can go to these events and say “I need this or that,” and some hardcore Drupal techie will take the work on pro bono. That was another factor that helped draw us to using Drupal — the availability of the community. It would be useful if there was more information on how to tap into those meetups, perhaps, when they’re happening."

Bronwen knows that the Drupal community is really powerful, and considers it one of the most unique aspects that sets Drupal aside from other CMS options. She is excited by the availability of the Drupal community, and is looking forward to interacting with it and working with them as she continues to run and improve PEAK Parent Center’s website.

Personal blog tags: drupal.org user researchpersona interviews
Categories: FLOSS Project Planets

Midwestern Mac, LLC: Highly-Available PHP infrastructure with Ansible

Mon, 2014-12-15 11:03

I just posted a large excerpt from Ansible for DevOps over on the Server Check.in blog: Highly-Available Infrastructure Provisioning and Configuration with Ansible. In it, I describe a simple set of playbooks that configures a highly-available infrastructure primarily for PHP-based websites and web applications, using Varnish, Apache, Memcached, and MySQL, each configured in a way optimal for high-traffic and highly-available sites.

Here's a diagram of the ultimate infrastructure being built:

Categories: FLOSS Project Planets

SitePoint PHP Drupal: AngularJS in Drupal Apps

Mon, 2014-12-15 11:00

Angular.js is the hot new thing right now for designing applications in the client. Well, it’s not so new anymore but is sure as hell still hot, especially now that it’s being used and backed by Google. It takes the idea of a JavaScript framework to a whole new level and provides a great basis for developing rich and dynamic apps that can run in the browser or as hybrid mobile apps.

In this article I am going to show you a neat little way of using some of its magic within a Drupal 7 site. A simple piece of functionality but one that is enough to demonstrate how powerful Angular.js is and the potential use cases even within heavy server-side PHP frameworks such as Drupal. So what are we doing?

We are going to create a block that lists some node titles. Big whoop. However, these node titles are going to be loaded asynchronously using Angular.js and there will be a textfield above them to filter/search for nodes (also done asyncronously). As a bonus, we will also use a small open source Angular.js module that will allow us to view some of the node info in a dialog when we click on the titles.

Continue reading %AngularJS in Drupal Apps%

Categories: FLOSS Project Planets

Cheppers blog: Apache Solr and Drupal - Part I: Set up Apache Solr to enhance Drupal search

Mon, 2014-12-15 10:40

Today most of the websites have search functionality. With the help of Apache Solr the time spent on waiting for a search result can be radically reduced. In this article we are going to set up a basic searching infrastructure on a *nix-based system.

Categories: FLOSS Project Planets

Drupal Commerce: Major improvements in addressfield 7.x-1.0-rc1

Mon, 2014-12-15 10:39

Many people know that addressfield hasn’t been the easiest module to maintain. There are over 200 countries in the world, each with its own addressing requirements. Addressfield attempted to provide a sane default for all of them, along with a plugin architecture for handling per-country customizations. But with so many countries, the list of needed improvements became never-ending, and the customizations themselves started gathering in only one plugin (address.inc), which quickly became impossible to maintain.

A radical change was needed, so after a lot of research we introduced a new plan for Drupal 8, along with a brand new PHP library we can depend on from addressfield 8.x-2.x. The new plan resolves around two powerful ideas:

  • The introduction of address formats, which hold information on how a country’s address and its form need to be rendered and validated.
  • The use of Google’s addressing dataset, freely available and built for Chrome and Android, with address formats for 200 countries.

The introduced solutions were obviously superior to anything we had before that, but Drupal 8 is still far from production, and we needed improvements on our Drupal 7 sites today, so we decided to try and backport as many concepts as we could into the 7.x-1.x codebase. The result of that is addressfield 7.x-1.0-rc1:

Read more...

Categories: FLOSS Project Planets

Annertech: Best Modules for Media in Drupal: How to Install and Configure Scald

Mon, 2014-12-15 10:19
Best Modules for Media in Drupal: How to Install and Configure Scald

In the first part of this series, “Scalable & Sustainable Media Management for Drupal Websites”, I talked about media management solutions for Drupal. Specifically, I am interested in managing large amounts of files in a reusable manner. The solution I like best at the moment is Scald.

Just so we don't get confused with some phrasing, Scald stores all media items as custom entities called "atoms"; Scald "contexts" are very similar to view modes.

Categories: FLOSS Project Planets

Liran Tal's Enginx: Drupal Performance Tip – “I’m too young to die” – know your DB engines

Mon, 2014-12-15 02:16
This entry is part 4 of 4 in the series Drupal Performance Tips

In the spirit of the computer video game Doom and its skill levels, we’ll review a few ways you can improve  your Drupal speed performance     and optimize for better results and server response time. These tips that we’ll cover may be at times specific to Drupal 6 versions, although     you can always learn the best practices from these examples and apply them on your own code base.

Doom skill levels: (easiest first)

1. I’m too young to die

2. Hey, not too rough

3. Hurt me plenty

4. Ultra-violence

5. Nightmare!

  This post is rated “I’m too young too die” difficulty level.

 

Drupal 6 shipped with all tables being MyISAM, and then Drupal 7 changed all that and shipped with all of its tables using the InnoDB database engine. Each one with its own strengths and weaknesses but it’s quite clear that InnoDB will probably perform better for your Drupal site (though it has quite a bit of fine tuning configuration to be tweaked on my.cnf).

Some modules, whether on Drupal 6, or those on Drupal 7 that simply upgraded but didn’t quite review all of their code, might ship with queries like SELECT COUNT() which if you have migrated your tables to InnoDB (or simply using Drupal 7) then this will hinder on database performance. That’s mainly because InnoDB and MyISAM work differently, and where-as this proved as quite a fast responding query being executed on a MyISAM database which uses the main index to store this information, for InnoDB the situation is different and will result in doing a full table scan for the count. Obviously, on an InnoDB configuration running such queries on large tables will result in very poor performance

Note to ponder upon – what about the Views module which uses similar type of COUNT() queries to create the pagination for its views?

(adsbygoogle = window.adsbygoogle || []).push({});

The post Drupal Performance Tip – “I’m too young to die” – know your DB engines appeared first on Liran Tal's Enginx.

Categories: FLOSS Project Planets

Drupal core announcements: Drupal core security release window on Wednesday, December 17

Sun, 2014-12-14 18:15
Start:  2014-12-17 (All day) America/New_York Online meeting (eg. IRC meeting) Organizers:  David_Rothstein

The monthly security release window for Drupal 6 and Drupal 7 core will take place on Wednesday, December 17.

This does not mean that a Drupal core security release will necessarily take place on that date for either the Drupal 6 or Drupal 7 branches, only that you should prepare to look out for one (and be ready to update your Drupal sites in the event that the Drupal security team decides to make a release).

There will be no bug fix release on this date; the next window for a Drupal core bug fix release is Wednesday, January 7.

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: FLOSS Project Planets

Drupal Association News: Introducing the Drupal.org User Personas

Sun, 2014-12-14 14:15


As part of our mission to reinvent Drupal.org, we’ve been digging deep to understand who uses the website and how. At DrupalCon Austin, we began the process of discovering the personas of users who visit Drupal.org: to do so, we interviewed numerous Drupal.org users and asked questions about how frequently they use Drupal.org, how they use the website, their frustrations with Drupal.org, the things they enjoy about the site, and how we can make it easier for people to learn, use, and connect on Drupal.org.

Once we had that data, we set about looking for patterns and common themes. We built categories where we grouped people's similar experiences and frustrations together, and at the end of the process we had come up with five distinct personas that can apply to everyone who visits Drupal.org. These personas detail our users’ familiarity with Drupal software and Drupal community, how they use Drupal.org, how they contribute (or don’t), and more.

The five personas that we drew up are based on proficiency in Drupal and the Drupal ecosystem. They are:

  • Newcomer: This person has heard of Drupal, but has never built a Drupal site and doesn’t know where to start.
  • Learner: This person knows a bit about Drupal and the general Drupal ecosystem. He or she may have built a Drupal website, but likely has used only a few contrib modules and hasn’t made any customizations.
  • Skilled: This person understands and is fluent in Drupal-specific terminology, can build a Drupal website themselves using contributed modules, themes or distributions, or with the help of Drupal service providers. She or he has spent a decent amount of time working with Drupal, and is lightly engaged with the community, often not directly, via some sort of liaison.
  • Expert: This person has a deep understanding of Drupal and the Drupal ecosystem, knows how to build advanced websites with Drupal. Expert typically has been working with Drupal for at least a couple of years, is actively engaged with the community online and via local/national events, and actively contributes back in a variety of ways.
  • Master: This person has pervasive knowledge of Drupal and the Drupal ecosystem. He or she knows how to build Drupal websites of great complexity, is deeply engaged in the Drupal community, knows and has access to other Masters. Usually this person has been using Drupal and been around the Drupal community for a long time.

Proficiency-based personas are a new facet through which we can look at our community. It’s important to note that these personas are NOT only about developers. All kinds of roles can be on different levels of this ladder — UX designers, project managers, and business owners can be Experts and Masters, just like developers and themers. Simultaneously, people can have different backgrounds and be experts in other areas, but when it comes to fluency in Drupal and Drupal ecosystem, they would be represented as Newcomers, or Learners, or any of the other personas.

How will we use personas?

User personas will guide feature prioritization and feature development for Drupal.org, as we improve the site to make it easier for our users to progress from Newcomers to Masters. There are a variety of different ways we can go about it, but since our resources are limited, we will focus on just a few critical areas that will have the biggest impact on the overall user experience. So, to start our work, we’ll be focused on removing barriers and helping our users move more easily from Learners to Skilled. We found that our users have great success moving from Newcomer to Learner today, whereas moving from Learner to Skilled is much more difficult, since so much of the project is focused on doing things “the Drupal way” and learning the processes. Our secondary focus will be on moving users from Skilled to Expert.

Growing our pool of Skilled users is crucial, because by doing so we grow the number of people who own and/or build websites using Drupal, thus grow Drupal adoption. On the path from Skilled to Expert is when our users begin to give back by contributing patches, writing documentation, building and sharing modules and themes, helping others in the issue queues, and bringing in their friends. By growing the number of Skilled and Expert users on Drupal.org, we’ll directly grow our community. It’s a win-win.

By growing Drupal adoption and growing our community, we directly support our mission and goals as an organization (you can read more about those in our 2015 Leadership plan and budget), and that’s why improving Drupal.org is one of our organizational imperatives in the coming year. The 2015 Drupal.org roadmap outlines the numerous ways we’re planning to do it.

As we use personas in our work, you may hear us refer to our “Primary” (Learner and Skilled), “Secondary” (Expert), and “Tertiary” (Master and Newcomer) personas — these distinctions correspond to the order of conversions we look to make easier, not to the users’ importance. Every Drupal.org user is important to us!

As we modify Drupal.org, we’ll be using the personas to help us make the experience for the whole community better. After all, that’s what these personas are — a representation of the entire Drupal community. To help bring our personas to life, we talked to five different community members, each representing one user persona. Over the next few days we’ll share the stories of each person’s unique Drupal journey so that we can see how they got to where they are now. We’d like to say a big thank you to each of our volunteers for sharing their personal stories — as always, they’ve reminded us how fantastic our community really is.

At the end of the series, we’ll close it all off with interviews with several prominent community members who will share their views on how personas can be used outside of Drupal.org development.

We enjoyed working on the user research project and are excited to share user personas with the Drupal community. As a reminder, you can view and download the full report. Take them, use them, go out and make great things!

Personal blog tags: drupal.org user research
Categories: FLOSS Project Planets

Friendly Machine: Drupal 8 and Backdrop CMS - A Brief Comparison

Sun, 2014-12-14 12:28

I recently had the opportunity to see Nate Haug deliver a presentation about the Backdrop CMS project and it's upcoming 1.0.0 release (Jan. 15). It had been a while since I had taken a look at Backdrop and I came away quite impressed with both its progress and direction.

Many of you reading this will be familiar with Backdrop, but for those of you who haven't heard of the project, it is the first fork of the Drupal project, and the source of a great deal of controversy and angst in the Drupal community.

Backdrop has been perceived as a threat by many Drupalists, but I think as we step through the features and approaches of the two projects, those fears will be at least somewhat allayed. My own take is that the two systems seem complementary instead of competitive.

As a bit of background for the origin of Backdrop CMS, Nate told the story of his reaction to the massive changes in Drupal 8. He realized that his own business, Webform.com, was going to have major issues with the upgrade path.

It was going to take a huge effort to upgrade his site - we're talking many, many months - to simply replicate the work he had already done in Drupal 7. He didn't want to throw away the huge investment he had already made in his business and start over. His solution to the problem was forking Drupal to create Backdrop CMS.

And then...all hell broke loose.

Feature Comparison

I'll set the controversy behind Backdrop aside and get straight into a comparison of the features. Keep in mind, however, I'm using the term "features" here a bit loosely. That's because I also want to talk about how Backdrop is managed as well as other differences between the two projects. This list is not exhaustive. It just has some of the things that seem to me the most significant or interesting.

Target Market

I know many will squirm uncomfortably when I say this, but the target market for Drupal 8 is large enterprises. By contrast, the target for Backdrop is small to medium size businesses and non-profits - really the original market of the Drupal project. As we go through this list, you'll see how this targeting plays out in some of the decisions the two projects have made.

Configuration Management

This has been widely touted as the killer feature of Drupal 8. If you've dreamed of having all the cool configuration management features in D8 available for Drupal 7, then Backdrop may be tempting because that is essentially what it offers. Instead of using YAML files to store configuration data, however, Backdrop uses JSON. Otherwise, it's pretty much the same.

Theming

Another one of the major additions to Drupal 8 is the Twig template engine. This is a big plus for many front-end folks and it's something that is not available in Backdrop at this time - and I'm not sure I would look for it in the near future. Backdrop currently uses the Drupal 7 PHPTemplate theme engine.

Responsive Images

As a front-end developer, I have a particular interest in this one. Drupal 8 includes the Responsive Image module, which is essentially a reworking of the Picture module in D7.

At this writing, Backdrop doesn't have a responsive image solution. I asked Nate about this and he's not a fan of the Picture module approach (he favors using srcset, something that may possibly be added in versions 1.1 or 1.2 of Backdrop), so if that is something you require, it will need to be added as either a custom or contributed module.

Contributed Modules

Speaking of contrib, most of you reading this will be familiar with Drupal's massive collection of contributed modules. The contributed modules for Backdrop CMS will be hosted on GitHub and managed similar to how the jQuery project organizes its plugin registry. I don't think there have been any ports as of yet (all the energy is going to the 1.0.0 release), so this is pending.

Some of you may have heard that Drupal 7 modules will be compatible with Backdrop. This isn't true, primarily due to modules needing to be rewritten to support configuration management. Porting a Drupal 7 module should be fairly straightforward, however. Instead of storing config in the variables table, it needs to be in JSON files. Here's a video that will help get you started.

As a quick aside, having Backdrop (and eventually the contrib modules) hosted on GitHub seems like it will be a more familiar and friendly environment for potential project contributors.

Project Organization

The "do-ocracy" that is the Drupal project has been much discussed lately. Nate has organized the Backdrop CMS project along the same lines as the Project Management Committee of the Apache project. That was very wise in my opinion. It bodes well for the project.

WYSIWYG

Another really nice thing in Drupal 8 is the inclusion of a default WYSIWYG editor. Love them or hate them, virtually every client wants one, so now with D8 you won't have to add one yourself for every project. As of version 1.0.0, Backdrop doesn't have this functionality, but look for it in version 1.1 or 1.2.

I remember Nate saying something about it being ironic that Backdrop was launching both without Twig or a WYSIWYG since he and Backdrop co-founder Jen Lampton had been instrumental in bringing those to Drupal 8.

I suppose I should mention that Backdrop minor versions - from 1.0 to 1.1, for example - will occur regularly at an interval of about three or four months. So for the features mentioned that may be in version 1.1 or 1.2, it means they can be expected in either late spring or late summer.

Panels and Views

How about Panels and Views in core? Yeah, I like it! And that's what you get with Backdrop. Drupal 8 provides Views in core, but not Panels. It may be a while before Panels is ready for D8, but it may also be a while before D8 is ready, so I guess that's not a problem.

System Requirements and Backwards Compatibility

It may seem odd to group these two, but this is one point where the intended audiences (enterprise vs small organizations) are put into stark contrast. For example, Backdrop is intentionally friendly to cheap hosting. Drupal 8, by contrast, is almost certainly going to use more server resources than Drupal 7, potentially causing issues for those on shared hosting plans. 

For large organizations, the cost of hosting is not a big deal, but for some small organizations, it can be. So a solution architected to work well with limited resources may be attractive and also serves to highlight the different approaches between the two projects.

With backwards compatibility, we see the same philosophical divergence. Drupal has never focused much on backwards compatibility, making it a pain in the ass (and often expensive) to upgrade across major versions. The benefit of that approach is that Drupal has been able to innovate without being constrained by past decisions.

Backdrop, however, places a lot of value on carefully managing change so that existing sites can be upgraded affordably. I would recommend looking at Backdrop's philosophy, because it's there where you really find the motivations for the project and how it differs (and will differ more in the future) from the Drupal project. From system requirements, to upgrade path, to reaching out to hear voices not found in the issue queue, Backdrop CMS is consistently friendly to the needs of the little guy.

Wrap Up

Again, this isn't a comprehensive list of all the features or differences between the two systems. There is an issue on GitHub that might be of some help in learning more as well as this Drupal 8 feature list.

To me, these two projects don't compete with one another. Sure, some enterprises may use Backdrop and many small organizations may use Drupal 8. But really, the changes in Drupal 8 are a move toward the enterprise and the talk around Drupal 8 has reinforced that message. Having an alternative for small organizations on a budget and with a need to preserve software investments isn't a bad thing.

You may politely leave any comments below.

Drupal
Categories: FLOSS Project Planets

Paul Booker: Updating a user role when a class (group) is flagged as finished

Sun, 2014-12-14 08:38
function mymodule_training_class_node_form_submit($form, &$form_state) { if ($form_state['input']['field_class_is_finished']['und'] == 1) { $nid = $form_state['values']['nid']; $query = db_select('og_membership', 'ogm') ->condition('ogm.gid', $nid, '=') ->fields('ogm', array('etid')); $result = $query->execute(); foreach ($result as $record) { $uid = $record->etid; _mymodule_training_class_assign_alumni_role($uid); } } } function _mymodule_training_class_assign_alumni_role($uid){ $rid = db_select("users_roles", "ur") ->fields("ur", array("rid")) ->condition('ur.uid', $uid, '=') ->execute() ->fetchField(); if (empty($rid)) { db_insert('users_roles') ->fields(array( 'uid' => $uid, 'rid' => ALUMNI, )) ->execute(); } } mysql> describe field_data_field_class_is_finished -> ; +-------------------------------+------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------------------------+------------------+------+-----+---------+-------+ | entity_type | varchar(128) | NO | PRI | | | | bundle | varchar(128) | NO | MUL | | | | deleted | tinyint(4) | NO | PRI | 0 | | | entity_id | int(10) unsigned | NO | PRI | NULL | | | revision_id | int(10) unsigned | YES | MUL | NULL | | | language | varchar(32) | NO | PRI | | | | delta | int(10) unsigned | NO | PRI | NULL | | | field_class_is_finished_value | int(11) | YES | MUL | NULL | | +-------------------------------+------------------+------+-----+---------+-------+ 8 rows in set (0.00 sec) mysql> mysql> describe og_membership; +-------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------------+------------------+------+-----+---------+----------------+ | id | int(10) unsigned | NO | PRI | NULL | auto_increment | | type | varchar(255) | NO | | | | | etid | int(10) unsigned | NO | MUL | 0 | | | entity_type | varchar(32) | NO | | | | | gid | int(11) | NO | MUL | NULL | | | group_type | varchar(32) | NO | MUL | | | | state | varchar(255) | YES | | | | | created | int(11) | NO | | 0 | | | field_name | varchar(255) | NO | | | | | language | varchar(12) | NO | | | | +-------------+------------------+------+-----+---------+----------------+ 10 rows in set (0.00 sec) mysql> select * from og_membership where gid=1304; +------+----------------------------+-------+-------------+------+------------+-------+------------+--------------+----------+ | id | type | etid | entity_type | gid | group_type | state | created | field_name | language | +------+----------------------------+-------+-------------+------+------------+-------+------------+--------------+----------+ | 8275 | og_membership_type_default | 1 | user | 1304 | node | 1 | 1402485115 | og_user_node | en | | 8276 | og_membership_type_default | 10106 | user | 1304 | node | 1 | 1402485280 | og_user_node | en | | 8277 | og_membership_type_default | 10113 | user | 1304 | node | 1 | 1402485286 | og_user_node | en | | 8278 | og_membership_type_default | 10114 | user | 1304 | node | 1 | 1402485292 | og_user_node | en | +------+----------------------------+-------+-------------+------+------------+-------+------------+--------------+----------+ 4 rows in set (0.00 sec) mysql> describe users; +------------------+------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------------+------------------+------+-----+---------+-------+ | uid | int(10) unsigned | NO | PRI | 0 | | | name | varchar(60) | NO | UNI | | | | pass | varchar(128) | NO | | | | | mail | varchar(254) | YES | MUL | | | | theme | varchar(255) | NO | | | | | signature | varchar(255) | NO | | | | | signature_format | varchar(255) | YES | | NULL | | | created | int(11) | NO | MUL | 0 | | | access | int(11) | NO | MUL | 0 | | | login | int(11) | NO | | 0 | | | status | tinyint(4) | NO | | 0 | | | timezone | varchar(32) | YES | | NULL | | | language | varchar(12) | NO | | | | | picture | int(11) | NO | MUL | 0 | | | init | varchar(254) | YES | | | | | data | longblob | YES | | NULL | | +------------------+------------------+------+-----+---------+-------+ 16 rows in set (0.01 sec) mysql> select * from users where uid=10106; +-------+----------------------+---------------------------------------------------------+------------------------------------------------+-------+-----------+------------------+------------+------------+-------+--------+------------------+----------+---------+------------------------------------------------+------+ | uid | name | pass | mail | theme | signature | signature_format | created | access | login | status | timezone | language | picture | init | data | +-------+----------------------+---------------------------------------------------------+------------------------------------------------+-------+-----------+------------------+------------+------------+-------+--------+------------------+----------+---------+------------------------------------------------+------+ | 10106 | user_authenticated_1 | $S$DBGDqh770IDr09aztKD8Ey8aNGxwx8iiCaYo/rGCcBpa5XzNKnDF | identity+user_authenticated_1@paulbooker.co.uk | | | full_html | 1401792983 | 1401794533 | 0 | 1 | America/New_York | | 0 | identity+user_authenticated_1@paulbooker.co.uk | NULL | +-------+----------------------+---------------------------------------------------------+------------------------------------------------+-------+-----------+------------------+------------+------------+-------+--------+------------------+----------+---------+------------------------------------------------+------+ 1 row in set (0.00 sec) mysql> select * from users where uid=10113; +-------+----------------------+---------------------------------------------------------+------------------------------------------------+-------+-----------+------------------+------------+--------+-------+--------+------------------+----------+---------+------------------------------------------------+------+ | uid | name | pass | mail | theme | signature | signature_format | created | access | login | status | timezone | language | picture | init | data | +-------+----------------------+---------------------------------------------------------+------------------------------------------------+-------+-----------+------------------+------------+--------+-------+--------+------------------+----------+---------+------------------------------------------------+------+ | 10113 | user_authenticated_2 | $S$DeG84e0QP/H2h2rGv6cw93krL3CDoQ6CZOzhiSQCZa4OpZOAeP21 | identity+user_authenticated_2@paulbooker.co.uk | | | full_html | 1402485227 | 0 | 0 | 1 | America/New_York | | 0 | identity+user_authenticated_2@paulbooker.co.uk | NULL | +-------+----------------------+---------------------------------------------------------+------------------------------------------------+-------+-----------+------------------+------------+--------+-------+--------+------------------+----------+---------+------------------------------------------------+------+ 1 row in set (0.00 sec) mysql> select * from users where uid=10114; +-------+----------------------+---------------------------------------------------------+------------------------------------------------+-------+-----------+------------------+------------+--------+-------+--------+------------------+----------+---------+------------------------------------------------+------+ | uid | name | pass | mail | theme | signature | signature_format | created | access | login | status | timezone | language | picture | init | data | +-------+----------------------+---------------------------------------------------------+------------------------------------------------+-------+-----------+------------------+------------+--------+-------+--------+------------------+----------+---------+------------------------------------------------+------+ | 10114 | user_authenticated_3 | $S$D4xWR53hWUcyoZmIuZOLv7K8oasOsPCmqWaQGT.kpMQiX9k7XpfD | identity+user_authenticated_3@paulbooker.co.uk | | | full_html | 1402485256 | 0 | 0 | 1 | America/New_York | | 0 | identity+user_authenticated_3@paulbooker.co.uk | NULL | +-------+----------------------+---------------------------------------------------------+------------------------------------------------+-------+-----------+------------------+------------+--------+-------+--------+------------------+----------+---------+------------------------------------------------+------+ 1 row in set (0.00 sec) mysql> select rid from users_roles where uid=10106; +-----+ | rid | +-----+ | 7 | +-----+ 1 row in set (0.00 sec) Tags:
Categories: FLOSS Project Planets

nielsdefeyter.nl: Setup Entity Translation the right way

Sat, 2014-12-13 08:36

This article contains a detailed instruction on how to setup the Entity Translation module for Drupal 7 websites.
Entity Translation is part of Drupal 8 core and its approach is to translate fields instead of full nodes/entities.

Goal of this tutorial is to set up a multilingual website that can be navigated in multiple languages by visitors and to enable the content to be easily manageable by editors / cms administrators.
To get multilingual right, it’s critical that you configure your content-types and fields with care and precision and upfront, because if content is already in your database it is almost impossible to change these configurations.
So let's go.

Categories: FLOSS Project Planets