Skip to Content

Drupal

FacetAPI Views Bridge

New Drupal Modules - 9 February 2016 - 9:48am

This glue module helps building SearchAPI Views that use Exposed Filters and Facet blocks.
For more Information see its Origin at #1797616: Marry facets and Views exposed filters and the Readme.

Categories: Drupal

Cryptic.Zone: Drupal 8 Cheatsheet for Developers

Planet Drupal - 9 February 2016 - 8:02am

It has been a few months since Drupal 8 was released and sites built with it are starting to crop up. I myself have had the pleasure of working with it, and more Drupal 8 projects are certainly on the horizon. From a developer's perspective, this version is substantially different from the previous one, and we will need to learn a handful of new ways of doing things. To ease the process, I have put together this list of how-tos with tasks that I commonly encounter during development. I hope you will find it helpful.

Categories: Drupal

Cookie Law Consent

New Drupal Modules - 9 February 2016 - 6:19am

An integration with Cookie Consent 2, a lightweight JavaScript library built by Silktide under the MIT licence. 3.5Kb min js.

For reference, there are other similar modules and old sandboxes out there:

Categories: Drupal

Commerce Guys: Commerce Guys Refocusing on Drupal Commerce as Platform.sh Becomes an Independent Company

Planet Drupal - 9 February 2016 - 3:26am

Commerce Guys has long been a leader in the development of e-commerce websites using Drupal, with our flagship Drupal Commerce project running on over 60,000 sites. We are now releasing alphas of Commerce 2.x for Drupal 8 every two weeks, with alpha3 up next. Our first production ready beta is scheduled for end of March, but developers are already using our standalone libraries for addressing and currency localization in production. Written to support Commerce 2.x, these libraries gave us a chance to share our knowledge and experience with the broader PHP world.

Over the last several years, we have also developed and launched a second generation Platform-as-a-Service for web applications, Platform.sh. With thousands of customers and an ever expanding list of supported technologies, Platform.sh is now becoming an independent company led by my two partners, Frédéric Plais as CEO and Damien Tournoud as CTO. With the full support of our existing investors, Platform.sh will use this move to grow and adapt to meet the needs of the new development communities it serves.

As the remaining founder, I have acquired Commerce Guys' Drupal Commerce business. I am succeeding Fred to manage the company as its President and will lead it to refocus on the development and support of Drupal Commerce and its community. My co-maintainers, Bojan Živanović and Matt Glaman, will continue to lead our software development and consulting programs respectively, with goals to achieve a Commerce 2.x release candidate by DrupalCon New Orleans (join us! : ) and to offer more strategic consulting and support to companies implementing Drupal Commerce.

Finally, we are adopting a new operating model whereby we deliver full Drupal Commerce projects through exclusive regional affiliates. I'm pleased to announce two launch partners, Actualys of Paris, France and Acro Media of Kelowna, BC, Canada:

  • Actualys has acquired Commerce Guys’ France-based services team and clients. They will deliver Drupal Commerce projects as Commerce Guys France and facilitate promotion and development of the software in France, Switzerland, Belgium, and Luxembourg.
  • Acro Media has acquired Commerce Guys’ U.S.-based services team and clients. They will deliver Drupal Commerce projects in affiliation with Commerce Guys in the United States and Canada and are dedicating developers and designers to the development of Drupal Commerce (and especially Commerce 2.x).

We expect to deliver strategic consulting services to these and other agencies and to deliver projects in territories not represented above. However, we do plan to engage additional affiliates in strategic territories throughout 2016.

Categories: Drupal

Better Jump Menu

New Drupal Modules - 9 February 2016 - 3:07am

Better Jump Menu is a module who provides:

  • The Drupal menu blocks with menu links in a select box instead of a list.
  • A views style plugins to display links into a select box.

This module has been made to cope with bugs in the original CTools implementation.

Categories: Drupal

Microserve: Caching beyond the norm in Drupal 7

Planet Drupal - 9 February 2016 - 1:19am
Caching beyond the norm in Drupal 7Feb 9th 2016

When developing in a drupal centric environment there are two general methods used to cache information on the system in modules, these can be used to persist while a page is loading using drupal static or for a longer periods using cache set and cache get.

I have used some other simple and alternative methods, and from reading notes before the drupal_static function declaration in bootstrap.inc; ways of getting even more efficient caching.

First I’ll address drupal static; it’s explained very neatly on this Lullabot article.

This is not necessarily always required. If you have a simple function in your code that you want to remember, a setting and speed is a must, you can just use a static variable.

function get_a_value($value_name) { static $function_settings = array(); if (!isset($function_settings[$value_name])) { //get variable from database and set it to $fetched_value $function_settings['$value_name'] = $fetched_value; } else { return $function_settings[$value_name]; } }

The static variable $function_settings stays persistent throughout the execution of your page, and the caching stays localised to your function / module.

Another way to do something similar to above, but to include the drupal_static function, would be to do an advanced drupal_static pattern (this is mentioned in the drupal_static notes).

function user_access($string, $account = NULL) { // Use the advanced drupal_static() pattern, since this is called very often. static $drupal_static_fast; if (!isset($drupal_static_fast)) { $drupal_static_fast['perm'] = &drupal_static(__FUNCTION__); } $perm = &$drupal_static_fast['perm']; //... }

This is taken directly from the notes. Here we assign a local static variable as in the previous example but if the local static variable is not set, we assign the local static variable to drupal_static. Now other functions and code outside of the function can call on drupal_static_reset and reset the locally declared static variable, but will still retain the efficiency of having the static variable locally as in the previous example.

The last method I would like to approach is by using a cache in an object:

class SomeClass { /** * * @var array */ protected $localCache = array(); public function getData($cid) { if ($data = $this->getCache($cid)) { return $data; } //nothing set //do time intensive task here and set to data $this->cache($cid, $data); return $data; } /** * * @param type $cid * @param type $data */ protected function cache($cid, $data) { $this->setLocalCache($cid, $data); cache_set($cid, $data, 'cache', strtotime('+7 days', time())); } protected function getCache($cid) { if ($data = $this->getLocalCache($cid)) { return $data; } if ($cache = cache_get($cid)) { return $cache->data; } return FALSE; } /** * * @param any $cid * @param any $data */ protected function setLocalCache($cid, $data) { $this->localCache[$cid] = $data; } /** * * @param any $cid * @return any */ protected function getLocalCache($cid) { return isset($this->localCache[$cid]) ? $this->localCache[$cid] : FALSE; } }

In this example, I do all the local caching within the object but if needs be, I will retrieve and save to the system cache if the required data is not saved locally. One thing I have omitted is methods to clear the local cache. This caching this essentially using a local property.

If you wanted to clear the cache externally, you could create a public method or a static method.

So that about wraps this one up. Have you used any different methods? Can it be done better? Tell me what you think in the comment section below.

Written by: Darren Whittington, Senior Developer

Microserve is a Drupal Agency based in Bristol, UK. We specialise in Drupal Development, Drupal Site Audits and Health Checks, and Drupal Support and Maintenance. Contact us for for further information.

Categories: Drupal

Deeson: Drupal Focal Point Module: Making the most of your images

Planet Drupal - 9 February 2016 - 1:15am

Focal point is a Drupal module that allows site administrators to select an important portion of an image to focus on.

It’s similar in many ways to the Image field focus module. But rather than giving a square box with crosshairs for focusing and another for cropping (which you can only do inside the focus area and can be quite confusing), focal point allows you to select a single point on the image to focus on. It is also fully compatible with the Media module.

User experience

Let's take a look at focal point from an administrator's perspective. The user can click on the image at any point which adds an icon over that particular area, representing the chosen focal point (see below).

From this, the administrator can then select the “Image preview” link below the image which will display a page with both the original image and how the image will look with the different image styles.

As you can see below, the image has now been focused upon the parrot on the right.

Setup and configuration

Firstly, you need to download and enable the focal point module (https://www.drupal.org/project/focal_point).

Upon enabling the module you will find a new image style called “Focal Point Preview”. This is used for the admin page and is the default preview style for setting the focal point. It rescales the image width to 250px with upscaling allowed.

You will also have two new image effects available for cropping “Focal Point Crop” and “Focal Point Scale And Crop” within the drupal image styles at admin/config/media/image-styles.

These both crop down to the point to which the user has selected on the image, and ensure that the chosen focal point will not be cropped out of the image.

Now you can create a new image style with one of these image effects, and then apply this image style to an image field within the manage display page of your content type. The images will then crop to the selection the user has chosen.

Media

To enable the compatibility with the media module, you should ensure that the “Media module image fields” setting at admin/config/media/focal_point is enabled.

Then, after adding an image via a field using the media browser widget, another step is provided in the media browser overlay. You can now add a focal point as you would in a standard image field.

You can also edit previously uploaded images to set an individual focal point.

Categories: Drupal

Menu Picture

New Drupal Modules - 8 February 2016 - 2:21pm

Module provides a field to upload an image and associate it with menu item. The module based on Managed File which gives the possibilities to choose style for an image and see the preview of uploaded file.

Categories: Drupal

Managed File

New Drupal Modules - 8 February 2016 - 12:23pm

Extend default managed_file widget, which is a part of Form API, by a set of useful features. See examples below to be involved.

Usage

These additional options for element with '#type' => 'managed_file' is come with this module:

Add the Browse files link before the file input to use one of available file managers:

// Also could be "ckfinder".
'#widget' => 'imce',

Tired to add an image styles for every managed file field?

Categories: Drupal

YAML block

New Drupal Modules - 8 February 2016 - 12:09pm

Provides a base block that allows block configuration settings to be edited and maintained using YAML.

Categories: Drupal

Video Embed Buto

New Drupal Modules - 8 February 2016 - 10:24am

This module provides a Buto handler for Video Embed Field.
Users can add Buto videos to their site by pasting the video's embed URL into a video embed field.
In the settings users can set width and height options of the video.
This module also can get thumbnail image from Buto for using it as a teaser image.

Categories: Drupal

DrupalCon News: You are the Coding & Development Track

Planet Drupal - 8 February 2016 - 9:40am

With core Drupal 8 now in full swing and the contrib space rapidly maturing, now is an excellent time to get more deeply involved with one of the world’s largest open-source development communities. The Coding and Development track is focused on educating developers on the latest techniques and tools for increasing the quality and efficacy of their projects.

Categories: Drupal

Ckviews

New Drupal Modules - 8 February 2016 - 9:21am

This module is a ckeditor editor plugin that enables users to insert views instances with argument directly in the ckeditor.

Installation

1. You need to Install these modules:
a. ckeditor
b. views

Categories: Drupal

blog.studio.gd: Views Plugins (Part 1) : Simple area handler plugin

Planet Drupal - 8 February 2016 - 2:56am
In this series I will show you how to make use of the new Drupal 8 Plugin system, we begin with a simple example : the views area handler plugins.
Categories: Drupal

blog.studio.gd: Overview of CMI in Drupal 8

Planet Drupal - 8 February 2016 - 2:56am
Some notes about the new Configuration management system in Drupal 8
Categories: Drupal

Janez Urevc: janezurevc.name runs on Drupal 8!

Planet Drupal - 7 February 2016 - 10:30pm
janezurevc.name runs on Drupal 8!

Drupal 8 was officially released last November. Since then I was planning to try migrating my blog from previous version of this great CMS. Drupal 8 comes with many improvements and I definitely wanted to leverage those also on my site.

Besides that I always used my personal site also as an experimental sandbox where I tested new Drupal modules, themes, technologies. Even if I am very active contributor to Drupal core and contributed modules and I've been working on an enterprise Drupal 8 project at my work I actually never migrated a site to Drupal 8 to this date. It was definitely something I wanted to try.

Previous version of janezurevc.name was running on Drupal 7. It is important to note migration from 7 to 8 isn't officially supported yet. Drupal 7 won't reach EOL for at least few more years, which makes this migration not critical. However, migrations from Drupal 6 have been fully supported since the day 8 was release. 6 will reach EOL this month, which makes migration from 6 to 8 an absolute priority.

Migration

My site is actually very basic. I am using content (2 content types), taxonomy (1 vocabulary), few contributed modules and that is really it. It turns out that every that I needed migrates reliably.

I started the process by reading official documentation. Besides Migrate and Migrate Drupal modules that come with core I needed few contributed modules. Drupal upgrade, Migrate tools and Migrate plus.

Migration itself was extremely easy. I installed Drupal 8 site, enabled migrate modules, started migration and waited for a few minutes. That's it! At least for core stuff. There are some glitches when it comes to contributed modules, but even that was fairly easy to resolve.

I can just thank to everyone that contributed to Migrate in Drupal core. You did an awesome job!

Theme

Drupal 7 version of my blog used Sky theme, which is unfortunately not ported to 8 yet. For that reason I needed to search theme repository and came across Bootstrap clean blog.

It looked nice and it had a Drupal 8 -dev release. Regardless of that it works as a charm. I even contributed minor patches and am planning to contribute few more.

How do you like the theme?

Modules

Like almost every Drupal website out there mine also uses few contributed modules. Let's see how that went.

Disqus

Disqus module has been ported as part of the Google summer of code project, which I've mentored in 2014. Module itself works very well. We changed architecture a bit; instead of having a custom database table we rather used a dedicated field type. This approach comes with many benefits. By doing this we're not limited to nodes any more. Disqus can be used on any entity type now.

Even if the port was there migration was not. I used this opportunity to dig into this part of Drupal a bit more. I wrote 7 to 8 migration support for everything Disqus needs. This includes general configuration, fields on entities, statuses and identifiers. My code is already committed and you can give it a try.

Did you try Disqus migration? Let me know how did it work for you.

Pathauto and Redirect

D8 ports are available on their Drupal.org project pages. They work as a charm. While core migrates existing aliases alias patterns, redirects and other configuration aren't supported yet. I had just 3 alias patterns and less than 10 redirects on my old site so this wasn't hard to fix manually.

If you meet @Berdir please buy him a beer. He did an awesome job porting this (any many other) modules.

Media

I was using media to embed images in WYSIWYG, which is using legacy embed token in Drupal 7. This part was unfortunately not ported yet. I was using this on lees than 10 places so I decided to fix this manually too. I used a simple SQL query to get node IDs of content that used legacy token. Then I simply changed it to standard tag with data-entity-* attributes, which Drupal 8 uses for it's own image embeds.

Markdown filter

Recently I found out that I prefer Markdown when producing written content. It doesn't interfere my writing flow nearly as much as WYSIWYG editors do. When using Markdown I focus on content instead of the appearance (for the same reason I really liked LaTeX during my university years).

Guess what? There is a module for that! Markdown filter comes with a text filter that will convert Markdown syntax to HTML when displaying it. And it also has a Drupal 8 port. Download, install, configure, use. It was as easy as that!

How does Markdown work for you? Do you prefer it over WYSIWYG editor as much as I do?

Other modules

I use few other modules on the page. All of them have some kind of Drupal 8 release:

All of them work without any problem. I downloaded, installed and configured them. Google analytics even comes with support for migration (which meant 3rd step was not needed).

Great work maintainers and contributors!

Other interesting stuff

I also used this migration to move my blog to a new hosting solution. Old blog was hosted on a VPS that I used in the past and am slowly moving away from it. Most of my sites and services are currently hosted on a dedicated server at Hetzner (they provide excellent value for a price so I'd definitely recommend them).

Recently I started using Docker for my development environments and I wanted to try it in production too (I mentioned I am (ab)using my personal site for experimenting, right? :)). As a result of that I'm hosting janezurevc.name in a Dockerized environment managed via Docker compose. Compose is super nice as it allows you to describe your infrastructure stack in a single YAML file. This allows you to commit it to a VCS repository and replicate infrastructure anywhere you want. But this is already a topic for some of my future posts.

Did you try to migrate your Drupal 6 or 7 sites to 8? How did it go? Which contributed modules are you using?

slashrsm Mon, 08.02.2016 - 07:30 Tags Drupal

View the discussion thread.

Categories: Drupal

Extra Field Formatter

New Drupal Modules - 7 February 2016 - 1:58pm

This module provides "field" formatters for extra fields, configurable through entity display, just like regular field formatters.

Bundled with this module is the module Extra Field Properties, which provides all entity properties as extra fields.

For multilingual aware extra field labels, see #1810178: field_info_extra_fields() is not language-aware, may return wrong values

Categories: Drupal

Colorbox Inline

New Drupal Modules - 6 February 2016 - 11:13pm

colorbox_inline allows you to open content already on the page within a colorbox. If you would like to load content via AJAX, you can use colorbox_load.

To create an element which opens the colorbox on click:

Categories: Drupal

_Config

New Drupal Modules - 6 February 2016 - 6:10pm

A simple API that makes it easy to keep custom configuration files inside custom modules.

Categories: Drupal

ARREA-Systems: Drupal 8 Guided Tour module

Planet Drupal - 6 February 2016 - 4:38pm
Drupal 8 Guided Tour module JK Sun, 02/07/2016 - 08:38

In Drupal 8 there is a Tour module in core that is very useful when it comes to web applications. In EK management tools we target professional users with small to medium scale companies. They usually have limited resources and time to spend on back office trainings. This is where the Tour module is very convenient to introduce functionalities to users who can quickly grasp the functions available to manage their back office.

We use the Tour functionality in our pages to guide users in their daily tasks like for instance in the form to create a new invoice or project page:

 

 

Categories: Drupal
Syndicate content


Google+
about seo