Planet Drupal

Subscribe to flux Planet Drupal - aggregated feeds in category Planet Drupal
Mis à jour : il y a 47 min 39 sec

DrupalCon News: A Wallet-Friendly Guide to DrupalCon

mer, 03/06/2015 - 19:44

DrupalCon Europe is one of the biggest and most important Drupal events that happens in the world every year. Since we, the local community, assume that you are already convinced to come to Barcelona in September, we would like to provide some tips to help you make your stay wallet-friendly. You can cherry pick any of these tips and use the ones that apply to your ideal DrupalCon experience.

Catégories: Elsewhere

Freelock : Behavior Driven Design in practice: A Behat test run

mer, 03/06/2015 - 19:24
Behavior Driven Design - Behat test run Video of Behavior Driven Design - Behat test run

For many years, we've organized our development around user stories. What exactly is each user trying to accomplish, and what does that look like when they try to accomplish those tasks?

For most of the past year, we've taken this a step further and adopted Behavior Driven Design. It's the same thing, really, with one fundamental difference: we have a tool to automate testing the user stories, and a more specific syntax to use that gets straight to the heart of the user story.

Behavior Driven DevelopmentBDDQuality AssuranceDrupal Planet
Catégories: Elsewhere

Vasily Yaremchuk: 7 Helpful Drupal Modules for Webmasters and Site Admins

mer, 03/06/2015 - 14:30

In this post I'm not going to describe extremely great modules that you must use on each your Drupal site such as Backup&Migrate module or Views module etc. This modules you can use in some separate cases but they can improve support of your Drupal sites!

Profile Switcher

If you have old site that was done many years ago and maybe upgraded for example from previous Drupal branch, say from D6 to D7. Than you can face with Distribution name Notice.

Notice: Undefined index: distribution_name in drupal_install_profile_distribution_name()...

You can google this issue and find solution, for example

UPDATE `my_database_name`.`system` SET `status` = '1',
`info` = '' WHERE `system`.`filename` = 'profiles/demo_profile/demo_profile.profile';
UPDATE `system`
SET `status` = '1'
WHERE `filename` = 'profiles/standard/standard.profile';

But it can not help in my case, when I use my own custom profile. But it does have sense to switch to Standard one to have easy Drupal core updates etc.

And I was happy when I found Profile Switcher.

I think when project start to save some time in development we start with some Drupal distribution to have already prepared set of modules. But during project life some modules are turned off and some new modules are installed. Thus we go far from initial Drupal distribution. And some times we find a decision to switch Profile name to Standard...

User One

I have my common practice to create for the client some separate admin user with abilities that they need only without any complex and extra admin items. Not qualified user can brake Drupal site if we provide him or her Drupal Superuser account. But sometimes we need to delegate to the client admin ability to manage users. And OMG, they can delete First Drupal user, for example. In this case User One module must be installed! After that your First Drupal user will be protected.

Bootstrap optimizer

I think each Drupal developer noticed that after some long development activity when you install and uninstall a lot of modules and themes trying to find optimal solution for your project than Drupal become crazy slow. It is due to some out of date data in "system" table. Bootstrap optimizer fix this issue.

Floating block

This module helps you to create menu that will be already on the screen or some permanently visible informational block, for example contact form. I have found it useful together with my new Anchors Panels Navigation module.

Node Convert

During production life time of each Drupal sites some new features appear and they require new type of content. Also some old nodes should be converted in new content types with new fields. For example several years ago I'm working on Music School site where we have Teacher profile content type. Client would like to add gallery ability for some separate VIP teachers. New Profile content type was created and some separate profiles was converted to new content type. By the way module Node Convert allow to set some mapping rules during conversion process.

Code per Node

I tried this module at first when I did video background in the header on one of page of the project of my client. It was separate page with video background and we no need to use this feature on any other pages. So I put VideoBG Jquery script, settings and paths to my HTML5 video files in the JS field in node edit form. This module provide an ability to customise pages directly from admin area without theme edit. I think it is reasonable to do when this custom JS or CSS behaviour strongly connected with current node content and thus we do not loose this behaviour when we will switch from one theme to another one.

Void Menu

I think every Drupal Developer use placeholder in menu that make Drupal point to the front page of the site. Void Menu module allow Drupal admins to set their own tags with some replacement rules. The most easy example, we can set in menu hashes pointed to anchors on the current page. I have found this module extremely perfect together with me new module Anchors Panels Navigation.

Blog tags: Planet Drupal
Catégories: Elsewhere

Annertech: 10 Questions to Critique a Web Design

mer, 03/06/2015 - 14:21
10 Questions to Critique a Web Design

Previously I wrote about the hidden power that resides in the hands of a designer. A design can make a project succeed or fail. But how do you know? Here are 10 questions you can apply to a supplied design, and the answers to them, or even the process of getting those answers, can bring a good design through to being a great design for your project. Remember, a design is just a picture until it is implemented, and it is important that the technical implementation is considered at the design stage.

Catégories: Elsewhere

Microserve: We've gained two Acquia Drupal Site Builder certificates!

mer, 03/06/2015 - 12:30
This now gives us a total of four certificates from the Acquia Certification Programme.

Myself and Rick took the Acquia Drupal site builder exam yesterday, and we're proud to say we both passed with scores of 90% and higher!

The exam tests you on your knowledge of the functionality of just Drupal core (inc. views), how you would use views and taxonomy, and about the Drupal community. Mainly asking "as a scenario what would you do when/if...".

What advice would we give to others taking the exam?

I felt there were more questions about RSS feeds and taxonomy than I expected. If you're thinking about taking this exam I'd recommend familiarizing yourself with how the Aggregator module and Views Feeds displays work, how to tag nodes with taxonomy, why you would tag them, and what happens when you add, change and delete term reference fields on custom content types. As many of other have said make a note to memorize the permissions table and know how you would reach out to the Drupal community for help, support and issues.

The exam is very Core focused so a few of the questions were tricky because it might not be the way many developers would necessarily do something, especially as many common tasks are achieved using contrib modules which the exam barely covers. Imagine these 2 scenarios for example:

How would you install and enable a theme? Most people would simplify this using Drush, but have you ever installed a theme via the Update manager?

How would you ask for help? If you're an agency developer do you know what other channels are available when you don't have a team to turn to?

Read through the questions carefully and if you have enough time at the end of the test, as many people said they do, double check all the questions and certainly check the ones your unsure of. I know I changed a couple when doing this as it seemed clearer when rereading the questions a second time. For example there were some answers that I initially chose because they were actually the method I would argue is best for achieving something, however there was often a single word clue in the question that made me change my answer after reading the question again.

Hope that helps and good luck if you're thinking of going for it too!

Kirsty Bewley
Catégories: Elsewhere

Modules Unraveled: 137 Training New Drupal Talent Before Hiring Them Into Your Company with Cameron Eagans - Modules Unraveled Podcast

mer, 03/06/2015 - 07:00
Published: Wed, 06/03/15Download this episodeTraining

While at DrupalCon recently, someone mentioned my recent podcasts about training and hiring Drupal talent, and mentioned that Cameron had been a part of a somewhat unique program to train new talent through a two month training program, with the intent to hire some of them. I was intrigued (and based on the great response of recent episodes on similar topics) I decided to get ahold of him, so here we are.

  • What company were you working for when you did this? And what was your role there?
    • ProPeople (Now FFW)
  • How did the idea come about?
    • We were inspired by a similar program they did in the Moldova office.
  • Who were you targeting?
    • Current college students, and recent grads
  • What did you hope to accomplish?
    • There were two goals. One: We wanted to be able to hire people in the Boise area. Two: To get our name out there, to university students, as well as the broader tech community in the Boise area so that when people were looking for work in the future, they’d look at ProPeople.
    • We weren’t looking for Drupal experts, we wanted them to come out with the minimum ability necessary to become a competent member of a team within ProPeople
  • How many people did you have participating at the beginning?
    • 70-80 applied
    • 12 were accepted (2 dropped out)
  • How many did you end up hiring?
    • 1 full time junior developer
    • 1 contractor
  • How did you promote it?
    • Craigslist, Boise State University CS department, Random encounter at the coffee shop
  • What did they participants do?
    • Clone Netflix and Basecamp
    • Wanted them to work as a team
    • Learn Features (getting config into code - turns out it’s more difficult than we thought)
    • Issues lead to Skype calls to talk about how something might be done better
  • What kind of interaction did you have with the participants?
    • Daily checking call with each member
    • Weekly check-in call with each team
Should others do this?
  • Was there enough of an ROI that you think Drupal shops should be doing more of this?
    • Fairly expensive in number of dollars spent (About $4,000 - from that came one junior developer, and one consultant, who have been there ever since). Compare that to a recruitment agency, where you can pay well over $4,000 each.
    • Great to see who is actually going to go out and learn what they need to know in order to accomplish their project vs. someone you might hire, and then later find out that they’re not a good fit.
  • Do you have any suggestions for companies that are interested in looking into running a program like this?
    • If you’re going to do this, you need to have someone committed to running the program. It’s not a no-commitment project. Having more than one would be even better.
    • One reason we chose to go the training route, is because ProPeople didn’t have a standard classroom style training program. I’d recommend having more structured content: What knowledge we want them to come out of the program with. The hands on stuff is great, but throwing someone into the deep end is a bit hit or miss. (Use Blink Reactions stuff)
Episode Links: cweagans on drupal.orgcweagans on Twittercweagans.netFlynnYouCompleteMe serverYouCompleteMe engine for VimTags: Trainingplanet-drupal
Catégories: Elsewhere

DrupalCon News: The Core Conversations Track Focuses on How Core Should Be

mer, 03/06/2015 - 00:27

Drupal 8 should be just around the corner by September, making it a good time to take a look back and see what worked well and identify how to improve for future cycles.

The Core Conversation track is not about how Drupal Core is now, but how it should be. With such timing, DrupalCon Barcelona Core Conversations are the perfect opportunity for sharing your thoughts and discussing how to move Drupal forward in the future!

Catégories: Elsewhere

Shomeya: Styling Bootstrap 3 Buttons in Drupal 7: Part 1

mer, 03/06/2015 - 00:20

One of the greatest differences between Bootstrap 2 and Bootstrap 3 is the out of the box look and feel. Bootstrap 2 had a lot more pre-built colors and states, whereas Bootstrap 3 is a little more barebones.

So we're going to cover adding the class to integrate the basic default buttons, and then in Part 2 cover how to implement some more pre-built styles the colors, and sizing etc.

Like most frameworks you just add the class of course...but where?

Read more
Catégories: Elsewhere

PreviousNext: Architecting a scalable Drupal build system with AWS ECS

mer, 03/06/2015 - 00:16

PreviousNext and our Continuous Integration (build system) have been on a journey for the past 3 years. We are now onto our 3rd generation and would like to share with you some of the concepts and technologies behind it.

Catégories: Elsewhere

Drupal CMS Guides at Daymuse Studios: Drupal Facebook Comments Social Plugin Module Tutorial

mar, 02/06/2015 - 23:48

Integrate Facebook Comments with your Drupal website with this tutorial: learn to use Facebook Comments Social Plugin module to share to user news feeds.

Catégories: Elsewhere

Marzee Labs: DrupalCon Barcelona: call for sessions

mar, 02/06/2015 - 20:00

Europe is again getting ready for the DrupalCon, the annual gathering of Drupal dev and business in Europe. This year we are playing a home game since the conference will be held in Barcelona!

We are helping out with the program and would like to invite you to submit sessions for the Front-end and Business and Strategy tracks. The deadline for proposal submission is 8 June midnight CEST, so don’t hesitate further and submit a session!

Credits: photo on Flickr by Moyan Brenn.

Front end track

Our own João Belchior is the front-end track chair. He is looking for sessions that inspire and excite front end developers to share their stories, from their favourite tools and frameworks to topics like typography or solving new design problems.

Read more in Front end branches out to inspire and excite.

Business & Strategy track

Together with Dagmar Muth from Amazee Labs, I will be helping out with the Business & Strategy track. We are looking for sessions on business diversification, growth, processes and resource planning, but also on company & team culture, distributed teams or digital nomads. The track is aimed at attendees looking for ideas and challenges from business owners, executives and project managers on how to manage a Drupal business in a successful way.

Read more in Talking Business and Strategy in Barcelona.

How do I propose a session?
  • The call for proposals closes on 8 June midnight CEST.
  • Decide on a topic. If you’re not sure how to structure your submission, check out these tips on how to get your session selected.
  • Submit your session on the event site. That’s it!

Any more questions? Don’t hesitate to reach out to me or João for help or advice!

Catégories: Elsewhere

Appnovation Technologies: DrupalCon 2015: An Appnovator’s POV - First Blood Part 2

mar, 02/06/2015 - 19:30

Like my colleague Kevin Moll stated in part 1 - what a great week!

Catégories: Elsewhere

Drupal core announcements: D8 User Manual proposal

mar, 02/06/2015 - 16:19

There's a new proposal to create a coherent, internationalized Drupal 8 User Manual, which Joe Shindelar (eojthebrave) discussed at DrupalCon Los Angeles recently. Because we want comments on the proposal, it's posted in the Documentation group (the Core group doesn't allow comments):

I thought some other groups might be interested, so I'm posting this quick note to let you know. Follow the link for all the details and discussions.

Catégories: Elsewhere

Cheeky Monkey Media: How to deal with IE(internet explorer) 11 render issues.

mar, 02/06/2015 - 16:00

I develop wesites on mac, so I usually don't have to deal with IE at all, since I use an excuse that I can't install IE on mac. Lately, I started adding IE testing to my skill set list, and playing around setting up multiple virtual machines for browser testing. You can read my blog post here on how to setup any IE on mac.

Anyway, recently I ran into a very interesting IE11 problem.

I want to share my finding here and hopefully you can learn from my mistakes.

IE is always a pain for web developer. Unless you are...

Catégories: Elsewhere

Agaric Collective: Filter Drupal Views results beyond what Views can do

mar, 02/06/2015 - 15:46

Drupal's Views module gives site builders a great deal of control in presenting lists of content, but sometimes greater control is needed. Fortunately, this greater control is available to a programmer. On a recent project we needed to filter items out of the results in a way the Views user interface could not. Here's how to go behind the wizard's curtain.

The need surfaced while working on the web site for MIT's Global Studies and Languages department, which uses Views to pull in data from a remote service and display it. The Views module provides a flexible method for Drupal site builders to present data. Most of the time you can configure your presentation needs through the UI using Views and Views-related contributed modules. Notwithstanding, sometimes you need to implement a specific requirement which is not available out of the box. Luckily, Views provides hooks to alter its behavior and results. Let’s see how to filter Views results before they are rendered.

Assume we have a website which aggregates book information from different sources. We store the book name, author, year of publication, and ISBN (International Standard Book Number). ISBNs are unique numerical book identifiers which can be 10 or 13 characters long. The last digit in either version is a verification number and the 13 character version has a 3-character prefix. The other numbers are the same. A book can have both versions. For example:

ISBN10: 1849511160 ISBN13: 9781849511162

In our example website, we only use one ISBN. If both versions are available, the 10-character version is discarded. We do this to prevent duplicate book entries which differ only in ISBN as shown in the following picture:

To remove the duplicate entries, follow this simple two step process:

  1. Find the correct Views hook to implement.
  2. Add the logic to remove unwanted results.

After reviewing the list of Views hooks, hook_views_pre_render is the one we are going to use to filter results before they are rendered. Now, let’s create a custom module to add the required logic. I have named my module views_alter_results so the hook implementation would look like this:

/** * Implements hook_views_pre_render(). */ function views_alter_results_views_pre_render(&$view) { // Custom code. }

The ampersand in the function parameter indicates that the View object is passed by reference. Any change we make to the object will be kept. The View object has a results property. Using the devel module, we can use dsm($view->results) to have a quick look at the results.

Each element in the array is a node that will be displayed in the final output. If we expand one of them, we can see more information about the node. Let’s drill down into one of the results until we get to the ISBN.

The output will vary depending on your configuration. In this example, we have created a Book content type and added an ISBN field. Before adding the logic to filter the unwanted results, we need to make sure that this logic will only be applied for the specific view and display we are targeting. By default, hook_views_pre_render will be executed for every view and display unless otherwise instructed. We can apply this restriction as follows:

/** * Implements hook_views_pre_render(). */ function views_alter_results_views_pre_render(&$view) { if ($view->name == 'books' && $view->current_display == 'page_book_list') { // Custom code. } }

Next, the logic to filter results.

/** * Implements hook_views_pre_render(). */ function views_alter_results_views_pre_render(&$view) { if ($view->name == 'books' && $view->current_display == 'page_book_list') { $isbn10_books = array(); $isbn13_books = array(); $remove_books = array(); foreach ($view->result as $index => $value) { $isbn = $value->field_field_isbn[0]['raw']['value']; if (strlen($isbn) === 10) { // [184951116]0. $isbn10_books[$index] = substr($isbn, 0, 9); } elseif (strlen($isbn) === 13) { // 978[184951116]2. $isbn13_books[$index] = substr($isbn, 3, 9); } } // Find books that have both ISBN10 and ISBN13 entries. $remove_books = array_intersect($isbn10_books, $isbn13_books); // Remove repeated books. foreach ($remove_books as $index => $value) { unset($view->result[$index]); } } }

To filter the results we use unset on $view->result. After this process, the result property of the view object will look like this:

And our view will display without duplicates book entries as seen here:

Before wrapping up, I’d like to share two modules that might help you achieve similar results: Views Merge Rows and Views Distinct. Every use case is different, if neither of these modules gets you where you want to be, you can leverage hook_views_pre_render to implement your custom requirements.

Catégories: Elsewhere Blog: Drupal behind reverse proxy made easy!

mar, 02/06/2015 - 15:25

There will be times when you will need your app to know the visitors IP. Either for debugging purposes or for functionality purposes.

Possible workarounds

If you are a newbie, you will probably go for something like this:

if ($_SERVER['REMOTE_ADDR'] == '') {
  // Your code here

If you are bit more experienced, you 'll do something like this:

if (ip_address() == '') {
  // Your code here
} The problem

Yes! That would do the work alright. But what will happen if your website is behind a reverse proxy? Varnish or Nginx? Or even behind advanced caching and proxy services like Cloudflare or Akamai? And what would you do if the server is not yours and you cannot install mod_rpaf on it? And it's 03:00 in the morning and your server administrator is asleep? None of the above approaches will reveal your visitors IP address!

The solution

But guess what! Drupal has a solution for that too.

The solution lays in the site/default/settings.php file at the reverse proxy configuration section.
All you need to do is follow these steps:

1. Comment out the line $conf['reverse_proxy'] = TRUE;
2. Put the known reverse proxy IPs in the following array. In case of Varnish or Nginx, the IP would normaly be the server's own IP.
In case of Cloudflare or any other service, you will need the IPs that the service uses, and store them in the array:
$conf['reverse_proxy_addresses'] = array('a.b.c.d', ...);
3. We store the header that the proxy uses to keep the visitors IP. By default is HTTP_X_FORWARDED_FOR but in case that it's not, you can easily find it by executing the following:

print '<pre>';
print '</pre>';

Check where is your IP and add the header to the variable: $conf['reverse_proxy_header'] = 'HTTP_X_CLUSTER_CLIENT_IP';

Follow the above and then the ip_address() function, will always return your visitor's IP address.

Good luck and keep it simple!

Catégories: Elsewhere

S. M. Bjørklund: How to migrate content from drupal 6 to 7 by using Migrate_d2d - Part 4 - nodes

mar, 02/06/2015 - 13:19

This series would be incomplete without also covering node migration. The example code is working code and should import data from drupal 6 to 7 if you have correctly configured your test setup by following the previously articles (part 1-3). Do not be scared by the code. It is more PHP defining stuff then "real" code containing a lot of logic and stuff.

Catégories: Elsewhere

Web Omelette: Creating pseudo-fields in Drupal 8

mar, 02/06/2015 - 09:01

In this article we are going to look at how we can create and use pseudo-fields in Drupal 8.

What are pseudo-fields?

Pseudo-fields are simple display fields that you can control from the display settings of a particular entity type. An example of such a field is the core Links field on the node or comment entities.

Why are they useful?

Pseudo-fields are great if you have some content or data that you need to render together with that of a particular entity. And since you don't want to be hacky and hardcode all of this inside a template or preprocessor, you can use pseudo-fields to expose some control over this to the UI. This means that you can use the core drag-and-drop functionality to control their visibility and position relative to regular entity fields.

Pseudo-fields are a great way to display data that is tightly coupled to the entities but is not part of them or their fields.

So how do they work?

There are 2 main steps we need to take in order to create a pseudo-field. First, we need to implement hook_entity_extra_field_info() which is similar to Drupal 7.

/** * Implements hook_entity_extra_field_info(). */ function my_module_entity_extra_field_info() { $extra = array(); foreach (NodeType::loadMultiple() as $bundle) { $extra['node'][$bundle->Id()]['display']['my_own_pseudo_field'] = array( 'label' => t('My own field'), 'description' => t('This is my own pseudo-field'), 'weight' => 100, 'visible' => TRUE, ); } return $extra; }

We mustn't forget to use the NodeType class at the top of the file:

use Drupal\node\Entity\NodeType;

With this implementation we are creating one pseudo-field called My own field that will show up on the display settings of all the node bundles. After clearing the cache, you can already see it if you go to the display settings of any node bundle you have.

The second step is making this field actually render something when the node is being viewed. For this we need to implement hook_entity_view() or any of its variants:

/** * Implements hook_ENTITY_TYPE_view(). */ function my_module_node_view(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode, $langcode) { if ($display->getComponent('my_own_pseudo_field')) { $build['my_own_pseudo_field'] = [ '#type' => 'markup', '#markup' => 'This is my custom content', ]; } }

And again, let's use the necessary classes at the top:

use \Drupal\Core\Entity\EntityInterface; use \Drupal\Core\Entity\Display\EntityViewDisplayInterface;

Above we went with the hook_ENTITY_TYPE_view() variant that applies to the node entity. Inside, we are being passed an EntityViewDisplayInterface display object which we can use to check whether or not our own component (the one we defined earlier) exists in this display. If it does, we add our custom data to the $build render array that is passed by reference. This check allows the user interface to determine the visibility of this component on each view mode, as well as the weight (position relative to the other components which can be either entity fields or other such pseudo-fields).

And that's about it. You can save, edit the display settings of your nodes, create view modes and specify exactly for which one and where this custom content should show up.

Hope this helps.

In Drupal 8 | Hooks var switchTo5x = true;stLight.options({"publisher":"dr-8de6c3c4-3462-9715-caaf-ce2c161a50c"});
Catégories: Elsewhere

DrupalCon News: Help Build the Site Building Track

mar, 02/06/2015 - 00:30

DrupalCon Barcelona is coming and everybody wonders if it also will bring us the Drupal 8 Release Party! Are you ready for it?

Getting ready for Drupal 8

It's time to start building sites and talking about the current Drupal 8. What can we do right now with it? What are its killer features?

Catégories: Elsewhere

Mediacurrent: Advanced Layouts with Flexbox

lun, 01/06/2015 - 21:47

If you’ve been doing web design and development for a while you may remember the days when creating website layouts involved tables or browser specific techniques. Things got a lot better when we began using floats for creating layouts and this proved to be extremely successful. In fact, this technique is still widely used by most developers and designers because it works well and it allows us to build pretty sophisticated layouts.  

Catégories: Elsewhere