Elsewhere

OSTraining: How to Use the AdvAgg Drupal Module

Planet Drupal - Thu, 20/08/2015 - 19:51

Over the last couple of years, I've seen one module appear on almost every high profile Drupal site.

That module is Advanced CSS/JS Aggregation, or AdvAgg, for short.

AdvAgg really helps to improve the frontend performance of your site. This module really helps to improve the aggregation and optimization of your site's CSS and Javascript files.

Here are two videos that will help you install and configure AdvAgg:

Categories: Elsewhere

Drupal Watchdog: Drush: The Swiss Army Knife for Drupal

Planet Drupal - Thu, 20/08/2015 - 18:21
Article

By now, if you have been using Drush for a while I assume you are comfortable with all the basics. (I consider the basics to be things like downloading modules or updating a site.) I also assume you are aware that Drush has plenty of other features built in, but you probably don't take advantage of them. In this article I want to show you a few things that are just as easy to use as the “basics” and only require a little upfront setup to use them. Once you learn them, they will quickly find their way into your daily workflow.

Shell Aliases

Consider how much time you spend typing out commands. Now think of all the commands you type over and over again. Next, think about all the commands that have a lot of options and how often you refer to help resources to remember which options you need to use. Wouldn’t it be better if we simplified those things? Conveniently, Drush allows you to do exactly that: create shortcuts or aliases in a file called drushrc.php. I'll refer to it as the command file later in this article.

Let's start with an easy example: the clear cache command. This command isn't very long but we can still improve on it. Plus, it's probably one of the most frequently used.

Edit your drushrc.php file; if it doesn't exist create it. It's typically in your home folder at:

~/.drush/drushrc.php

Add this line to the bottom of this file and save it:

$options['shell-aliases']['ca'] = 'cache-clear all';

We just added a shell alias. Now instead of typing this:

$ drush clear-cache all

You only need to type:

$ drush ca

That wasn't too hard, right? That was one line of code, and you just improved on an already very simple command.

Categories: Elsewhere

Raphael Geissert: Call for release goal: package reconsideration

Planet Debian - Thu, 20/08/2015 - 11:33
Based on a discussion around breakfast, and encouraged by the people at the table, I hereby call for a new release goal (or challenge, whatever you prefer to call it):


Every package maintainer should remove one of their packages from the archive.


It's dead simple. It is acceptable to adopt a package to replace the one that has been removed, or to add a new one to the archive.
For tracking purposes please include "for RG" (release goal) in the removal request to ftp.debian.org.


And how about a debconf challenge? how about filing over 100 removal requests before the end of Debconf 15 on Saturday night? blog about it, dent/twit about it, spam IRC about it!


The idea came up after discussing about how us as package maintainers refuse to remove our obsolete or unused packages. So yes, that may also include the very first package that you got into the archive.


Sad news, good news.
Categories: Elsewhere

Simon Kainz: vim in Heidelberg

Planet Debian - Thu, 20/08/2015 - 11:30

Following the tradition of Love Locks, apparently there is someone really in love with vim in Heidelberg!

Found at the Old Bridge in Heidelberg during DebConf15.

Categories: Elsewhere

Sune Vuorela: Debconf 2015 – 6

Planet Debian - Thu, 20/08/2015 - 09:48

There is more people with blue hair at Debconf than at an average Akademy. KDE – we need to do better :)

Categories: Elsewhere

Chapter Three: Decapitated Drupal: The Downsides of Decoupling

Planet Drupal - Thu, 20/08/2015 - 02:57

Anyone who has attended a Drupal event in the last few years has had plenty of opportunities to learn all about the technical details of implementing a headless Drupal site. If you haven't already been exposed to this concept the TLDR version is: Headless aka decoupled Drupal is the process of using your Drupal site as the backend for another framework, most typically a Javascript framework.



"The right time to add an abstraction to a design is at the point when you start feeling the pain of not having it."

- http://sam-koblenski.blogspot.com/2014/07/the-cost-of-abstraction.html

Categories: Elsewhere

Wuinfo: A Good Content Strategy Secures a Profitable Business

Planet Drupal - Wed, 19/08/2015 - 23:45

Small and medium-size businesses can benefit with a good content strategy backed by a content management system (CMS) like Drupal. The internet is evolving fast. A good content strategy helps business keep a close pace with the trend.

More and more people are using mobile phones to get information and connect with others. A CMS website can quickly turn into responsive design. A responsive website provides better user experience for mobile users. Hence, Google ranks a responsive website higher than none responsive ones.

It is beneficial for a business to have a long term and short term digital plan. It saves money in a long run. If a company has a consistent plan for next 5 to 15 years, it helps avoid costly overhaul of previously built software and redo anything just because it did not fit into a big picture.

Here is an example of my customer who is doing great in the travel insurance business. Their consistent content strategy help them take a lion share of a niche market, a Chinese travel insurance market.

They are focusing on Chinese travel insurance market. At the very beginning, the owner of the business Jun Niu has an excellent long-term goal for his business. He built a comprehensive Drupal based system for his insurance business. With Drupal powerful Multi-lingual support, he built a website having three languages. The website is serving as a primary marketing tool. Mr. Niu published unique content that are valuable for Chinese travelers to Canada. There is an online insurance quotation system built from a Drupal contributed module. With the quotation system, people can easily compare insurance policies from different insurance companies. They can place an insurance order online. Other than that, backend system catches other customers' leads.

A system built on Drupal is well SEO-tuned. Niu's website rank high in Google search result. Keywords like "Canada travel insurance" in the Chinese language is on the first page of both Google and Baidu. Their website rank high in the search result of other search engines. As I am writing this article, their keyword "Canada travel insurance" in Chinese rank #1 on Google search result and also on the first page of Baidu. It brings thousands of organic search visit and hundreds of high-quality leads every week. Without spending any other marketing dollars, the company doing great with the solid content strategy.

Mr. Niu's had the great vision at the beginning. He built his insurance business on a top of Drupal-based software system. Supported by an active and diverse community of people around the world, Drupal is an enterprise standard open source software. Mr. Niu's system serves as a marketing tool that bring hundreds of quality leads every week. The content management system lets Mr.Niu's employees easily publish blogs and articles. Recently, they hired us a Toronto Drupal shop for a main Drupal version upgrade.

If the software is a pillar of a successful business, building a system from Drupal is a cornerstone of it. A good content strategy secures a profitable business.

Categories: Elsewhere

DrupalCon News: Eating Vegan in Barcelona

Planet Drupal - Wed, 19/08/2015 - 23:17

DrupalCon attendees can enjoy their visit to Barcelona taking a walk around some of the many 

Categories: Elsewhere

Drupal.org frontpage posts for the Drupal planet: Drupal 7.39 and 6.37 released

Planet Drupal - Wed, 19/08/2015 - 22:45

Drupal 7.39 and Drupal 6.37, maintenance releases which contain fixes for security vulnerabilities, are now available for download. See the Drupal 7.39 and Drupal 6.37 release notes for further information.

Download Drupal 7.39
Download Drupal 6.37

Upgrading your existing Drupal 7 and 6 sites is strongly recommended. There are no new features or non-security-related bug fixes in these releases. For more information about the Drupal 7.x release series, consult the Drupal 7.0 release announcement. More information on the Drupal 6.x release series can be found in the Drupal 6.0 release announcement.

Security information

We have a security announcement mailing list and a history of all security advisories, as well as an RSS feed with the most recent security advisories. We strongly advise Drupal administrators to sign up for the list.

Drupal 7 and 6 include the built-in Update Status module (renamed to Update Manager in Drupal 7), which informs you about important updates to your modules and themes.

Bug reports

Both Drupal 7.x and 6.x are being maintained, so given enough bug fixes (not just bug reports) more maintenance releases will be made available, according to our monthly release cycle.

Changelog

Drupal 7.39 is a security release only. For more details, see the 7.39 release notes. A complete list of all changes in the stable 7.x branch can be found in the git commit log.

Drupal 6.37 is a security release only. For more details, see the 6.37 release notes. A complete list of all changes in the stable 6.x branch can be found in the git commit log.

Security vulnerabilities

Drupal 7.39 and 6.37 were released in response to the discovery of security vulnerabilities. Details can be found in the official security advisory:

To fix the security problem, please upgrade to either Drupal 7.39 or Drupal 6.37.

Update notes

See the 7.39 and 6.37 release notes for details on important changes in this release.

Known issues

None.

Front page news: Planet DrupalDrupal version: Drupal 6.xDrupal 7.x
Categories: Elsewhere

Petter Reinholdtsen: In my hand, a pocket book edition of the Norwegian Free Culture book!

Planet Debian - Wed, 19/08/2015 - 22:10

Today, finally, my first printed draft edition of the Norwegian translation of Free Culture I have been working on for the last few years arrived in the mail. I had to fake a cover to get the interior printed, and the exterior of the book look awful, but that is irrelevant at this point. I asked for a printed pocket book version to get an idea about the font sizes and paper format as well as how good the figures and images look in print, but also to test what the pocket book version would look like. After receiving the 500 page pocket book, it became obvious to me that that pocket book size is too small for this book. I believe the book is too thick, and several tables and figures do not look good in the size they get with that small page sizes. I believe I will go with the 5.5x8.5 inch size instead. A surprise discovery from the paper version was how bad the URLs look in print. They are very hard to read in the colophon page. The URLs are red in the PDF, but light gray on paper. I need to change the color of links somehow to look better. But there is a printed book in my hand, and it feels great. :)

Now I only need to fix the cover, wrap up the postscript with the store behind the book, and collect the last corrections from the proof readers before the book is ready for proper printing. Cover artists willing to work for free and create a Creative Commons licensed vector file looking similar to the original is most welcome, as my skills as a graphics designer are mostly missing.

Categories: Elsewhere

Andrew Cater

Planet Debian - Wed, 19/08/2015 - 21:33
Poetry for Debconf15 poetry night

Debian's reached the age of 22
I wish I could be there with you
In Heidelberg, fair German city
To share, in person, this my ditty

Rhonda's worked hard - the work is done
With poems now begins the fun
While others play cards or hack new code
Or dream of running down the road

Free software, arguments, warmth, good cheer
Too soon all over 'til next year
 All of the best are there / on 'Net
Here's hope that it's the best Debconf yet



Categories: Elsewhere

Aigars Mahinovs: Poetry night - Space

Planet Debian - Wed, 19/08/2015 - 21:07

A bi-lingual poem created on inspiration from Debconf15 and in honor of Debconf Poetry Night by Rhonda

Du ...

Du hast ...

Du hast apt ...

Du hast apt gebrochen!

Reconsider your disk usage,

And APT might work again.

(as usual - licenced as CC-BY V3+ or GPLv2+)

Categories: Elsewhere

Drupal Easy: Long Form Drupal Training For Long Term Success

Planet Drupal - Wed, 19/08/2015 - 20:33

It's that time of year again - the next session of the Drupal Career Online program is about to get underway. Interested in learning Drupal best practices, common development shop workflows, as well as a bunch of the tools that modern Drupal professionals use every day? Looking to expand your current development team but don't have the time or the resources to train existing or new staff? If so, the Drupal Career Online program was designed with your needs in mind!

This will be the seventh time we've taught our curriculum, and the ninth time overall that is has been used for long-form Drupal training (Acquia has used it for their Acquia U program). We're confident that it provides students with the knowledge and experience to compress the amount of time it takes to become a Drupal professional.

-->

read more

Categories: Elsewhere

Lullabot: A PHP Developer’s Guide to Caching Data in Drupal 7

Planet Drupal - Wed, 19/08/2015 - 20:30

If there’s one thing in programming that drives me up the wall, it’s patterns that I use once every few months, such that I almost remember what to do but inevitably forget some key detail. Lately, that has been when I’ve needed to cache data from remote web services. I end up searching for A Beginner's Guide to Caching Data in Drupal 7 and checking it’s examples against my code. That’s no fun at all.

After some searching for a different project, I found the Drupal Doctrine Cache project and thought "what if I could chain the static and Drupal cache calls automatically?" - and of course, it’s already done with Doctrine’s ChainCache class. ChainCache gives us a consistent API for all of the usual cache operations. The class takes an array of CacheProvider classes that can be used to cache data. When fetching data, it goes through them in order until it finds the object you’re looking for. As a developer, caching data in memory in a static cache is no different than caching it in MySQL, Redis, or anything else. On top of that, ChainCache handles saving and deleting entries through the entire chain automatically. If you update the database (and invalidate your cached data), you can clear the static and persistent caches with a simple $cache->delete(). In fact, as someone using the cache object directly, you might not even know that a static cache exists! For example, the ChainCache could be updated to also persist data in a local APC cache. Or, the persistent Drupal cache could be removed if it turned out not to improve performance. Calling code doesn't need to have any knowledge of these changes. All that matters is you can reliably save, fetch, and delete cached data with a consistent interface.

What does all this mean? If you’re already using Composer in your Drupal projects, you can easily use these classes to simplify any of your caching code. If you’re not using Composer, this makes a great (and simple) example of how you can start to use modern PHP libraries in your existing Drupal 7 project. Let’s see how this works.

Adding Drupal Doctrine Cache with Composer

The first step is to set up your module so that it requires the Drupal Doctrine Cache library. For modules that get posted on drupal.org, I like to use Composer Manager since it will handle managing Composer libraries when different contributed modules are all using Composer on the same site. Here are the steps to set it up:

  1. Install Composer if you haven’t installed it yet.
  2. Create a Drupal module with an info file and a module file (I’ve put an example module in a sandbox).
  3. In the info file, depend on Composer Manager: dependencies[] = composer_manager
  4. Open up a terminal, and change to the module directory.
  5. Run composer init to create your initial composer.json file. For the package name, use drupal/my_module_name.
  6. When you get to the step to define dependencies (you can modify them later), add capgemini/drupal_doctrine_cache to require the library. You can add it later by editing composer.json or using composer require.

When you enable your module with Drush, Composer Manager will download the library automatically and put it in the vendor folder. For site implementations, it’s worth reading the Composer Manager documentation to learn how to configure folder paths and so on.

Using the CacheProvider for a Static and Persistent Cache

We’re now at the point where we can use all of the classes provided by the Drupal Doctrine Cache library and Doctrine Cache in our module. In a previous implementation, we might have had caching code like this:

function my_module_function() { $my_data = &drupal_static(__FUNCTION__); if (!isset($my_data)) { if ($cache = cache_get('my_module_data')) { $my_data = $cache->data; } else { // Do your expensive calculations here, and populate $my_data // with the correct stuff. cache_set('my_module_data', $my_data); } } return $my_data; }

We can now replace this code with the ChainCache class. While this is nearly the same amount of code as the previous version, I find it much easier to read and understand. One less level of nested if statements makes the code easier to debug. Best of all, to a junior or non-Drupal PHP developer, this code doesn’t contain any "Drupal magic" like drupal_static().

function my_module_function() { // We want this to be static so the ArrayCache() isn’t recreated on each function // call. In OOP code, make this a static class variable. static $cache; if (!$cache) { $cache = new ChainCache([new ArrayCache(), new DrupalDoctrineCache()]); } if ($cache->contains('my_module_data')) { $my_data = $cache->fetch('my_module_data'); } else { // Do your expensive calculations here. $my_data = 'a very hard string to generate.'; $cache->save('my_module_data', $my_data); } return $my_data; }

If the calling code needs to interact with the cache directly, it’s entirely reasonable to return the cache object itself, and document in the @returns tag that a CacheProvider is returned. Your specific caching configuration is safe and abstracted, avoiding sporadic drupal_static_reset() calls in your code.

Interfaces are the Future, and they’re Already Here

Even if you prefer the Drupal-specific version of this code, there’s something really interesting about how Doctrine, a small bit of glue code, and Drupal can now work together. The above is all possible because Doctrine ships a set of interfaces for caching, instead of just creating raw functions or concrete classes. Doctrine is helpful in providing many prebuilt cache implementations, but those can be swapped out for anything - including a thin wrapper around Drupal’s cache functions. You can even go the other way around, and tie Drupal’s cache system into something like Guzzle’s Cache Subscriber to cache HTTP requests in Drupal. By writing our code around interfaces instead of implementations, we let others extend our code in ways that are simply impossible with Drupal-7 style procedural programming. The rest of the PHP community is already operating this way, and Drupal 8 works this way as well.

Do you know about other PHP libraries that are great at working with Drupal 7’s core systems? Share them here by posting a comment below.

Categories: Elsewhere

Axelerant Blog: How to build an amazing Drupal radio

Planet Drupal - Wed, 19/08/2015 - 20:00

We love our hackathons at Axelerant, and we are always trying to build something that helps spread happiness. We thought it would be nice to have an internal web-based online radio, where people would be able to listen to songs along with some fun social characteristics.

Thus, one of our hackathons saw us getting down to build a Drupal radio website, with the following features.

  • Ability to upload songs
  • Ability to dedicate a song to anyone with a message
  • Play a random song when the dedicated song queue is empty
  • Integrate the radio site with Slack, and display the current track being played
  • Display the Up Next queue
  • Build the radio site using only Drupal, without any radio streaming software

Described below is how we went about putting the various components of the online radio together.

Uploading a song on the online radio

We created a content type called Song with the following fields:

  • Song field of type File to upload music files
  • Art field of type Image, to upload the album art
  • Tags of type Term Reference to tag artists, genres, etc.
  • Duration of type Number to track the song duration

An interesting part was the song duration. The getID3 library helped us fetch the song duration, and so, in the content type song feature I created a hook that added song duration on the creation of a new song. As it is automatically calculated and added, the song duration field is hidden from end users.

Uploading a song on an online radio, built using only Drupal

Dedicating a song on the Drupal radio

We created a content type called Request with the following three fields:

  • Song field of type Entity Reference that points to the song nodes
  • Dedicated-to of type Entity Reference that points to the User to whom the song is dedicated
  • Message of type Text for the message he/she wants to dedicate.
  • Played-at of type Date to keep track of when the song started playing
  • Default-request of type Boolean to know if this node is a song that is played by default or if its a request.

After a request is saved, the resulting node would be added to a nodequeue. The fields Played-at and Default-request are hidden.

Dedicating a song on an online radio, built using only Drupal

The Magic

We created a method that simulated a constantly playing playlist. It did three things

  1. Check if the requested song is playing.
  2. If not, play it.
  3. If the song is done playing, remove it and pull up the next requested song and play it.

The detailed logic looks like this:

  1. Check if there are any songs in the node_queue.
  2. If there are any, then check if the first song has already started playing by seeing if the Played-at is set or not.
  3. If it is not playing, set Played-at field to the current time, which means that this song has started playing.
  4. If it is playing, check if the current time has passed the Played-at + Duration time of the song being played. If it has passed, it means the song is done playing.
  5. If the song is done playing, remove the request, populate Played-at field for the top request with the current time.
  6. If there is no request, get a node marked as Default-request and put some random song, update Played-at to the current time and add it to the top of the queue.

This above function would be called twice, once by the cron and once just before the page that serves the song would be rendered.

Whenever a new song would get pulled, the site would send a Slack channel notification.

The View

The now playing song is rendered by the Views module. The view displays whichever song is at the top of the node_queue. We wrote a tiny .tpl file to stream the song rather than display the link to the song file. We used the HTML5 <audio> tag to render the MP3.

There was one more hurdle that we had to cross before we were done - we wanted the song being heard by everybody to be in sync. If we had rendered as-is, everybody would start hearing the song from the beginning. To avoid this, we also rendered the Played-at field to the front-end.

Thanks to the HTML5 audio object’s CurrentTime attribute, we could start a song with an offset. A tiny .js file would compute the difference between the current time and the Played-at time, and add that as an offset to the audio object, and voila! The song starts playing with a certain offset, achieving a sync across requests, and simulating an actual online radio.

Once the song ends, the js callback would reload the page, and our magic function would run again. The latest song would be pulled up or a newly dedicated song will be rendered by the view.

The View - An online radio built using only Drupal

If no one is listening, the cron keeps playing the next song at random, and Slack keeps notifying us of the currently played songs.

Slack notifications for the online radio using Drupal

We do a lot more cool stuff like this Drupal radio at Axelerant. To join us, visit our careers page or contact sales so we can do this for you.

The post How to build an amazing Drupal radio first appeared on Axelerant.

Categories: Elsewhere

Drupal Watchdog: VIDEO: DrupalCon Los Angeles Interview: Fabian Franz

Planet Drupal - Wed, 19/08/2015 - 17:15

In an exclusive, late-night interview, the fabulous Fabian Franz (Technical Lead, Tag1 Consulting) dishes the dirt on big-pipe Drupal and drops a grenade on our favorite social media platform: “You know what?” he says, “FaceBook cheats!” Hey, I’m totally not surprised; I saw the movie.

Want more Fabian? Read my interview with him (“Baby Steps”) in Drupal Watchdog 5.01 and, while you’re at it, subscribe: https://drupalwatchdog.com/subscribe/2015.

Tags:  DrupalCon DrupalCon LA Video Interview Video: 
Categories: Elsewhere

Red Crackle: Inheritance

Planet Drupal - Wed, 19/08/2015 - 16:41
In this post, you will learn about inheritance in object-oriented PHP. You will understand when to use it and the benefits associated with its use. You will understand Method Overriding in PHP. You will also learn when to set the visibility of properties and methods to public, protected or private.
Categories: Elsewhere

Chromatic: Presenting at DrupalCamp Asheville 2015

Planet Drupal - Wed, 19/08/2015 - 16:11

Last weekend I enjoyed the awesomeness of DrupalCamp Asheville. The Asheville Drupal User Group did an amazing job once again. It was a great camp filled with positive people and smart sessions. This time around I was lucky enough to deliver my own presentation, SVG: How To Have Fun Making Your Site Look Hot!.

The session was filled with a great mix of people of all skill levels - from having little SVG exposure to people who employ it in all their projects. The talk catered to both as we reviewed everything from the basics of understanding SVG and getting it displayed on your site to more advanced topics like line-stroke animations and SVG filters.

This was my first presentation at a DrupalCamp, and it was very rewarding. I think everyone learned something, and it felt great to give back to a community that shares so much information on a daily basis.

Overall, the presentations were on point. A few sessions I attended that stood out were Bayo Fodeke and Mark Shropshire’s Decoupled Drupal with Meteor, Chris Russo’s Personal git workflow, for everyone! and Matt Davis’ Headless Challenges Answered: Weather.com's Presentation Framework.

Besides being a great camp, it’s located in Asheville, which is a true gem of the East Coast with vibrant arts, food and beer scenes. If you get the chance, you should definitely try to attend next year's camp. Whether you’ve never attended a camp or you’re a grizzled veteran, you’ll love the setting, the sessions, and best of all, the awesome people you’ll meet. See you in 2016!

Categories: Elsewhere

Drupal core announcements: Drupal 8 core updates for August 19th, 2015

Planet Drupal - Wed, 19/08/2015 - 16:06
What's new with Drupal 8?

Since the last Drupal 8 Core Update, Drupal 8 got a UI for responsive image mapping, a proposal for a new Drupal.org content model was put forward and a bunch of improvements were made to Drupal.org, notably: the first comment to an issue is now automatically generated to make it easier to see the original issue summary, test result output was improved, and it's now possible to test patches on PHP 5.4, 5.5, 5.6, and 7 simultaneously.

Some other highlights of the month were:

How can I help get Drupal 8 finished?

See Help get Drupal 8 released! for updated information on the current state of the software and more information on how you can help.

We're also looking for more contributors to help compile these posts. Contact mparker17 if you'd like to help!

Drupal 8 In Real Life Whew! That's a wrap!

Do you follow Drupal Planet with devotion, or keep a close eye on the Drupal event calendar, or git pull origin 8.0.x every morning without fail before your coffee? We're looking for more contributors to help compile these posts. You could either take a few hours once every six weeks or so to put together a whole post, or help with one section more regularly. If you'd like to volunteer for helping to draft these posts, please follow the steps here!

Categories: Elsewhere

Pages

Subscribe to jfhovinne aggregator - Elsewhere