Planet Drupal

Syndicate content - aggregated feeds in category Planet Drupal
Updated: 31 sec ago

Drupal core announcements: Media sprints in 2016 in Berlin, Prague and Munich

Thu, 11/17/2016 - 20:57
pLast week a href= Buytaert published our plan for media management in Drupal 8/a which details at least the immediate plans. The inherent limitation of file based attachment/image management in core is it does not mix well with remote media (Facebook embeds, videos, Digital Asset Management, etc.) and there is no library of media to browse to reuse existing media on the site. Therefore our short term goal is to add a base to support a wide varierty of media as well as a media library and support for embedding such media in posts in general./p pTo support this plan, we host online meetings every Wednesday at 2pm GMT in #drupal-media on IRC, but without focused time on implementing these, we are unlikely to succeed before the feature deadline of Drupal 8.3 at the end of January 2017. Therefore we are planning the following sprints for this year./p !--break--!--break--h3Dec 12-16 sprint in Berlin at Hubert Burda Media/h3 pHubert Burda Media (initiators of the Thunder distribution) is hosting us at a href=ße+7,+10785+BerlinPotsdamer Straße 7, 10785 Berlin/a for a sprint between December 12-16. Confirmed attendees include (in alphabetical order) a href= Globus-Hoenich (phenaproxima)/a, a href= Fritsch (chr.fritsch)/a, a href= Gigler (dietmarg)/a, a href=ábor Hojtsy/a, a href= Urevc (slashrsm)/a, a href= Cano Miranda (marcoscano)/a, a href= Todorovic (mtodor)/a and a href= Mortenson (samuel.mortenson)/a. Additionally a href= Wehner (dawehner)/a and a href= Weber (webflo)/a plan to attend part of the sprint./p pWe'll work on bringing media features to core (not on contributed modules). If you'd like to get involved, participation in person or remotely would be amazing. This single sprint will not be enough to complete our goals. We are looking to figure out what is still possible in January and need funding to make things happen. If you can sponsor future sprints, a href= out to Janez Urevc/a. This current sprint is funded by Hubert Burda Media, MD Systems, Acquia and Reinblau.Huge thanks to them!/p div style=text-align: center; margin: 2em 0;img src= alt=Potsdamerplatz, Berlin /br /a href= of nearby Potsdamer Platz by Wolfgang Staudt/a/div h3Nov 25 sprint at DrupalIronCamp/h3 pa href= is Prague is also hosting four days of sprints/a. a href= Urevc (slashrsm)/a plans to sprint on the details of the media plan on Friday, November 25th. There may be other media related activities at the sprints, connect with the sprinters./p h3Nov 30 - Dec 2 sprint at DrupalCamp Munich/h3 pHubert Burda Media also hosts the sprints before a href= Munich/a (sprints between November 30 - December 2, DrupalCamp on December 3-4). Several developers from Hubert Burda Media will sprint on both the core media goals and contributed modules. Look for a href= Fritsch (chr.fritsch)/a and a href= Todorovic (mtodor)/a./p Drupal 6 is unaffected by SA-CORE-2016-005

Thu, 11/17/2016 - 19:30
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpYesterday, spana href= was published along with a href= 7.52/a and a href= 8.2.3/a to fix the security vulnerabilities described in that security advisory./span/ppspanWe've received a number of e-mails asking us, When will the Drupal 6 patch for SA-CORE-2016-005 be released?/span/ppWell, the good news is that Drupal 6 is unaffected by the vulnerabilities described in that security vulnerability, so there will be no patch. We just wanted to officially let everyone know, so there was no longer any confusion or worry. :-)/ppThanks!/pp/div/div/div RNG 1.3: The Registrant Update

Thu, 11/17/2016 - 17:00
img src= alt=RNG 1.3: The Registrant UpdatepThis latest release for a href=[RNG]( brings two major features: The ability for stronganonymous users to register/strong for events. And the ability to strongcreate, and associate non-users/strong with events./p blockquote pemRNG is an event management module for Drupal 8 created in the spirit of a href= Registration/a (Drupal 7) and a href= (Drupal 6). Users can create registrations for events, and event managers can manage these registrations./em/p /blockquote pstrongNote:/strong This post discusses updates to the RNG project which are available in a beta release. See a href= issue/a for how to get RNG 1.3 beta./p h1 id=registrationformRegistration form/h1 pThe event registration form has been reworked into a re-usable Drupal element, whilst making heavy use of AJAX. The registrant selector now accepts multiple registrants. Registrants can also be modified after the registration is created./p video width=100% height=auto controls autoplay loop muted source src= type=video/mp4 /video hr video width=100% height=auto controls autoplay loop muted source src= type=video/mp4 /video pemAssociate multiple registrants with a registration./em/p hr video width=100% height=auto controls autoplay loop muted source src= type=video/mp4 /video pemCreate new registrants within the registration form./em/p hr video width=100% height=auto controls autoplay loop muted source src= type=video/mp4 /video pemModify the meta registrant form within the registration form./em/p h1 id=anonymousregistrantsAnonymous registrants/h1 pAccess control has been reworked to permit anonymous users to register for events. /p pa href= requires that all registrants for a registration are a Drupal entity. Since anonymous users do not correspond to a user entity, the a href= Contact/a project provides a way to create non-user registants in a similar fashion to how contacts work on your phone./p pSee main RNG Contact article: a href= Contact: Anonymous registrants for RNG/a./p h1 id=morefeaturesMore features/h1 ul liRegistrant entities now have bundles/li liAdded registrant type configuration entity/li liAdded control over which identity types can be referenced or created within each event type./li liAdded ability to specify minimum and maximum registrants per registration./li liAdded an interface to view and add a href= related fields/a./li liEvent settings pages now use the admin theme./li liAnd a href= other/a behind the scene changes./li /ul pemCover photo: a href=;W Crowd/a by whoohoo120. License CC BY 2.0/em/pimg src= height=1 width=1 alt=/

Last Call Media: Once around the Sun with Drupal 8

Thu, 11/17/2016 - 16:13
span class=field field--name-title field--type-string field--label-hiddenOnce around the Sun with Drupal 8/span span class=field field--name-uid field--type-entity-reference field--label-hiddena href= class=usernameAlan/a/span span class=field field--name-created field--type-created field--label-hiddenThu, 11/17/2016 - 10:13/span div class=field field--name-field-blog-image field--type-image field--label-hidden field__item img src= width=720 height=719 alt= class=image-style-blog //div div class=clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__itempThis Saturday, strongLast Call /strongstrongMedia/strongstrong /strongand the Drupal Community celebrate the one-year anniversary of the official release of Drupal 8.  It’s been an exciting, fast-paced year of applying this great tool to our client’s and our own business challenges.  We have been proud to participate in the community’s efforts to refine the platform, and we frequently find ourselves recommending Drupal 8 as the right tool for a large number of client //p/div

Unimity Solutions Drupal Blog: Global Opportunities - Drupal Today!

Thu, 11/17/2016 - 13:04
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpGlobal Opportunities with Drupal!br / Drupal Today is a much Larger Community with a Growing ecosystem, Evolved to be a mature Open Source Solution. All through this journey Drupal has stayed relevant, flexible amp; innovative. It’s amazing to see Drupal’s increased adoption in the Enterprise space. Drupal in India is growing not only in no but also in terms of contributions!/p /div/div/div

Wunderkraut Sweden Blog: Remove X-Frame options and set Content-Security-Policy

Thu, 11/17/2016 - 11:43
Out of the box Drupal 8 has the header of a page request set to X-Frame-Options: SAMEORIGIN, that means that many modern web browsers does not allow the site to be framed from another domain, mostly for security reasons. This is good in many cases, but some web browsers has problem with this, and  X-Frame-Options is deprecated in favor of using Content-Security-Policy.  So why do you need a header like that? It is mainly for protecting a site for what is called a href= Also, for some cases you want you site to be framed into another, and doing that out of the box with Drupal 8 is not possible in most modern web browsers if you don't alter the sites header in apache, nginx, varnish or in some other way. We are now going to look into doing in “some other way”, in this case with Drupal. I prefer using Drupal to control site headers because of the sites header is a part of the application.  This solution is… a href= class=views-more-linkRead More/a Blog: AGILEDROP: Drupal Camps in North America

Thu, 11/17/2016 - 09:27
a href= src= After political discussions about the elections in the United States are slowly cooling down and the jokes on Donald Trump getting elected circle around the web in a lesser extent, we decided that it is time to look at something else. It's time to present you Drupal Camps organized in North America. We already presented Drupal Camps, which took place in Africa and Asia and concluded that Drupal Camps and activities are far more spread in Asia than in Africa. However, we expected that North America can offer a little bit more. We were right again. After we discovered that so many websites run… a href= MORE/a

Four Kitchens: Migrating a Drupal 7 Site with Migrate Drupal

Wed, 11/16/2016 - 23:51
div class=field-lead-image img typeof=foaf:Image src= width=800 height=300 alt=NYU Wagner - Tech Report / /div div class=field-body pOne of the things that any Drupal developer does for just about every client is migration. Learn how to speed up migration development… a href=[…]/a/p /div

Drupal Blog: Drupal 8.2.3 and 7.52 released

Wed, 11/16/2016 - 19:11
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenp style=position: inherit;Drupal 8.2.3 and Drupal 7.52, maintenance releases which contain fixes for strongsecurity vulnerabilities/strong, are now available for download. /p !--break--pSee the a href= 8.2.3/a and a href= 7.52/a release notes for further information./p div style=text align: center; margin: 2em;a href= class=link-button style=margin: 0 0 0.6em 0;spanDownload Drupal 8.2.3/span/abr /a href= class=link-buttonspanDownload Drupal 7.52/span/a/div p style=position: inherit;stronga href=/upgrade/Upgrading/a your existing Drupal 8 and 7 sites is strongly recommended./strong There are no new features nor non-security-related bug fixes in these releases. For more information about the Drupal 8.2.x release series, consult the a href= 8 overview/a. More information on the Drupal 7.x release series can be found in the a href= 7.0 release announcement/a./p div style=float: right; padding: 0 0 2em 1em; margin-left: 2em; width: 35%; border-left: 1px solid #cdcdcd; h2Security information/h2 pWe have a a href=/securitysecurity announcement mailing list and a history of all security advisories/a, as well as an a href=/security/rss.xmlRSS feed with the most recent security advisories/a. We strongstrongly advise Drupal administrators to a href=/securitysign up/a/strong for the list./p pDrupal 8 and 7 include the built-in Update Manager module, which informs you about important updates to your modules and themes./p h2Bug reports/h2 pBoth Drupal 8.2.x and 7.x are being maintained, so given enough a href=[]=8amp;categories[]=1bug fixes/a (not just a href=[]=1amp;categories[]=1bug reports/a) more maintenance releases will be made available, according to our a href= release cycle/a./p /div h2Change log/h2 pDrupal 8.2.3 is a security release only. For more details, see the a href= release notes/a. A complete list of all changes in the stable 8.2.x branch can be found in a href= git commit log/a./p pDrupal 7.52 is a security release only. For more details, see the a href= release notes/a. A complete list of all changes in the stable 7.x branch can be found in a href= git commit log/a./p h2Security vulnerabilities/h2 pDrupal 8.2.3 and 7.52 were released in response to the discovery of security vulnerabilities. Details can be found in the official security advisories:/p ullia href=/SA-CORE-2016-005Drupal Core - Moderately Critical - Multiple Vulnerabilities - SA-CORE-2016-005/a/li /ulpTo fix the security problem, please upgrade to either Drupal 8.2.3 or Drupal 7.52./p h2Update notes/h2 pSee the a href= and a href= release notes for details on important changes in this release./p h2Known issues/h2 pSee the a href= release notes/a or a href= release notes/a for a list of known issues affecting each release./p /div/div/div

Valuebound: Create Custom content type programmatically using Configuration API in Drupal 8

Wed, 11/16/2016 - 18:08
pDrupal 8 has quality of utility tool could help anyone to develop custom module box. One of the tool is Drupal Console, where any developer can follow the Terminal Command and generate the boilerplate for source code. Which help us to reduce time to write chuck line of code. And also help us to overcome with error rate to produce zero marginal error. Kind of typo amp; syntax error ;) . if you haven’t aware of Drupal Console then just go through it by installing on your local Drupal 8 instance. For fresh code like creating block or user or view or node I will suggest you boilerplate code. But as a New learner my suggestion would be always to write line by line code./p pHere is the command that you need to generate Custom Content type using Drupal Console  emstronggenerate:…/strong/em/p

Redfin Solutions: Redfin's Front-End Shell: Bundler, Susy, Compass, Breakpoint, and more!

Wed, 11/16/2016 - 16:51
div data-history-node-id=7 class=node node--type-blog-post node--view-mode-teaser ds-1col clearfix div class=wrapper-first i class=rfs-icon fa fa-gift aria-hidden=true/i /div div class=wrapper-last div class=author-info div class=field field-name-node-author Chris /div div class=field field-name-node-post-date November 16, 2016 /div /div div class=field field--name-node-title field--type-ds field--label-hidden field__itemh2a href= hreflang=enRedfin's Front-End Shell: Bundler, Susy, Compass, Breakpoint, and more!/a/h2/div div class=clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__itempWhile we at Redfin don't really yet have a full on base theme for every project, one thing we do use is our bundler shell. This forms the basis of any Drupal 7 or 8 theme we build, and in fact, is really just the framework for the front-end (that is, this shell is useful outside of the realm of Drupal, actually)./p pFirst things first - a href='s the code/a./p pLet's go ahead and begin the dissection.../p/div /div /div

OSTraining: Beginners Guide to Contributing to Drupal : Prerequisites

Wed, 11/16/2016 - 15:23
pWelcome to the first part of our series on contributing to Drupal for beginners./p

Drupalize.Me: Drupal 8 is 1 Year Old

Wed, 11/16/2016 - 14:31
div class=field field-name-body field-type-text-with-summary field-label-hidden text-content text-secondarydiv class=field-itemsdiv class=field-item evenpIt’s hard to believe, but it has been 1 year since Drupal 8.0 was released to the world. We’re celebrating Drupal 8’s first birthday on November 19th by giving FREE access to our full [Drupal 8 Migration Guide](a href=// over the celebration weekend! This Saturday, November 19th through Monday, November 21st you can learn how to use the new core migration system to upgrade your Drupal site or import content from external sources. It’s time to get using Drupal 8!/p /div/div/divdiv id=comment-wrapper-nid-2720/div

Unimity Solutions Drupal Blog: Dwell in Drupal 8 - Launching Webinar Series to Celebrate Drupal 8's First Birthday

Wed, 11/16/2016 - 13:25
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpAt Unimity, we are celebrating Drupal 8’s first birthday by launching a new webinar series “Dwell in Drupal 8”!! /p /div/div/div

Valuebound: Why big government websites are switching over to Drupal

Wed, 11/16/2016 - 13:14
pThe open source Drupal CMS powers some of the biggest government websites. Now what do government websites and media amp; entertainment websites have in common? A lot of functionalities and end goals are similar. Media websites have subscription forms, personalized data delivery, large data warehouses, events and related forms, publishing tools, marketing tools, transactions etc./p pThe Georgia Technology Authority was running 65 state government websites on two different versions of proprietary software - Vignette 6 and Vignette 7, one of which is no longer supported. It had become cumbersome and expensive. Apart from that, moving all the 65 sites to Vignette 8 was too much of a hassle. CTO Steve Nichols says, “As we dug in, all the obvious best choices were open source,”. The…/p Featured Case Studies: YHA Groups

Tue, 11/15/2016 - 18:35
div class=field field-name-field-mainimage field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item evenimg src= width=588 height=306 alt=YHA Groups //div/div/divdiv class=field field-name-field-link field-type-link-field field-label-abovediv class=field-labelCompleted Drupal site or project URL:nbsp;/divdiv class=field-itemsdiv class=field-item evena href= class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpYHA (Youth Hostels Association) is a charity which has provided Hostel accommodation to people of all ages and backgrounds for over 85 years. The majority of YHA's business is split between two sites; YHA which allows families and individuals to book accommodation, and YHA Groups which is aimed at groups and schools who are looking to book accommodation for groups of 16 or more people./p pThis project covered YHA Groups, a brand new Drupal 8 design and build to replace the existing site./p/div/div/divdiv class=field field-name-field-module field-type-node-reference field-label-abovediv class=field-labelKey modules/theme/distribution used:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/project/bootstrapBootstrap/a/divdiv class=field-item odda href=/project/imceIMCE/a/divdiv class=field-item evena href=/project/colorboxColorbox/a/divdiv class=field-item odda href=/project/draggableviewsDraggableViews/a/divdiv class=field-item evena href=/sandbox/m-gonzalez/1551084geolocation/a/divdiv class=field-item odda href=/project/image_widget_cropImage Widget Crop/a/divdiv class=field-item evena href=/sandbox/roni_kantis/2226859Slick/a/divdiv class=field-item odda href=/project/admin_toolbarAdmin Toolbar/a/divdiv class=field-item evena href=/project/contact_blockContact Block/a/divdiv class=field-item odda href=/project/contact_storageContact Storage/a/divdiv class=field-item evena href=/project/contact_storage_exportContact Storage Export/a/divdiv class=field-item odda href=/project/stage_file_proxyStage File Proxy/a/divdiv class=field-item evena href=/project/shieldShield/a/divdiv class=field-item odda href=/project/pathologicPathologic/a/div/div/divdiv class=field field-name-field-developed-org field-type-node-reference field-label-abovediv class=field-labelOrganizations involved:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/microserveMicroserve/a/div/div/divdiv class=field field-name-field-profiles field-type-user-reference field-label-abovediv class=field-labelTeam members:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/u/rickdonohoerickdonohoe/a/divdiv class=field-item odda href=/u/ class=field-item evena href=/u/ashley-georgeAshley George/a/divdiv class=field-item odda href=/u/timcliffordtim.clifford/a/divdiv class=field-item evena href=/u/markpavlitskimarkpavlitski/a/divdiv class=field-item odda href=/u/sophieskSophie.SK/a/div/div/div

J-P Stacey: A quick rundown of what using Drupal 6-to-8's migration UI feels like

Tue, 11/15/2016 - 17:00
pRecently, I was asked to migrate a fairly straightforward website from Drupal 6 to 8: a blog; some feature articles; some static pages; a fair amount of uploaded images. I thought it would be a great candidate for reviewing what the Migrate UI bundled with core looks like, since a href= introduction in Drupal 8.1.0/a./p pAlthough the Migrate framework more generally permits arbitrarily complex migrations, many people's first port of call will be the UI, so I thought it would be interesting to chart a user journey through its use: highlighting what went well, what went badly, and (most importantly) what looked problematic but turned out to be straightforward./p pa href= more of A quick rundown of what using Drupal 6-to-8#039;s migration UI feels like /a/p

Web Wash: Using Display Suite in Drupal 8: How to Use Switch View Mode Sub-module

Tue, 11/15/2016 - 17:00
In this tutorial series on using Display Suite, we've cover the two fundamental use-cases of the module: how to modify layouts and use Display Suite fields. Now we'll take a closer look at one of its sub-modules: Display Suite Switch View Mode. The Display Suite Switch View Mode module allows an editor to switch which view mode is used on a content page. By default, Drupal will use the Full content view mode (if enabled) on content page, i.e., node/1. But what if you want to choose between two different Full content view modes? Well this module has you covered. So instead of being stuck with a single view mode, you could have one for a layout with a sidebar and another for pages with go full width. In this tutorial, you'll learn how to configure and use theDisplay Suite Switch View Mode sub-module.

Zivtech: Use Gulp for Drupal 8 with Teams, Part 2: Creating tasks

Tue, 11/15/2016 - 16:09
div class=field-image-photo img src=/sites/default/files/styles/large/public/gulp_1.png?itok=nUnLtlCe width=645 height=376 alt=gulp banner image / /div div class=field-body pThis post is the second in a series covering Zivtech's usage of Gulp for front-end development in Drupal 8./p pIn the last post, I covered a href=/blog/use-gulp-drupal-8-teams-part-1-gulp-setuphow to setup Gulp for teamwork on Drupal 8 projects/a. In this post, I'll go over how to get started with writing Gulp tasks. I'll also break down a specific task for Sass linting to ensure good code quality./p h2Maintainable and Readable Gulp tasks/h2 pWith any mid-to-large sized Drupal 8 theme, it's really easy for the main Gulp file (stronggulpfile.js/strong) become unwieldy and complex. With dozens of tasks doing all kinds of automated work, before too long, stronggulpfile.js/strong becomes a soup of illegible code./p pAdditionally, members of your team might have different ways of naming Gulp tasks. One person might write a Sass building task called buildSass and another might create an identical task called css./p pIt'd be nice to strip down stronggulpfile.js/strong, make it readable, and somehow compartmentalize each task separately. Also, we want to cut down on task naming variations and create a unified system for structuring our tasks./p pMy current favorite way to handle these wishes is a href= Basically, each task is written as an individual, CommonJS style module. Then, the tasks are arranged in directories, and that directory structure defines the task name. It is a very simple and predictable way to setup Gulp tasks./p h2Structuring Gulp tasks/h2 pStart off by creating the file tree structure below:/p pcode class=language-yaml ├── project/ │ ├── .gitignore (ignore node_modules, gulpfile.yml) │ ├── package.json │ ├── gulpfile.js │ ├── default.gulpfile.yml │ ├── sass │ │ ├── styles.scss │ ├── js │ │ ├── scripts.js │ ├── gulp-tasks │ │ ├── styles │ │ │ ├── lint.js │ │ │ ├── build.js │ │ ├── scripts │ │ │ ├── lint.js │ │ │ ├── build.js /code/p pa href=/blog/use-gulp-drupal-8-teams-part-1-gulp-setupThe YAML settings file/a, strongdefault.gulpfile.yml/strong, was discussed in the last post of this series, if you need a refresher./p pgulp-require-tasks lets these tasks be accessible according to their structure. For example, to build the styles, you'll run gulp styles:build and to lint the JavaScript, you'll run gulp scripts:lint. If you don't like the colon delimiter, you can change that too./p h2Update Gulp settings/h2 pIn the last post we started the strongdefault.gulpfile.yml/strong, and now we'll edit that same file to add in settings for the Gulp tasks we'll create in this project./p pOpen the file: it should look like this:/p pcode class=language-yaml themeName: myTheme themeDescription: myTheme description /code/p pExpand on that by adding settings for source and destination paths of Sass and JS:/p pcode class=language-yaml themeName: myTheme themeDescription: myTheme description styles: src: sass/strong/*.scss, dest: css lint: enabled: true failOnError: false scripts: src: js//strong/*.js, lint: enabled: true failOnError: false /code/p pUnder the styles and scripts sections of the YAML, you can see I added some linting options too. From within the YAML settings, people can enable or disable linting, and also decide if they want the Gulp process to stop when linting errors are detected./p pPulling these settings out of the Gulp tasks themselves and into this YAML file means that developers don't have to search through the tasks looking for settings to change. Instead, they have every setting exposed to them in this one, concise file./p h2Importing tasks for Gulp/h2 pWe haven't written any Gulp tasks yet, but we can go ahead and setup importing them so they can be used./p pOpen up the stronggulpfile.js/strong we started in the last post. It should look like this:/p pcode class=language-javascript (function () { 'use strict'; var gulp = require('gulp'); var yaml = require('js-yaml'); var fs = require('fs'); var assign = require('lodash.assign'); // read default config settings var config = yaml.safeLoad(fs.readFileSync('default.gulpfile.yml', 'utf8'), {json: true}); try { // override default config settings var customConfig = yaml.safeLoad(fs.readFileSync('gulpfile.yml', 'utf8'), {json: true}); config = assign(config, customConfig); } catch (e) { console.log('No custom config found! Proceeding with default config only.'); } })(); /code/p pIf you recall, we loaded the strongdefault.gulpfile.yml/strong and overrode that with any settings from stronggulpfile.yml/strong if it exists. The stronggulpfile.yml/strong file has the exact same structure has strongdefault.gulpfile.yml/strong, but settings can have different values. This lets other developers on the team override some settings if needed./p pAt this point in stronggulpfile.js/strong, the config is loaded and ready to be used. Next, we integrate a href= pcode class=language-javascript (function () { 'use strict'; var gulp = require('gulp'); var yaml = require('js-yaml'); var fs = require('fs'); var assign = require('lodash.assign'); var gulpRequireTasks = require('gulp-require-tasks'); // read default config settings var config = yaml.safeLoad(fs.readFileSync('default.gulpfile.yml', 'utf8'), {json: true}); try { // override default config settings var customConfig = yaml.safeLoad(fs.readFileSync('gulpfile.yml', 'utf8'), {json: true}); config = assign(config, customConfig); } catch (e) { console.log('No custom config found! Proceeding with default config only.'); } gulpRequireTasks({ path: process.cwd() + '/gulp-tasks', arguments: [config] }); })(); /code/p pSetting up gulp-require-tasks is super easy. We tell it where our gulp tasks are located, in the gulp-tasks directory./p pThen, to each module (i.e. 1 module will be 1 Gulp task) in the directory, gulp-require-tasks passes arguments to each task. The first argument is always gulp itself. The arguments setting for gulp-require-tasks is an array of other things you want to pass to each module. I've opted to pass in config, which is the object representing the settings merge in the YAML files./p pThis is essentially all you need in gulpfile.yml. However, I also like to add shortcut tasks too, that combine other tasks for quicker use. For example, general build and lint tasks might be like this:/p pcode class=language-javascript gulp.task('build', ['styles:build', 'scripts:build']); gulp.task('lint', ['styles:lint', 'scripts:lint']); /code/p h2Modular Gulp tasks/h2 pLet's start off creating the Sass linting task. To help with this, I recommend using a href= You'll want to a href= over how to setup sass-lint/a, which I won't cover in detail here. Essentially, you create a strong.sass-lint.yml/strong file in the root of the project. That file contains all the rules you want to validate; for example, should developers avoid styling with IDs or should they use RGB rather than HEX values for colors./p pAfter sass-lint rules are in place, open up the styles linting file. Here you'll see the guts of the linting task:/p pcode class=language-javascript 'use strict'; var cached = require('gulp-cached'); var sassLint = require('gulp-sass-lint'); var gulpif = require('gulp-if'); module.exports = function (gulp, options) { if (options.styles.lint.enabled) { return gulp.src(options.styles.src) .pipe(cached('styles:lint')) .pipe(sassLint()) .pipe(sassLint.format()) .pipe(gulpif(options.styles.lint.failOnError, sassLint.failOnError())); } else { return console.log('css linting not enabled'); } }; /code/p pFor the three required packages, you'll want to npm install them of course. Don't forget the --save-dev flag to get those packages stored in package.json!/p pThe bulk of the code exists within the standard, CommonJS module.exports directive. A Gulp process is passed into the task as well as the set of options from strongdefault.gulpfile.yml/strong./p pWe start off by running a quick if/else check so that we short-circuit out of this task if the user disabled Sass linting. Then, we pipe in the files that we selected in the Gulp settings' styles.src section. Files are then piped through a href=, which keeps a list of the source files (and contents!) in memory. This makes the task faster./p pNext, the styles are linted and the results are formatted and reported out to the console. Finally, we use a href= to determine if the Gulp process gets terminated now should there be linting errors./p h2The sky's the limit/h2 pI leave it as an exercise for the reader to go about developing the other Gulp tasks. In the next post, I'll go over some other, more complicated Gulp tasks to show more advanced usage. Until then, you're more than welcome to a href= over and reference/a our own Gulp tasks we publish for a href= Skin/a./p pstrongPosts in this series/strong/p ol lia href= Gulp for Drupal 8 with Teams, Part 1: Gulp Setup/a/li lia href= Gulp for Drupal 8 with Teams, Part 2: Creating tasks/a/li /ol /div nav role=navigation class=links-inline/nav

Savas Labs: Using MailChimp API v3.0 to subscribe users to email lists in Drupal custom modules

Tue, 11/15/2016 - 01:00
p img src= alt=sheet music A tutorial that shows you how to use Composer and ThinkShout's new PHP library for MailChimp API v3.0 to easily subscribe users to mailing lists in Drupal custom modules without using the MailChimp contributed module. This is a follow-up to a previous post that used the old API, and also includes some new Drupal 8 specifics. a href= reading…/a /p