Planet Drupal

Subscribe to Planet Drupal feed
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 17 hours 16 min ago

Danny Englander: Drupal 8 Development: 5 Things to Add to Your Theming Toolbox

8 May 2016 - 8:03am

My uncle used to say, "You have to use the right tool for the job." This is no different when it comes to Drupal 8 theming and development. I have been having an absolute ball learning and theming with Drupal 8 the past several months. You can read more about how I got inspired here. In this article, I will outline some of the tools and methods I have been using while I've been building a new Drupal 8 theme.

1. Twig Debugging

One of my primary tools for Drupal 8 theming is Twig debugging so you'll definitely want to enable this while building out a theme and site. Chapter Three wrote a great post on enabling Twig debugging so I won't rehash that here how to get it up and running.

Twig's debug output will really come in handy for printing out:

  • Theme hook names
  • All possible suggested template names
  • Existing templates being used
  • The full path of the current template in use

After you write your own theme hook, those new template names will also show up in the debug output.

<div class="postscript"> <!-- THEME DEBUG --> <!-- THEME HOOK: 'region' --> <!-- FILE NAME SUGGESTIONS: * region--postscript.html.twig * region--postscript-second.html.twig x region.html.twig --> <!-- BEGIN OUTPUT from 'themes/custom/hibiscus/templates/layout/region.html.twig' -->

Sample output from Twig debugging

2. Devel Kint

Kint, part of the Devel module for Drupal 8 is awesome for inspecting arrays that contain your entity info, field names, view modes, and more. Kint is similar to Devel Krumo but for Drupal 8. If you really want to dig in with theming, Kint will be invaluable, especially for writing custom preprocess functions, creating variables, and theme hooks.

3. Search Kint

Search Kint for Drupal 8 is similar to Search Krumo for Drupal 7. It extends Kint by giving you two additional functions that are huge time savers. The first is a search box and select list to search any arrays on the page. The second function is a "get path" box where you can easily copy an array path. This takes the guess work out of things, especially since Kint provides much more info than what we were used to in Krumo.

4. Drupal Console

Drupal Console is fast becoming one of my new favorites. This is an amazing tool which can perform dozens of Drupal 8 tasks efficiently in Terminal. I'm just getting started with Console but I really like it already. Console can import / export config, clear cache, generate module / theme scaffolding, generate entities, create nodes, and much more. There's even has a "learning" mode as well as some auto-complete functionality. So it does a lot of what Drush does but it goes beyond with much needed and added functionality. At this point, I am pretty sure I will be switching over to using Drupal Console instead of Drush.

module module:debug Display current modules available for application module:download Download module or modules in application module:install Install module or modules in the application module:uninstall Uninstall module or modules in the application

Just a few sample commands available out of dozens in Drupal Console

5. Drupal Template Helper

There is also now a Google Chrome plugin called Drupal Template Helper which moves all the your Twig debug output to a Chrome web inspector tab. This makes your main HTML inspection area a lot cleaner and easier to scroll through. I even got this extension running in Opera which has been my browser of choice lately for web development. Note, I've been using Opera for theming for a few reasons. It's built upon Webkit so it's the same familiar Web Inspector UI as Chrome that you're used to. Opera also seems faster, less buggy, and less bloated than Chrome.

Summary

This is just a basic rundown of my Drupal 8 Toolbox. I am sure I will pick up more tools as time goes by. Do you have any favorite tools I have not mentioned here?

Tags 
  • Drupal
  • Twig
  • Theming
  • Drupal Planet
  • Drupal 8
Categories: Drupal

Jay L.ee: Drupal BackgroundField Module Configuration Manual

7 May 2016 - 8:08pm

Yesterday I wrote a blog post on how to configure a Drupal module called Background Images Formatter, which is part 2 of the Drupal Background Images Module Configuration Manual. Today I'll continue with part 3 with a module called BackgroundField. Then tomorrow I'll finally reveal how to create clickable background takeover ads.

Tags: Drupal 7Drupal Planet
Categories: Drupal

Jeff Geerling's Blog: How to build your own Raspberry Pi Cluster

7 May 2016 - 7:53pm


The banana is for scale.

When I originally built the Raspberry Pi Dramble 6-node Pi cluster in 2014 (for testing Ansible with bare metal hardware on the cheap), I compiled all the code, notes, etc. into a GitHub repository. In 2015, I decided to take it a step further, and I started hosting www.pidramble.com on the cluster, in my basement office!

Categories: Drupal

ARREA-Systems: Our business solution runs on Drupal 8.1

7 May 2016 - 7:27pm
Our business solution runs on Drupal 8.1 Sun, 05/08/2016 - 10:27

 

Hello,

Our back-office management solution is now running on version Drupal 8.1. The live demo is updated with the latest version.

It has been a long run since the project was initiated while Drupal 8 was still under alpha stage. And there is still plenty of work to do.

One objective is to make a full distribution package including most of the current functionalities available in the demo version. Our main issue with this target is the lack of resources and time. Thus if any of Drupalists are enthusiastic about business process solutions and would like to contribute, they are welcome.

Categories: Drupal

DrupalEasy: Summertime, and the hiring is (Drupal)Easy

7 May 2016 - 3:18pm

It’s almost summer, and at DrupalEasy, that means it is almost Intern Season! Our Spring Drupal Career Online class is three-fourths of the way to graduation, and we have just three budding Drupalists who are looking for work experience through internships (the others are already spoken for!)  If you’ve got too much to do, and not enough capacity to do it, an intern might be just the ticket through our (Work Experience) WE Drupal Program.

We love sowing the Drupal Community with well-trained new talent, all of whom have already devoted hundreds of hours, thousands of dollars, and more than three months of their lives to learning, practicing, engaging and developing their passions for Drupal in their quest to become professionals.  We’ve found that they have a lot to offer organizations who can use their eager new Drupal passion and help them build really great first Drupal Experience entries on their resumes.  If you need some extra bandwidth, or have some tasks or projects suited to a new site-builder type, why not engage an intern?

Hosting an intern is also a great way to test out talent and take some of the lower-level workload off of senior developers (like taking care of your own site, or those simpler tasks you need to get done for your clients.)  Here’s the deal: you bring on a graduate of our Drupal Career training program, either paid or unpaid in mid-June.  They devote their new Drupal enthusiasm and best-practice foundational skills to your projects for 2 to 3 months while you give them some guidance and experience.  You and the intern then decide if they move on, or continue on as an (already indoctrinated) contractor or employee.

If you’d like to learn more, you can check out how we approach WE Drupal, fill out a Host Application (no commitment, just a way for us to learn what you are looking for)  or email me.  

Summer is just around the corner, so WE hope you don’t delay.

Categories: Drupal

DrupalCon News: We are sprinting - come join!

7 May 2016 - 7:17am

Extended sprints have officially kicked off at Launch Pad.  We will be here all day, so stop by and join.

The Extended Sprints are located at 643 Magazine Street.  The front door is set back a little bit.  When you arrive, please send @joelpittet a text so that he can come let you in the front door.

We have breakfast, lots of sunlight and a rooftop deck, so come join!

Thank you for sprinting.

 

Categories: Drupal

Jay L.ee: Drupal Background Images Formatter Module Configuration Manual

6 May 2016 - 7:51pm

Yesterday I wrote a blog post on how to configure a Drupal module called Background Images. Today I'll continue with part 2, and it's a simple one but essential as well, because this module doesn't even come with a README.txt file at all lol.

But before we begin, let's answer the million dollar question of why anyone would want to use this module:

A good example would be my use case where I run a membership website and want my members to be able to upload background images, because the Background Images module only allows people with admin access (specifically to admin/content/background-images) to enable background images at all.

Tags: Drupal 7Drupal Planet
Categories: Drupal

Darryl Norris's Blog: 4 New CKEditor Plugins For Drupal 8

6 May 2016 - 7:40pm


About a month ago I was testing a pull request (#1999) for Drupal Console that will generate boilerplate code to integrate a button plugin from CKEditor to Drupal 8. So apparently the integration to integrate a CKEditor plugin for Drupal 8 is very simple thanks to the great CKEditor API in Drupal 8. While testing this pull request (#1999) I ended up with 4 plugins in my computer and I decide to share the code in Drupal.org so people can use it.

CKEditor Smiley

CKEditor Loremipsum

  • Project Page: https://www.drupal.org/project/ckeditor_loremipsum
  • Plugin Description: This plugin allows to generate lorem ipsum sentence or paragraph easily, to use in your web content, for example, it can be very useful when you want to demonstrate a website or a portal.

CKEditor Video Detector

More
Categories: Drupal

ActiveLAMP: Adding CKEditor plugins to Drupal 8

6 May 2016 - 7:00pm

Drupal 8 has greatly improved editor experience out-of-the-box. It comes shipped with CKEditor for WYSIWYG editing. Although, D8 ships with a custom build of CKEditor and it may not have the plugins that you would like to have or that your client wants to have. I will show you how to add new plugins into the CKEditor that comes with Drupal 8.

Read more...
Categories: Drupal

Drupal Bits at Web-Dev: Drupal: Enable or Disable a View in Deployment.

6 May 2016 - 6:41pm

Drupal Hook Update Deploy Tools now (as of v 7.x-1.16) has the ability to enable or disable  a View from within a hook_update_N().  It handles validation to make sure that your request to enable or disable a View actually did what you asked it to do.

 

Add something like this to a hook_update_N in your custom deploy module.install
to enable some Views.

<?php
  $views = array(
    'some_view_machine_name',
    'another_view_machine_name'
  );
  $message =  HookUpdateDeployTools\Views::enable('$views');

  return $message;
?>

To disable some Views, it looks like this:

<?php
  $views = array(
    'some_view_machine_name',
    'another_view_machine_name'
  );
  $message =  HookUpdateDeployTools\Views::disable('$views');

  return $message;
?>

Here is an example of what your terminal would show after running the enable method above:

Categories: Drupal

Pages