Planet Drupal

Syndicate content
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 59 min 53 sec ago

Appnovation Technologies: Appnovation's 1st Drupal Code Sprint Day

Wed, 11/30/2016 - 18:29
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encoded pOn November 19th, Appnovation held their 1st ever Drupal Code Sprint Day, another sign of Appnovation's strong commitment to the a href=https://www.appnovation.com/services/drupal-development/8 target=_blankDrupal open source community./a/p/div/div/divdiv class=field field-name-field-blog-header-image field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item evena href=/blog/appnovations-1st-drupal-code-sprint-dayimg typeof=foaf:Image src=https://www.appnovation.com/sites/default/files/2016-11-30_blogheader_1-2.jpg width=1400 height=400 alt= //a/div/div/divdiv class=sharethis-buttonsdiv class=sharethis-wrapperspan st_url=https://www.appnovation.com/blog/appnovations-1st-drupal-code-sprint-day st_title=Appnovation#039;s 1st Drupal Code Sprint Day class=st_facebook/span span st_url=https://www.appnovation.com/blog/appnovations-1st-drupal-code-sprint-day st_title=Appnovation#039;s 1st Drupal Code Sprint Day class=st_twitter/span span st_url=https://www.appnovation.com/blog/appnovations-1st-drupal-code-sprint-day st_title=Appnovation#039;s 1st Drupal Code Sprint Day class=st_sharethis/span /div/div

Acquia Developer Center Blog: A Professional Software Engineer's Checklist

Wed, 11/30/2016 - 18:04
div class=field field-name-field-blog-image field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item evenimg typeof=foaf:Image class=img-responsive src=https://dev.acquia.com/sites/default/files/styles/blog__190_x110_/public/blog/checklist3.png?itok=R5Fs5Bmp width=140 height=85 alt=checklist title=checklist //div/div/divdiv class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpWhat defines a professional software engineer?/p pThere isn’t a simple answer to that question, but after reading several a href=#booksbooks/a on the subject I identified some tips that I have found useful./p /div/div/divdiv class=field field-name-field-blog-tags field-type-taxonomy-term-reference field-label-inline clearfixdiv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/tags/acquia-drupal-planet typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=acquia drupal planet/a/div/div/div

a-fro.com: Introducing MailChimp Automations for Drupal

Wed, 11/30/2016 - 16:25
span property=schema:name data-quickedit-field-id=node/7/title/en/rss class=field field--name-title field--type-string field--label-hiddenIntroducing MailChimp Automations for Drupal/span div property=schema:text data-quickedit-field-id=node/7/body/en/rss class=clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__itempRecent additions to Drupal 7’s a href=https://www.drupal.org/project/mailchimpMailChimp module/a and a href=https://github.com/thinkshout/mailchimp-api-php/API library/a offer some powerful new ways for you to integrate Drupal and MailChimp. As of version 7.x-4.7, the Drupal MailChimp module now supports automations, which are incredibly powerful and flexible ways to trigger interactions with your users. Want to reach out to a customer with product recommendations based on their purchase history?/div span data-quickedit-field-id=node/7/uid/en/rss rel=schema:author class=field field--name-uid field--type-entity-reference field--label-hiddenspan lang= about=/user/2 typeof=schema:Person property=schema:name datatype=aaron/span/span span property=schema:dateCreated content=2016-11-30T15:25:48+00:00 data-quickedit-field-id=node/7/created/en/rss class=field field--name-created field--type-created field--label-hiddenWed, 11/30/2016 - 09:25/span

OSTraining: Using Drupal Message Notifications

Wed, 11/30/2016 - 13:20
div class=ost-intro-imageimg src=https://www.ostraining.com/images/drupal/message-notifications.jpg alt=Using Drupal Message Notifications width=200 height=134 //div pAn OSTraining member asked us how to setup the message notifications stack in Drupal./p pIn this particular case, he wanted to know how to set up the message notifications./p pOnce you install the required modules, you will notice a working notification example already exists, making the setup process easier. Let's start.../p

Liip: A fairly complex Drupal Commerce site: freitag.ch

Wed, 11/30/2016 - 13:03
pimg class=alignleft size-full wp-image-8638 src=https://blog.liip.ch/content/uploads/2016/10/f-square-152x152.png alt=Freitag logo /Our latest site with a href=https://www.drupal.org/project/commerceDrupal Commerce 1.x/a went live in July 2016. It is a href=https://www.freitag.chFreitag./a Since then we#8217;ve been adding several new commerce related features. I feel it#8217;s time to write a wrap-up. The site has several interesting solutions, this article will focus on commerce./p pFirst a few words about the architecture. a href=https://platform.sh/platform.sh/a hosts the site. The stack is Linux + nginx +  MySQL + PHP, the CMS is a href=https://drupal.orgDrupal 7/a. a href=https://www.fastly.com/Fastly/a caches http responses for anonymous users and also for authenticated users having no additional role (that is, logged-in customers). a href=https://www.drupal.org/project/authcacheAuthcache/a module takes care of lazy-loading the personalized parts (like the user menu and the shopping cart). Freitag has an ERP system to which we connect using the OCI8 PHP library. We write Behat and simpletest tests for QA./p pWe use the highly flexible Drupal Commerce suite. 23 of the enabled Freitag contrib modules have a name starting with #8216;commerce#8217;. We applied around 45 patches on them. Most of the patches are authored by us and 15 of them have already been committed. Even with this commitment to solve everything we could in an open-source way we wrote 30.000+ lines of commerce-related custom code. The bulk part of this is related to the ERP integration. Still, in March 2016 Freitag was the a href=https://www.drupal.org/drupalorg/blog/top-10-contributing-customers3rd largest Drupal customer contributor/a./p pThe words #8216;product#8217; and #8216;product variation#8217;  I#8217;ll be using throughout the article correspond to #8216;product display node#8217; and #8216;product#8217; in Drupal Commerce lingo./p h3ERP/h3 pERP is the source of all products and product variations. We import this data into Drupal on a regular basis using a href=http://FeedsFeeds/a. (Now I would use a href=https://www.drupal.org/project/migrateMigrate/a instead, it#8217;s better supported and easier to maintain.) ERP also lets Drupal know about order status changes, sends the shipping tracking information and informs Drupal about products sent back to Freitag by customers./p pThere is data flowing in the opposite direction as well. ERP needs to know about all Drupal orders. Also, we create coupons in Drupal and send them to ERP too for accounting and other reasons./p h3Emails/h3 pWe send commerce-related emails using the a href=https://www.drupal.org/project/messageMessage/a stack. This way we can have order-related tokens in our mails and we can manage and translate them outside the a href=https://www.drupal.org/project/rulesRules/a UI. a href=https://www.mandrill.com/Mandrill/a takes care of the mail delivery./p h3Payment gateway/h3 pIt was a client requirement to use the Swiss a href=https://www.datatrans.ch/Datatrans/a payment gateway. However, at the time of starting  the project, a href=https://www.drupal.org/project/commerce_datatransCommerce Datatrans/a (the connector module on drupal.org) was in dev state and lacked several features we needed. Pressed for time we opted for buying a Datatrans Drupal module from a company offering this solution. It turned out to be a bad choice. When we discovered that the purchased module still does not cover all our needs and looked at the code we found that it was obfuscated and pretty much impossible to change. Also, the module could be used only on one site instance which made it impossible to use it on our staging sites./p pWe ended up submitting patches to the Commerce Datatrans module hosted on drupal.org. The module maintainer, a href=https://www.drupal.org/u/berdirSascha Grossenbacher/a (the well-known Drupal 8 core contribtor) helped us solving several issues and feature requests by reviewing our patches. This process has lead to a stable release of Commerce Datatrans with a dozen of feature improvements and bugfixes./p pAdditional to Datatrans we use a href=https://www.drupal.org/project/commerce_copCommerce Custom Offline Payments/a to enable offline store purchases by store staff and bank transfer payments./p h3Currencies/h3 pThe site works with 7 different currencies, some of them having two different prices depending on the shipping country. Prices come from ERP and we store them in a a href=https://www.drupal.org/project/field_collectionfield collection/a field on the product. We do not use the emcommerce_price/em field on the product variation./p h3Tax/h3 pFreitag ships to countries all around the world. VAT calculations are performed for EU, Switzerland, UK, Japan, South Korea and Singapore. To implement this functionality our choice fell on the commerce_vat module. Adding commerce_eu_vat and commerce_ch_vat released us from having to maintain VAT rates for EU and Switzerland ourselves. For the 3 Asian countries we implemented our own emhook_commerce_vat_rate_info()/em./p pWe have two different VAT rates for most of the countries. This is because usually a lower VAT rate applies to books. Drupal imports the appropriate VAT rate from the ERP with the product variation data. This information is handled by price calculation rules in Drupal./p h3Shipping/h3 pFreitag delivers its products using several shipping providers (like UPS, Swiss Post) all around the world. Most shipping providers have many shipping rates depending on the destination country, speed and shipped quantity (weight or volume). On checkout the customer can choose from a list of shipping services. This list needs to be compatible with the order./p pWe used a href=https://www.drupal.org/project/rulesrules/a to implement the shipping services in Drupal based on the a href=https://www.drupal.org/project/commerce_flat_rateCommerce Flat Rate/a module. For this end we trained our client to set up and maintain these rules themselves. It was not easy: shipping rules are daunting even for experienced commerce developers. First we needed to set up the #8220;Profile Address#8221; rules components. Then we configured the #8220;Place of Supply#8221; components. We applied these in turn in the condition part of the shipping rules components themselves./p pThe weakest point of any  implementation based on Rules is the maintenance. It#8217;s not easy to find a specific rule after you created it. Having 250 rules components for only shipping made this feeling stronger./p pThe shipping line item receives the VAT rate of the product with the highest VAT rate in the order./p h3Coupons/h3 pFreitag has 6 different coupon types. They differ in who can create them, who and where (online/offline) can redeem them, whether partial redemption is possible, whether it#8217;s a fixed amount or percentage discount and whether Freitag accounting needs to know about them or not./p pBased on these criteria we came up with a solution featuring a href=https://www.drupal.org/project/commerce_couponCommerce Coupon/a. Coupons can be a href=https://www.drupal.org/project/commerce_discountdiscount coupons/a or a href=https://www.drupal.org/project/commerce_gcgiftcards/a. Giftcard coupons can only have a fixed value. Discount based coupons can also apply a percentage discount. The main difference between them is that customers can partially redeem giftcards, while discount-based coupons are for one-time use./p pTo make coupons work with VAT was quite tricky. (To make things simpler we only allowed one coupon per order.) Some coupon types work as money which means that from an accounting point of view they do not actually decrease the order total (and thus the VAT) but work as a payment method. Other coupon types however do decrease the order total (and thus the VAT). At the same time Drupal handles all coupons as line items with a negative price and the Drupal order total does decrease in either case./p pThe solution we found was to use a href=https://www.drupal.org/project/commerce_vat_proportionalCommerce proportional VAT/a. a href=https://www.drupal.org/u/axel.rutzAxel Rutz/a maintains this brilliant little module and he does this in a very helpful and responsive manner. All the module does is adding negative VAT price components to coupon line items to account for VAT decrease. It decreases the order total VAT amounts correctly even if we have several different VAT rates inside the order./p h3Conclusion/h3 pAlthough there#8217;s always room for increasing the complexity of the commerce part of the site (let#8217;s find some use case for recurring payments!), it#8217;s already the most complicated commerce site I#8217;ve worked on.  For this Drupal Commerce provided a solid foundation that is pleasant to work with. In the end, Drupal enabled us to deliver a system that tightly integrates content and commerce./p pemI also would like to say thanks to a href=https://www.drupal.org/u/bojanzBojan Živanović/a from a href=https://commerceguys.com/Commerce Guys/a who provided me with valuable insights on the legal aspects of tax calculation./em/p

SystemSeed: SystemSeed do Minsk

Wed, 11/30/2016 - 11:41
pIf you haven’t noticed from our Twitter feed this week we’ve flown the team to Minsk in Belarus to socialise, eat, drink and be merry while maybe taking in a little culture and even some work(!)/ppOne of the first things that we all notice when the team get together is you can’t hug someone over Skypehellip; you can’t make the other person a cup of tea, or complain about the same weather./ppWhile distributed teams can pick the world’s finest global talent as far as timezones and personal or client flexibility allows, meeting in person is a necessary task to undertake on a regular basis. It’s not essential that everyday is spent this way and removing the ability to choose from only your local talent, or those willing to relocate is not the most sensible choice in our modern era of collaborative tools and communication methods. We’d still much rather be distributed but greatly appreciate these times together./ppWe’ll continue to blog through the week and Tweet some extras as they are happening./ppFrom all of us in our temporary Minsk HQ - have a fun and productive day and if you are sat next to a colleague give them a hug or make them a cup of tea. Not all teams can enjoy this luxury every day of their work life./pfigure class=tmblr-full data-orig-height=3120 data-orig-width=4160img src=http://68.media.tumblr.com/1e2d0897e8124cd22891698e94330704/tumblr_inline_ohgb13cfMl1twws0r_540.jpg data-orig-height=3120 data-orig-width=4160//figure

Drupal Modules: The One Percent: Drupal Modules: The One Percent — Configuration Split (video tutorial)

Wed, 11/30/2016 - 00:04
span class=field field--name-title field--type-string field--label-hiddenDrupal Modules: The One Percent — Configuration Split (video tutorial)/span div class=field field--name-field-screenshot field--type-image field--label-hidden field__item img src=http://gogrow.org/sites/default/files/styles/large/public/2016-11/Screen%20Shot%202016-11-29%20at%204.56.31%20PM.png?itok=MlqyDlBT width=480 height=259 alt=Project page screenshot typeof=foaf:Image class=image-style-large //div span class=field field--name-uid field--type-entity-reference field--label-hiddenspan lang= about=http://gogrow.org/user/24 typeof=schema:Person property=schema:name datatype= xml:lang=NonProfit/span/span span class=field field--name-created field--type-created field--label-hiddenTue, 11/29/2016 - 17:04/span div class=field field--name-field-episode field--type-integer field--label-hidden field__item7/div div class=clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__itempHere is where we look at Drupal modules running on less than 1% of reporting sites. Today we'll look at Configuration Split, a module which allows you to export only the D.8x configuration you want to production. More information can be found a href=http://nuvole.org/blog/2016/nov/28/configuration-split-first-beta-release-drupal-ironcamphttp://nuvole.org/blog/2016/nov/28/configuration-split-first-beta-release-drupal-ironcamp/a./p /div

Cheeky Monkey Media: Hacking DrupalCon: A Behind the Scenes Look at the Event Design and Planning Process

Tue, 11/29/2016 - 22:58
span class=field field--name-title field--type-string field--label-hiddenHacking DrupalCon: A Behind the Scenes Look at the Event Design and Planning Process/span div class=field field--name-field-image field--type-image field--label-hidden field__item img src=https://cheekymonkeymedia.ca/sites/default/files/2016-11/hackingdrupalcon.jpg width=1380 height=444 alt=Hacking DrupalCon: A Behind the Scenes Look at the Event Design and Planning Process by Spela Grasic, Marketing Gorilla title=Hacking DrupalCon: A Behind the Scenes Look at the Event Design and Planning Process by Spela Grasic, Marketing Gorilla //div span class=field field--name-uid field--type-entity-reference field--label-hiddena title=View user profile. href=https://cheekymonkeymedia.ca/users/spela class=usernameSpela/a/span span class=field field--name-created field--type-created field--label-hiddenTue, 11/29/2016 - 21:58/span div class=clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__itempEver wonder what goes into a conference or other business event that participants will gush about (in a good way) for years? After an event of these mythical proportions, participants walk away raving about the food, the speakers, the social events, the aura, and the list goes on .../p pBut pulling off such an event is no easy feat. Thus, I decided to speak with Lead DrupalCon Coordinator a href=https://www.drupal.org/u/amandadrupalAmanda Gonser/a to find out how she manages to make sure the a href=https://cheekymonkeymedia.ca/blog/secret-branding-drupalcon-stunning-example-brand-and-web-style-guideDrupalCon event design/a is flawless and fits into the overall event planning process seamlessly./p p(iThis video may cause unexpected bursts of laughter. If you cannot laugh in your current environment, please scroll down for the written version./i)/p p class=text-align-center /p/div

Mediacurrent: Communicating Design to Clients

Tue, 11/29/2016 - 22:06
img typeof=foaf:Image src=https://www.mediacurrent.com/sites/default/files/styles/thumb_blog_spotlight/public/communicating-design-clients.png?itok=By2WOq2z width=200 height=171 / pWhat makes a good designer? Well, of course you have to be creative, understand how to solve problems in unconventional ways, and do it all within budget. But wait, there's more to it than being super creative and solving problems. You must be able to make others understand how your design vision solves their problems./p

Lullabot: Pull Content From a Remote Drupal 8 Site Using Migrate and JSON API

Tue, 11/29/2016 - 21:02
div class=rich-textdiv class=rich-text__contentpI wanted to find a way to pull data from one Drupal 8 site to another, using JSON API to expose data on one site, and Drupal#x2019;s Migrate with a JSON source on another site to consume it. Much of what I wanted to do was undocumented and confusing, but it worked well, once I figured it out. Nevertheless, it took me several days to get everything working, so I thought I#x2019;d write up an article to explain how I solved the problem. Hopefully, this will save someone a lot of time in the future./p pI ended up using the a href=https://www.drupal.org/project/jsonapiJSON API module/a, along with the REST modules in Drupal Core on the source site. On the target site, I used Migrate from #xA0;Drupal Core 8.2.3 along with a href=https://www.drupal.org/project/migrate_plusMigrate Plus/a and a href=https://www.drupal.org/project/migrate_toolsMigrate Tools/a./p h2Why JSON API?/h2 pDrupal#xA0;8 Core ships with two ways to export JSON data. You can access data from any entity by appending code?_format=json/code to its path, but that means you have to know the path ahead of time, and you#x2019;d be pulling in one entity at a time, which is not#xA0;efficient./p pYou could also use Views to create a JSON endpoint, but it might be difficult to configure it to include all the required data, especially all the data from related content, like images, authors, and related nodes. And you#x2019;d have to create a View for every possible collection of data that you want to make available. To further complicate things, thereapos;s#xA0;a href=https://www.drupal.org/node/2772537an/aa href=https://www.drupal.org/node/2772537 outstanding bug using GET with Views REST endpoints/a./p pJSON API provides another solution. It puts the power in the hands of the data consumer. You don#x2019;t need to know the path of every individual entity, just the general path for a entity type, and bundle. For example:#xA0;code/api/node/article/code. From that one path, the consumer can select exactly what they want to retrieve just by altering the URL. For example, you can sort and filter the articles, limit the fields that are returned to a subset, and bring along any or all related entities in the same query. Because of all that flexibility, that is the solution I decided to use for my example. (The Drupal community plans to add JSON API to Core in the future.)/p pThere#x2019;s a series of#xA0;a href=https://www.youtube.com/playlist?list=PLZOQ_ZMpYrZsyO-3IstImK1okrpfAjuMZshort videos on YouTube/a that demonstrate many of the configuration options and parameters that are available in Drupal#x2019;s JSON API./p h2Prepare the Source Site/h2 pThere is not much preparation needed for the source because of JSON API#x2019;s flexibility. My example is a simple Drupal 8 site with an article content type that has a body and field_image image field, the kind of thing core provides out of the box./p pFirst, download and install the a href=https://www.drupal.org/project/jsonapiJSON API module/a. Then, create YAML configuration to #x201C;turn on#x201D; the JSON API. This could be done by creating a simple module that has YAML file(s) in code/MODULE/config/optional/code. For instance, if you created a module called codecustom_jsonapi/code, a file that would expose node data might look like:/p div class=codepre codefilename: /MODULE/config/optional/rest.resource.entity.node.yml:/code/pre/div div class=codepre codeid: entity.node plugin_id: span class=code__stringapos;entity:nodeapos;/span granularity: method configuration: GET: supported_formats: - json supported_auth: - basic_auth - cookie dependency: enforced: module: - custom_jsonapi/code/pre/div pTo expose users or taxonomy terms or comments, copy the above file, and change the name and id as necessary, like this:/p div class=codepre codefilename: /MODULE/config/optional/rest.resource.entity.taxonomy_term.yml:/code/pre/div div class=codepre codeid: entity.taxonomy_term plugin_id: span class=code__stringapos;entity:taxonomy_termapos;/span granularity: method configuration: GET: supported_formats: - json supported_auth: - basic_auth - cookie dependency: enforced: module: - custom_jsonapi/code/pre/div pThat will support GET, or read-only access. If you wanted to update or post content you#x2019;d add POST or PATCH information. You could also switch out the authentication to something like OAuth, but for this article we#x2019;ll stick with the built-in basic and cookie authentication methods. If using basic authentication and the Basic Auth module isn#x2019;t already enabled, enable it./p pNavigate to a URL like codehttp://sourcesite.com/api/node/article?_format=api_json/code and confirm that JSON is being output at that URL./p pThatapos;s it for the source./p h2Prepare the Target Site/h2 pThe target site should be running Drupal 8.2.3 or higher. There are changes to the way file imports work that wonapos;t work in earlier versions. It should already have a matching article content type and field_image field ready to accept the articles from the other site./p pEnable the core Migrate module. Download and enable the a href=https://www.drupal.org/project/migrate_plusMigrate Plus/a and a href=https://www.drupal.org/project/migrate_toolsMigrate Tools/a modules. Make sure to get the versions that are appropriate for the current version of core. Migrate Plus had 8.0 and 8.1 branches that only work with outdated versions of core, so currently you need version 8.2 of Migrate Plus./p pTo make it easier, and so I don#x2019;t forget how I got this working, I created a migration example as the a href=https://github.com/karens/import_drupalImport Drupal module/a on Github. Download this module into your module repository. Edit the YAML files in the code/config/optional/code #xA0;directory of that module to alter the JSON source URL so it points to the domain for the source site created in the earlier step./p pIt is important to note that if you alter the YAML files after you first install the module, youapos;ll have to uninstall and then reinstall the module to get Migrate to see the YAML changes./p h2Tweaking the Feed Using JSON API/h2 pThe primary path used for our migration is (where sourcesite.com is a valid site):/p div class=codepre codehttp(s)://sourcesite.com/api/node/article?_format=api_json/code/pre/div pThis will display a JSON feed of all articles. The articles have related entities. The field_image field points to related images, and the uid/author field points to related users. To view the related images, we can alter the path as follows:/p div class=codepre codehttp(s)://sourcesite.com/api/node/article?_format=api_jsonamp;include=field_image/code/pre/div pThat will add an included array to the feed that contains all the details about each of the related images. This way we won#x2019;t have to query again to get that information, it will all be available in the original feed. I created a href=https://gist.github.com/karens/3f379f16aab6dc64b448b011b612b50ba gist with an example of what the JSON API output at this path would look like/a./p pTo include authors as well, the path would look like the following. In JSON API you can follow the related information down through as many levels as necessary:/p div class=codepre codehttp(s)://sourcesite.com/api/node/article?_format=api_jsonamp;include=field_image,uid/author/code/pre/div pSwapping out the domain in the example module may be the only change needed to the example module, and itapos;s a good place to start. Read the JSON API module documentation to explore other changes you might want to make to that configuration to limit the fields that are returned, or sort or filter the list./p pManually test the path you end up with in your browser or with a tool like Postman to make sure you get valid JSON at that path./p h2Migrating From JSON/h2 pI had a lot of trouble finding any documentation about how to migrate into Drupal 8 from a JSON source. I finally a href=http://cgit.drupalcode.org/migrate_plus/tree/migrate_example_advanced/config/install/migrate_plus.migration.wine_role_json.ymlfound some in the Migrate Plus module/a. The rest I figured out from my earlier work on the original a href=https://www.drupal.org/project/migrate_source_jsonJSON Source module/a (now deprecated) and by trial and error. Here#x2019;s the source section of the YAML I ended up with, when migrating from another Drupal 8 site that was using JSON API./p div class=codepre codesource: plugin: url data_fetcher_plugin: http data_parser_plugin: json urls: http://sourcesite.com/api/node/article?_format=api_json ids: nid: type: integer item_selector: data/ fields: - name: nid label: apos;Nidapos; selector: /attributes/nid - name: vid label: apos;Vidapos; selector: /attributes/vid - name: uuid label: apos;Uuidapos; selector: /attributes/uuid - name: title label: apos;Titleapos; selector: /attributes/title - name: created label: apos;Createdapos; selector: /attributes/created - name: changed label: apos;Changedapos; selector: /attributes/changed - name: status label: apos;Statusapos; selector: /attributes/status - name: sticky label: apos;Stickyapos; selector: /attributes/sticky - name: promote label: apos;Promoteapos; selector: /attributes/promote - name: default_langcode label: apos;Default Langcodeapos; selector: /attributes/default_langcode - name: path label: apos;Pathapos; selector: /attributes/path - name: body label: apos;Bodyapos; selector: /attributes/body - name: uid label: apos;Uidapos; selector: /relationships/uid - name: field_image label: apos;Field imageapos; selector: /relationships/field_image/code/pre/div pbr/ One by one, I#x2019;ll clarify some of the critical elements in the source configuration./p pFile-based imports, like JSON and XML use the same pattern now. The main variation is the parser, and for JSON and XML, the parser is in the Migrate Plus module:/p div class=codepre codesource: plugin: url data_fetcher_plugin: http data_parser_plugin: json/code/pre/div pThe url is the place where the JSON is being served. There could be more than one URL, but in this case there is only one. Reading through multiple URLs is still pretty much untested, but I didn#x2019;t need that:/p div class=codepre code urls: http://sourcesite.com/api/node/article?_format=api_json/code/pre/div pWe need to identify the unique id in the feed. When pulling nodes from Drupal, it#x2019;s the nid:/p div class=codepre code ids: nid: type: integer/code/pre/div pWe have to tell Migrate where in the feed to look to find the data we want to read. A tool like a href=https://www.getpostman.com/docs/validating_json_collectionsPostman/a (mentioned above) helps figure out how the data is configured. When the source is using JSON API, it#x2019;s an array with a key of data:/p div class=codepre code item_selector: data//code/pre/div pWe also need to tell Migrate what the fields are. In the JSON API, they are nested below the main item selector, so they are prefixed using an xpath pattern to find them. The following configuration lets us refer to them later by a simple name instead of the full path to the field. I think the label would only come into play if you were using a UI:/p div class=codepre code fields: - name: nid label: apos;Nidapos; selector: /attributes/nid/code/pre/div h2Setting up the Image Migration Process/h2 pFor the simple example in the Github module we#x2019;ll just try to import nodes with their images. We#x2019;ll set the author to an existing author and ignore taxonomy. We#x2019;ll do this by creating two migrations against the JSON API endpoint, first one to pick up the related images, and then a second one to pick up the nodes./p pMost fields in the image migration just need the same values they#x2019;re pulling in from the remote file, since they already have valid Drupal 8 values, but the uri value has a local URL that needs to be adjusted to point to the full path to the file source so the file can be downloaded or copied into the new Drupal site./p pRecommendations for how best to migrate images have changed over time as Drupal 8 has matured. As of Drupal 8.2.3 there are two basic ways to process images, one for local images and a different one for remote images. #xA0;The process steps are different than in earlier examples I found. There is not a lot of documentation about this. I finally found a href=https://www.drupal.org/node/2695297a Drupal.org thread where the file import changes were added to Drupal core/a and did some trial and error on my migration to get it working. #xA0;/p pFor remote images:/p div class=codepre codesource: ... constants: source_base_path: apos;http://sourcesite.com/apos; process: filename: filename filemime: filemime status: status created: timestamp changed: timestamp uid: uid uuid: id source_full_path: plugin: concat delimiter: / source: - apos;constants/source_base_pathapos; - url uri: plugin: download source: - apos;@source_full_pathapos; - uri guzzle_options: base_uri: apos;constants/source_base_pathapos;/code/pre/div pFor local images change it slightly:/p div class=codepre codesource: ... constants: source_base_path: apos;http://sourcesite.com/apos; process: filename: filename filemime: filemime status: status created: timestamp changed: timestamp uid: uid uuid: id source_full_path: plugin: concat delimiter: / source: - apos;constants/source_base_pathapos; - url uri: plugin: file_copy source: - apos;@source_full_pathapos; - uri/code/pre/div pThe above configuration works because the Drupal 8 source uri value is already in the Drupal 8 format, http://public:image.jpg. If migrating from a pre-Drupal 7 or non-Drupal source, that uri won#x2019;t exist in the source. In that case you would need to adjust the process for the uri value to something more like this:/p div class=codepre codesource: constants: is_public: true ... process: ... source_full_path: - plugin: concat delimiter: / source: - apos;constants/source_base_pathapos; - url - plugin: urlencode destination_full_path: plugin: file_uri source: - url - file_directory_path - temp_directory_path - apos;constants/is_publicapos; uri: plugin: file_copy source: - apos;@source_full_pathapos; - apos;@destination_full_pathapos;/code/pre/div h2Run the Migration/h2 pOnce you have the right information in the YAML files, enable the module. On the command line, type this:/p div class=codepre codedrush migrate-status/code/pre/div pYou should see two migrations available to run. #xA0;The YAML files include migration dependencies and that will force them to run in the right order. To run them, type:/p div class=codepre codedrush mi --all/code/pre/div pThe first migration is codeimport_drupal_images/code. This has to be run before codeimport_drupal_articles/code, because field_image on each article is a reference to an image file. This image migration uses the path that includes the related image details, and just ignores the primary feed information./p pThe second migration is codeimport_drupal_articles/code. This pulls in the article information using the same url, this time without the included images. When each article is pulled in, it is matched to the image that was pulled in previously./p pYou can run one migration at a time, or even just one item at a time, while testing this out:/p div class=codepre codedrush migrate-import import_drupal_images --limit=1/code/pre/div pYou can rollback and try again./p div class=codepre codedrush migrate-rollback import_drupal_images/code/pre/div pIf all goes as it should, you should be able to navigate to the content list on your new site and see the content that Migrate pulled in, complete with image fields. There is a href=https://www.drupal.org/docs/8/api/migrate-api/migrate-api-overviewmore information about the Migrate API/a on Drupal.org./p h2What Next?/h2 pThere are lots of other things you could do to build on this. A Drupal 8 to Drupal 8 migration is easier than many other things, since the source data is generally already in the right format for the target. If you want to migrate in users or taxonomy terms along with the nodes, you would create separate migrations for each of them that would run before the node migration. In each of them, you#x2019;d adjust the codeinclude/code value in the JSON API path to pull the relevant information into the feed, then update the YAML file with the necessary steps to process the related entities./p pYou could also try pulling content from older versions of Drupal into a Drupal 8 site. If you want to pull everything from one Drupal 6 site into a new Drupal 8 site you would just use the built in Drupal to Drupal migration capabilities, but if you want to selectively pull some items from an earlier version of Drupal into a new Drupal 8 site this technique might be useful. The JSON API module won#x2019;t work on older Drupal versions, so the source data would have to be processed differently, depending on what you use to set up the older site to serve JSON. You might need to dig into the migration code built into Drupal core for Drupal to Drupal migrations to see how Drupal 6 or Drupal 7 data had to be massaged to get it into the right format for Drupal 8./p pFinally, you can adapt the above techniques to pull any kind of non-Drupal JSON data into a Drupal 8 site. You#x2019;ll just have to adjust the selectors to match the format of the data source, and do more work in the process steps to massage the values into the format that Drupal 8 expects./p pThe Drupal 8 Migrate module and its contributed helpers are getting more and more polished, and figuring out how to pull in content from JSON sources could be a huge benefit for many sites. If you want to help move the Migrate effort forward, you can dig into the Migrate in core a href=https://www.drupal.org/node/2735059initiative/a and a href=https://www.drupal.org/project/issues/search?projects=Migrateamp;project_issue_followers=amp;issue_tags_op=%3Dissues/a on Drupal.org./p /div/div

Drupal Association News: Drupal Association Financial Statements for Q3 2016

Tue, 11/29/2016 - 20:43
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item evenpWe normally share  our financial statements in posts about public board meetings, since that is the time when board members approve the statements. However, I wanted to give this quarter’s update its own blog post. We’ve a href=https://assoc.drupal.org/blog/megansanicki/reorganizing-for-drupalmade many changes to improve our sustainability/a over the last few months and I am fully embracing a href=https://assoc.drupal.org/aboutour value/a of communicating with transparency by giving insight into our progress./p h3 First, a word of thanks/h3 pWe are truly thankful for all the contributions that our community makes to help Drupal thrive. Your contribution comes in the form of time, talent, and treasure and all are equally important. Just as contributing code or running a camp is critical, so is financial contribution./p pThe Drupal Association is able to achieve its mission to unite the community to build and promote Drupal thanks to those who buya href=http://events.drupal.org/ DrupalCo/an tickets and sponsor the event, oura href=https://assoc.drupal.org/supporting-partners Supporter/as and a href=https://assoc.drupal.org/membershipMembers/a, Drupal.org sponsors, and talent recruiters who post jobs on a href=http://jobs.drupal.org/Drupal Jobs/a./p pWe use these funds to maintain Drupal.org and it’s tooling so the community can build and release the software and so technical evaluators can learn why Drupal is right for them through our new marketing content. It also funds DrupalCon production so we can bring the community together to level up skills, accelerate contribution, drive Drupal business, and build stronger bonds within our community. Plus, it funds Community Cultivation Grants and DrupalCon scholarships, removing financial blockers for those who want to do more for Drupal. And of course, these funds pay staff salaries so we have the right people on board to do all of this mission work./p pI also want to thank our board members who serve on the Finance Committee, Tiffany Farris (Treasurer), Dries Buytaert, Jeff Walpole, and Donna Benjamin. They provide financial oversight for the organization, making sure we are the best stewards possible for the funds the community gives to us. I also want to thank Jamie Nau of Summit CPA, our new CFO firm. Summit prepares our financial statements and forecasts and is advising us on long term sustainability./p h3 Q3 Financial Statements/h3 pA financial statement is a formal record of the financial activities of the Drupal Association. The financial statements present information in a structured way that should make it easy to understand what is happening with the organization's finances./p pOnce staff closes the books each month, Summit CPA prepares the financial statement, which the finance committee reviews and approves. Finally, the full Drupal Association Board approves the financial statements. This process takes time, which is why Q3 financials are released in Q4./p pYou can a href=https://drive.google.com/drive/u/0/folders/0B_TaJVzObs5XSDE2VUlvNE1UN3Mfind the Q3 financial statements here/a. They explain how The Association used its money in July, August, and September of this year. It takes a little financial background to understand them, so Summit CPA provides an executive summary and they set KPIs so it is clear how we are doing against important financial goals./p pThe latest executive summary is at the beginning of the September financial statement. In short, it says we are sustainable and on the right path to continue improving our financial health./p p“We are working on building an adequate cash reserve balance. As of September a cash balance of $723K is 14% of twelve-months of revenue. Summit recommends a cash reserve of 15%-30% of estimated twelve-month revenue. Since Drupal’s revenue and expenditures drastically fluctuate from month to month [due to DrupalCon] a cash reserve goal closer to 30% is recommended./p pThrough August we have achieved a Net Income Margin of 4% and a Gross Profit Margin 33%. Our goal is to increase the Net Income Margin to over 10% during the next year.”br / - Summit CPA/p pImproving our sustainability will continue to be an imperative through 2017, so the Association can serve its mission for generations to come. Financial health improvements will be achieved by the savings we gain over time from the staff reductions we did this summer. Another area of focus is improving our programs’ gross margins./p pYou can expect to see the Q4 2016 financials in Q1 2017. You can also expect to see our 2017 budget and operational focus. We are certainly excited (and thankful) for your support and we look forward to finding additional ways to serve this amazing community in 2017./p /div/div/div

Agaric Collective: Redirect users after login to the page they were viewing in Drupal 8

Tue, 11/29/2016 - 20:13
p class=leadHave you ever been asked to log into a website while you are viewing a page? And after doing so you get redirected to some page other than the one you were reading? This is an obvious and rather common usability problem. When this happens people lose track of what they were doing and some might not even bother to go back. Let's find out how to solve this in Drupal 8./p pIn a recent project a client wisely requested exactly that: whenever a user logs into the site, redirect them to the page they were before clicking the login link. This seemed like a very common request so we looked for a contrib module that provided the functionality. a href=https://www.drupal.org/project/login_destinationLogin Destination/a used to do it in Drupal 7. Sadly the Drupal 8 version of this module a href=https://www.drupal.org/node/2820772 does not provide the functionality yet./a/p pOther modules, and some combinations of them, were tested without success. Therefore, we built a href=https://www.drupal.org/sandbox/gnuget/2824414Login Return Page/a. It a very small module that just does one thing and it does it well: it appends codedestination=/current/page/code to all the links pointing to code/user/login/code effectively redirecting users to the page they were viewing before login. The project is a href=https://www.drupal.org/node/2824418waiting to be approved/a before promoting it to full project./p pemHave you had a similar need? Are there other things you are requested to do after login? Please share them in the comments./em/p

Third Grove: Theming form elements in Drupal 8

Tue, 11/29/2016 - 17:03
span property=schema:name class=field-name--titleTheming form elements in Drupal 8/span span class=field-name--uid rel=schema:authorspan lang= about=https://www.thirdandgrove.com/user/76 typeof=schema:Person property=schema:name datatype= xml:lang=ross/span/span span property=schema:dateCreated content=2016-11-29T16:03:29+00:00 class=field-name--createdTue, 11/29/2016 - 11:03/span

Xeno Media: Top Thirteen Drupal Twig Helper Modules

Tue, 11/29/2016 - 16:29
pWe have been loving learning Drupal 8’s theming system over the last year.  Drupal 8 core now uses the a href=http://twig.sensiolabs.org/Twig template engine/a, which is a fast, flexible, and secure system that allows use to create the markup needed for the modern web./p p dir=ltrWhat you can do with Drupal core’s Twig is pretty great, but the Drupal community always brings so much more to the table after real world use.  We don’t use them all, all of the time, but have used many as our design and development needed.  Here are our favorite modules to help build out your Drupal themes./p a href=https://www.drupal.org/project/twig_tweakTwig tweak/a p dir=ltrThe Twig Tweak Drupal module gives Drupal 8 themers additional commonly needed functions and filters to use in templating:/p ul dir=ltrlidrupal_view: Pass arguments to views./li lidrupal_block: Include a Drupal block./li lidrupal_entity: Include a Drupal entity./li lidrupal_field: Renders a field from a specific entity./li lidrupal_token: Use token API to deliver data to your templates./li lidrupal_config: Access and print configuration./li litoken_replace: Place multiple tokens./li lipreg_replace: The easiest way to alter their output./li liimage_style: Provide either path or URI to original image./li /ulp dir=ltrIt also allows for you to turn PHP filter back on, which isn't recommended, and is off by default./p a href=https://www.drupal.org/project/twig_field_valueTwig Field Value/a p dir=ltrThe Twig Field Value Drupal module allows Drupal 8 themers to get partial data from field render arrays.  If you want to have control of the markup on your field’s label and/or value, you can.  If you want to choose the field’s text format, you can.  This great utility module gives us the following filters:/p ul dir=ltrlifield_label: Returns the field label value./li lifield_value: Returns the render array of the field value(s) without the field wrappers./li lifield_raw: Returns raw field properties value(s)./li lifield_target_entity: Returns the referenced entity object(s) of an entity reference field./li /ula href=https://www.drupal.org/project/twig_extensionsTwig Extensions/a p dir=ltrThis handy Drupal 8 module adds support for the a href=http://twig.sensiolabs.org/doc/extensions/index.htmlTwig Extensions library/a.  The library adds additional filters to Twig itself, and this module allows us to use them in Drupal./p ul dir=ltrlia href=http://twig.sensiolabs.org/doc/extensions/text.htmlText/a: Provides useful filters for text manipulation./li lia href=http://twig.sensiolabs.org/doc/extensions/i18n.htmlI18n/a: Adds internationalization support via the gettext library./li lia href=http://twig.sensiolabs.org/doc/extensions/intl.htmlIntl/a: Adds a filter for localization of DateTime objects./li lia href=http://twig.sensiolabs.org/doc/extensions/array.htmlArray/a: Provides useful filters for array manipulation./li lia href=http://twig.sensiolabs.org/doc/extensions/date.htmlDate/a: Adds a filter for rendering the difference between dates./li /ula href=https://www.drupal.org/project/twig_extenderTwig Extender/a p dir=ltrThe Twig Extender Drupal module adds a plugin system to add new twig extensions.  It includes one filter (truncate), and one function (user_is_logged_in), and promises more in the future.  Looks very promising./p a href=https://www.drupal.org/project/themable_formsThemable forms/a p dir=ltrThis simple, and extremely helpful Drupal 8 module adds theme suggestions for form elements./p ul dir=ltrliform-element--[form-id]--[element-type].html.twig/li liform-element--form-id--[form-id].html.twig/li liform-element--type--[element-type].html.twig/li liform-element.html.twig/li /ula href=https://www.drupal.org/project/twig_renderableTwig Renderable/a p dir=ltrThe Twig Renderable Drupal module is another module that adds Twig functions and filters, this time that work specifically with render arrays./p p dir=ltrFunction/p ul dir=ltrliwill_have_output('path', 'to', 'render', 'array')/li /ulp dir=ltrFilters/p ul dir=ltrliadd_class(string|array $class)/li limerge_attributes(array|\Drupal\Core\Template\Attribute $attributes)/li /ula href=https://www.drupal.org/project/transliterateTransliterate Twig Filter/a p dir=ltrThis module adds a single Twig filter for transliterating diacritic strings. Transliteration is the conversion of a text from one script to another, and this module converts diacritic characters, those that have accents in them, to their normal counterparts./p p dir=ltrThe included example shows how it works:/p p dir=ltr{{ 'Hällo' | transliterate() }} becomes = Hallo/p a href=https://www.drupal.org/project/responsive_svgResponsive SVG/a p dir=ltrThe Responsive SVG Drupal module that adds a Twig filter, with quite a few options for a href=http://simurai.com/blog/2012/04/02/svg-stacksSVG Stacks/a.  SVG Stacks are like image sprites, where you have multiple images in one file, though these images are Scalable Vector Graphics.  Support for regular SVGs forthcoming./p a href=https://www.drupal.org/project/twig_xdebugTwig Xdebug/a p dir=ltrThe Twig Xdebug Drupal module adds the ability to use Xdebug within Twig templates.  Add {{ breakpoint() }} into the template where you want to debug, and when the Xdebug processor reaches it, a separate file will open so you can inspect the variables up to that breakpoint. The key values you'll see at the breakpoint are:/p ul dir=ltrli$context: Variables available to use in the template./li li$environment: Info about the Twig environment, including available functions./li li$arguments: You can also add arguments like {{ breakpoint(fields) }}./li /ula href=https://www.drupal.org/project/twig_clean_debugTwig Clean Debug/a p dir=ltrThis simple and handy module adds a Twig filter that removes the Twig debugging output, those informative HTML comments that let you know which templates are available, but they can also get in the way of what you are working on!/p p dir=ltrUpdate your template to use {{ content.field_image|clean_debug|raw }} when you are developing.  Remember to remove it before pushing to production though, it will error our if twig debug is not on!/p a href=https://www.drupal.org/project/twig_link_attributesTwig Link Attributes/a p dir=ltrThe Twig Link Attribute Drupal module adds a Twig filter that allows you to add attributes to links, which also merges them with existing attributes.  Works well with the a href=https://www.drupal.org/project/menu_link_attributesMenu Link Attributes/a module, but safely keeps some attributes in code, while Site builders and administrators can manage attributes in the UI./p a href=https://www.drupal.org/project/tlhThemers Little Helper/a p dir=ltrSimilar to Twig Tweak, the Themers Little Helper (TLH) Drupal module adds a bunch of Twig filters and functions, and promises more!  The current release includes:/p ul dir=ltrlibase_url: the Base URl of the site./li liWrap filter: {{ content.title_field|wrap('h3') }} for wrapping markup around fields./li lidrupal_view: Embed a view direct in your template./li lidrupal_block: Embed a block direct in your template./li lidump(variable): Support for thea href=https://www.drupal.org/project/vardumper Vardumper module/a, which is faster than kint./li /ula href=https://www.drupal.org/project/componentsComponent Libraries/a p dir=ltrFinally, the Components Libraries Drupal module allows you to register “component libraries” defined by your theme or module as Twig namespaces.  This means that you can specify a different directory, rather than a folder called “templates” for your Twig files.  This is lays the foundation for being able to use component based theming, where each aspect of the design is an individual piece, or component, and allowing integrating the external tools like a href=http://patternlab.io/Pattern Lab/a and a href=https://github.com/kss-node/kss-nodeKSS Node/a, which would also use this Twig templates for living style guides./p p dir=ltrHappy theming!/p

Acquia Developer Center Blog: Learn Drupal 8 for Free: Special Two-hour Version of FFW’s Drupal 8 Site Building Class

Tue, 11/29/2016 - 16:09
div class=field field-name-field-blog-image field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item evenimg typeof=foaf:Image class=img-responsive src=https://dev.acquia.com/sites/default/files/styles/blog__190_x110_/public/blog/acquiaacademydrop1_1.jpg?itok=nAsGBXx9 width=140 height=85 alt=acquia academy drop title=acquia academy drop //div/div/divdiv class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpa href=https://ffwagency.com/FFW/a, the mega digital agency, is offering a free, two-hour course for business technology and marketing decision makers who want a compressed intro to Drupal with the added benefit of a live instructor. /p pThe class focuses on Drupal’s core concepts so organizations can get the most out of the platform and avoid common mistakes. It’s designed to help smooth Drupal adoption by companies and organizations./p pIt's coming up on Thursday, December 08, 2016, from 1 PM to 3 PM EST./p/div/div/divdiv class=field field-name-field-blog-tags field-type-taxonomy-term-reference field-label-inline clearfixdiv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/tags/acquia-drupal-planet typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=acquia drupal planet/a/div/div/div

ComputerMinds.co.uk: Replacing a vocabulary listing

Tue, 11/29/2016 - 14:00
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-items id=md1div class=field-item even itemprop=articleBodypIn a recent Drupal 8 project, one of the site's vocabularies had several thousand terms in it (representing airports), which caused its admin listing page to run out of memory before it could render. I wanted to solve this without affecting any other vocabularies on the site, and improve the listing itself along the way to be more useful, with filters to make searching it much easier. The original listing is not a view, and loads much more than it needs to. Here's the customised page for airports that I wanted to head towards:/p pimg src=/sites/www.computerminds.co.uk/files/styles/large/public/after_0.jpg?itok=U6zCTH29 width=480 height=428 alt=Customised airports view title=Customised airports view class=image-large //p /div/div/div

Agiledrop.com Blog: AGILEDROP: Drupal Camps in South America

Tue, 11/29/2016 - 07:21
a href=http://www.agiledrop.com/blog/drupal-camps-south-americaimg src=https://www.agiledrop.com/sites/default/files/2016-11/drupal%20camps%20in%20south%20america.jpg/a Famous beach Copacabana and football are the most frequent associations when we think of South America. Well, there are plenty more things there, that's for sure. Drupal Camps are one of those. In our world tour we already touched continents like Europe, North America, Asia and Africa. In the exact same sequence are continents listed from one with the most Drupal Camps (Europe) to the one with the least Drupal Camps (Africa). We expected to find South America between Asia and Africa, but for the first time, we were wrong. Our assumptions were so wrong, that it was difficult to process… a href=http://www.agiledrop.com/blog/drupal-camps-south-americaREAD MORE/a

blog.studio.gd: Drupal 8 Views Plugins (Part 2) : The display extender plugin

Tue, 11/29/2016 - 03:36
Let's see how and why to use a views display extender plugin.

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

Tue, 11/29/2016 - 03:36
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.

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

Tue, 11/29/2016 - 03:36
Some notes about the new Configuration management system in Drupal 8