Drupal Planet

Syndicate content
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 11 hours 11 min ago

php[architect]: Testing Your Drupal Site with Behat

Tue, 08/09/2016 - 1:05pm
div class=aligncenterimg class=wp-image-10937 size-full aligncenter src=https://www.phparch.com/wp-content/uploads/2016/08/screenshot.png alt=Screenshot of Behat tests results width=400 height=290 srcset=https://www.phparch.com/wp-content/uploads/2016/08/screenshot.png 400w, https://www.phparch.com/wp-content/uploads/2016/08/screenshot-300x218.png 300w, https://www.phparch.com/wp-content/uploads/2016/08/screenshot-160x116.png 160w sizes=(max-width: 400px) 100vw, 400px //div pIf automated testing is not already part of your development workflow, then it’s time to get started. Testing helps reduce uncertainty by ensuring that new features you add to your application do not break older features. Having confidence that your not breaking existing functionality reduces time spent hunting bugs or getting reports from clients by catching them earlier./p pUnfortunately, testing still does not get the time and attention it needs when you’re under pressure to make a deadline or release a feature your clients have been asking for. But—like using a version control system and having proper development, staging, and production environments—it should be a routine part of how you do your work. We are professionals, after all. After reading all the theory, I only recently took the plunge myself. In this post, I’ll show you how to use Behat to test that your Drupal site is working properly./p pBefore we dive in, the a href=http://docs.behat.org/en/v3.0/Behat documentation/a describes the project as:/p blockquotep[#8230;] an open source Behavior Driven Development framework for PHP 5.3+. What’s behavior driven development, you ask? It’s a way to develop software through a constant communication with stakeholders in form of examples; examples of how this software should help them, and you, to achieve your goals./p/blockquote pBasically, it helps developers, clients, and others communicate and document how an application should behave. We’ll see shortly how Behat tests are very easy to read and how you can extend them for your own needs./p pMink is an extension that allows testing a web site by simulating interacting with it through a browser to fill out form fields, click on links, and so forth. Mink lets you test via Goutte, which makes requests and parses the contents but can’t execute JavaScript. It can also use Selenium, which controls a real browser and can thus test JS and Ajax interactions, but Selenium requires more configuration./p h2 id=requirementsRequirements/h2 pTo get started, you’ll need to have Composer on your machine. If you don’t already, head over to the a href=http://getcomposer.orgComposer Website/a. Once installed, you can add Behat, Mink, and Mink drivers to your project by running the following in your project root:/p precodecomposer require behat/behat composer require behat/mink composer require behat/mink-selenium2-driver composer require behat/mink-extension/code/pre pOnce eveything runs, you’ll have a codecomposer.json/code file with:/p pre class=jscode class=language-javascript require: { behat/behat: ^3.1, behat/mink: ^1.7, behat/mink-selenium2-driver: ^1.3, behat/mink-extension: ^2.2 },/code/pre pThis will download Behat and it’s dependencies into your codevendor//code folder. To check that it works do:/p precodevendor/bin/behat -V/code/pre pThere are other ways to install Behat, outlined in the a href=http://docs.behat.org/en/v3.0/quick_intro_pt1.htmlquick introduction/a./p pThe Drupal community has a contrib project, a href=https://www.drupal.org/project/drupalextensionBehat Drupal Extension/a, that is an integration for Behat, Mink, and Drupal. You can install it with the requre command below. I had to specify the code~3.0/code version, otherwise composer couldn#8217;t satisfy dependencies./p precodecomposer require drupal/drupal-extension:~3.0/code/pre pAnd you’ll have the following in your codecomposer.json/code:/p precode drupal/drupal-extension: ~3.0,/code/pre h2 id=configuring-behatConfiguring Behat/h2 pWhen you run Behat, it’ll look for a file named codebehat.yml/code. Like Drupal 8, Behat uses YAML for configuration. The file tells Behat what contexts to use. Contexts provide the tests that you can run to validate behavior. The file configures the web drivers for Mink. You can also configure a coderegion_map/code which the Drupal extension uses to map identifiers (left of the code:/code) to CSS selectors to identify theme regions. These come in very handy when testing Drupal theme output./p pThe one I use looks like:/p precode class=language-yamldefault: suites: default: contexts: - Drupal\DrupalExtension\Context\DrupalContext - Drupal\DrupalExtension\Context\MarkupContext - Drupal\DrupalExtension\Context\MessageContext - FeatureContext extensions: Behat\MinkExtension: goutte: ~ javascript_session: selenium2 selenium2: wd_host: http://local.dev:4444/wd/hub capabilities: {browser: firefox, version: 44} base_url: http://local.dev Drupal\DrupalExtension: blackbox: ~ region_map: breadcrumb: '#breadcrumb' branding: '#region-branding' branding_second: '#region-branding-second' content: '#region-content' content_zone: '#zone-content' footer_first: '#region-footer-first' footer_second: '#region-footer-second' footer_fourth: '#region-footer-fourth' menu: '#region-menu' page_bottom: '#region-page-bottom' page_top: '#region-page-top' sidebar_first: '#region-sidebar-first' sidebar_second: '#region-sidebar-second'/code/pre h2 id=writing-a-simple-featureWriting a Simple Feature/h2 pNow comes the fun part. Let’s look at writing a feature and how to test that what we expect is on the page. The first time we run it, we need to initialize Behat to generate a codeFeatureContext/code class. Do so with:/p precodevendor/bin/behat --init/code/pre pThat should also create a codefeatures//code directory, where we will save the features that we write. To behat, a feature is test suite. Each test in a feature evaluates specific functionality on your site. A feature is a text file that ends in code.feature/code. You can have more than one: for example, you might have a codeblog.feature/code, codemembers.feature/code, and coderesources.feature/code if your site has those areas available./p blockquote class=calloutpOf course, don’t confuse what Behat calls a feature—a set of tests—with the Features module that bundles and exports related functionality into a Drupal module./p/blockquote pFor my current project, I created a codeglobal.feature/code file that checks if the blocks I expect to have in my header and footer are present. The contents of that file are:/p precode class=language-gherkinFeature: Global Elements Scenario: Homepage Contact Us Link Given I am on the homepage Then I should see the link Contact Us in the branding_second region Then I should see the Search button in the branding_second region Then I should see the div#block-system-main-menu element in the menu region/code/pre pAs you can see, the tests is very readable even though it isn#8217;t purely parsing natural language. Indents help organize Scenarios (a group of tests) and the conditions needed for each scenario to pass./p pYou can set up some conditions for the test, starting with “Given”. In this case, given that we’re on the homepage. The Drupal Extension adds ways to specify that you are a specific user, or have a specific role, and more./p pNext, we list what we expect to see on the webpage. You can also tell Behat to interact with the page by specifying a link to click, form field to fill out, or a button to press. Again here, the Drupal extension (by extending the MinkExtension), provides ways to test if a link or button are in one of our configured regions. The third test above uses a CSS selector, like in jQuery, to check that the main menu block is in the menu region./p h2 id=testing-user-authenticationTesting user authentication/h2 pIf you’re testing a site that is not local, you can use the drush api driver to test user authentication, node creation, and more. First, setup a drush alias for your site (in this example, I’m using codelocal.dev/code. Then add the following are in your codebehat.yml/code:/p precode class=language-yaml api_driver: 'drush' drush: alias: local.dev/code/pre pYou can then create a scenario to test the user login’s work without having to specify a test username or password by tagging them with code@api/code/p precode class=language-gherkin @api Scenario: Admin login Given I am on the homepage Given I am logged in as a user with the admin role Then I should see the heading Welcome in the content region/code/pre pIf you’ve customized the username text for login, your test will fail. Don’t worry! Just add the following to your codebehat.yml/code file so that the test knows what text to look for. In this case, the username field label is just emE-mail/em./p precode text: username_field: E-mail/code/pre h2 id=custom-testing-by-extending-contextsCustom Testing by Extending Contexts/h2 pWhen you initialized Behat, it created a codefeatures/bootstraps/FeatureContext.php/code file. This can be a handy class for writing custom tests for unique features on your site. You can add custom tests by using the a href=http://behat-drupal-extension.readthedocs.io/en/3.1/subcontexts.htmlDrupal Extension’s own sub-contexts/a. I changed my Feature Context to extend the Mink Context like this:/p pre class=phpcode class=language-phpclass FeatureContext extends MinkContext implements SnippetAcceptingContext {/code/pre pNote that if you do that, you’ll need to remove codeMinkContext/code from the explicit list of default context in codebehat.yml/code./p pNo matter how you organize them, you can then write custom tests as methods. For example, the following will test that a link appears in the breadcrumb trail of a page. You can use CSS selectors to find items on the page, such as the ‘#breadcrumb’ div in a theme. You can also re-use other tests defined by the codeMinkContext/code like codefindLink/code./p pre class=phpcode class=language-php/** * @Then I should see the breadcrumb link :arg1 */ public function iShouldSeeTheBreadcrumbLink($arg1) { // get the breadcrumb /** * @var Behat\Mink\Element\NodeElement $breadcrumb */ $breadcrumb = $this-gt;getSession()-gt;getPage()-gt;find('css', 'div#breadcrumb'); // this does not work for URLs $link = $breadcrumb-gt;findLink($arg1); if ($link) { return; } // filter by url $link = $breadcrumb-gt;findAll('css', a[href=\{$arg1}\]); if ($link) { return; } throw new \Exception( sprintf(Expected link %s not found in breadcrumb on page %s, $arg1, $this-gt;getSession()-gt;getCurrentUrl()) ); }/code/pre pIf your context implements the codeSnippetAwareContext/code, behat will generate the Docblock and method signature when it encounters an unknown test. If you’re feature has the following:/p precode Then I should see foo-logo.png as the header logo./code/pre pWhen you run your tests, behat will output the error message below that you can copy and paste to your context. Anything in quotes becomes a parameter. The DocBlock contains the annotation Behat uses to find your test when it’s used in a scenario./p precode class=language-php/** * @Then I should see :arg1 as the header logo. */ public function iShouldSeeAsTheHeaderLogo($arg1) { throw new PendingException(); }/code/pre h2 id=seleniumSelenium/h2 pFollow the Behat docs to install selenium: a class=uri href=http://mink.behat.org/en/latest/drivers/selenium2.htmlhttp://mink.behat.org/en/latest/drivers/selenium2.html/a. When you’re testing you’ll need to have it running via:/p precodejava -jar /path/to/selenium-server-standalone-2.53.0.jar /code/pre pTo tell Behat how to use selenium your codebehat.yml/code file should have:/p precode class=language-yaml selenium2: wd_host: http://local.dev:4444/wd/hub capabilities: {browser: firefox}/code/pre pYou’ll also need to have Firefox installed. OF course, at the time of this writing, Firefox is asking people to transition from use Webdriver to Marionette for automating browser usage. I have Firefox 47 and it’s still working with Webdriver as far as I can tell. I have not found clear, concise instructions for using Marionette with Selenium. Another option is to use Phantom.JS instead of Selenium for any features that need a real browser./p pOnce everything is working—you’ll know it locally because a Firefox instance will pop up—you can create a scenario like the following one. Use the code@javascript/code tag to tell Behat to use Selenium to test it./p precode class=language-gherkin @javascript Scenario: Modal Popup on click Given I am at /some/page When I click View More Details Then I wait for AJAX to finish Then I should see an #modal-content element Then I should see text matching This is a Modal/code/pre h2 id=conclusionsConclusion/h2 pIf you don’t have tests for your site, I urge you to push for adding them as part of your ongoing work. I’ve slowly added them to my main Drupal client project over the last few months and it’s really started to pay off. For one, I’ve captured many requirements and expectations about how pages on the site work that were only in my or the project manager’s heads, if not lost in a closed ticket somewhere. Second, whenever I merge new work in and before any deploy I can run tests. If they are all green, I can be confident that new code and bug fixes haven’t caused a regression. At the same time, I now have a way to test the site that makes it less risky to re-factor or reorganize code. I didn’t spend a lot of time building tests, but as I work on a new feature or fix a bug, writing a test is now just part of confirming that everything works as expected. For complicated features, it’s also become a time saver to have a test that automates a complicated interactions—like testing a 3-page web form, since Behat can run that scenario much faster than I can manually./p pThe benefits from investing in automated testing outweigh any initial cost in time and effort to set them up. What are you waiting for?/p
Categories: Drupal Feeds

Arpit Jalan: GSOC 2016- Moving supporting functions to services and abstract parent classes- Week 11

Tue, 08/09/2016 - 11:11am
div dir=ltr style=text-align: left; trbidi=ondiv dir=ltr style=line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;span style=background-color: transparent; color: black; font-family: quot;arialquot;; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;TL;DR/spanspan style=background-color: transparent; color: black; font-family: quot;arialquot;; font-size: 14.666666666666666px; font-style: italic; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; Last week I had worked on modifying the tests for “Fill Alt Text”, “Emotion Detection” and “Image Properties” features of the Google Vision API module. The only tasks left are moving the supporting functions to a separate service, in addition to, creating an abstract parent class for tests and moving the functions there./span/divb id=docs-internal-guid-f383f257-7012-934e-331a-ef3748e1b046 style=font-weight: normal;br //bbr /div dir=ltr style=line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;span style=background-color: transparent; color: black; font-family: quot;arialquot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;The issues /spana href=https://www.drupal.org/node/2743815 style=text-decoration: none;span style=background-color: white; color: #1155cc; font-family: quot;arialquot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;Alt Text field gets properly filled using various detection features/span/aspan style=background-color: transparent; color: black; font-family: quot;arialquot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;, /spana href=https://www.drupal.org/node/2759031 style=text-decoration: none;span style=background-color: white; color: #1155cc; font-family: quot;arialquot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;Emotion Detection(Face Detection) feature/span/aspan style=background-color: transparent; color: black; font-family: quot;arialquot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; and /spana href=https://www.drupal.org/node/2754391 style=text-decoration: none;span style=background-color: white; color: #1155cc; font-family: quot;arialquot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;Implementation of Image Properties feature/span/aspan style=background-color: transparent; color: black; font-family: quot;arialquot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; of the /spana href=https://www.drupal.org/project/google_vision style=text-decoration: none;span style=background-color: white; color: #1155cc; font-family: quot;arialquot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;Google Vision API/span/aspan style=background-color: transparent; color: black; font-family: quot;arialquot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; module are still under review by my mentors. Meanwhile, my mentors asked me to move the supporting functions of the “Fill Alt Text” issue to a separate service and use it from there. In addition, they also suggested me to create an abstract parent class for the Google Vision simple tests, and move the supporting functions to the parent class. Thus, this week, I contributed to follow these suggestions and implement them out./span/divb style=font-weight: normal;br //bbr /div dir=ltr style=line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;span style=background-color: transparent; color: black; font-family: quot;arialquot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;There are few supporting functions, namely, google_vision_set_alt_text() and google_vision_edit_alt_text() to fill the Alt Text in accordance to the feature requested from the Vision API, and also to manipulate the value, if needed. I moved these functions to a separate service, namely, FillAltText, and have altered the code to use the functions from there instead of directly accessing them./span/divb style=font-weight: normal;br //bbr /div dir=ltr style=line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;span style=background-color: transparent; color: black; font-family: quot;arialquot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;In addition, there are a number of supporting functions used in the simple web tests of the module, to create users, contents and fields, which were placed in the test file itself, which in one way, is a kind of redundancy. Hence, I moved all these supporting functions to abstract parent class named GoogleVisionTestBase, and altered the test classes to extend the parent class instead and in place of WebTestBase. This removed the redundant code, as well as, gave a proper structure and orientation to the web tests./span/divbr /span style=font-family: quot;arialquot;; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;These minor changes would be committed to the module directly, once the major issues are reviewed by my mentors and committed to the module./span/div
Categories: Drupal Feeds

Galaxy: GSoC’ 16: Port Search Configuration module; coding week #11

Tue, 08/09/2016 - 11:05am
div class=field field-name-field-image field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item even rel=og:image rdfs:seeAlso resource=http://galaxy-joyceg.rhcloud.com/sites/default/files/styles/large/public/field/image/testResult.png?itok=zo_3YIF6img typeof=foaf:Image class=img-responsive src=http://galaxy-joyceg.rhcloud.com/sites/default/files/styles/large/public/field/image/testResult.png?itok=zo_3YIF6 width=480 height=211 alt=A sample test result. //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:encodedpI have been involved with the a href=https://summerofcode.withgoogle.com/Google Summer of Code' 16/a project a href=https://www.drupal.org/project/search_configSearch Configuration/a module to a href=https://www.drupal.org/8Drupal 8/a. It is entering into the final week of coding. I have really enjoyed the project process. This give university students a unique opportunity to code for real world projects that will be used by the various open source organisations.br / Past week I dealt with testing certain components of my ported module. I worked on implementing the a href=https://www.drupal.org/project/simpletestsimpletest/a to test the various functionalities. I would like to take this opportunity to share with you the features of simpletest and how to implement it to test the proper working of the functionalities of various sections of the Drupal modules./p pThe test files are generally kept in src/Tests/ of the root of the module directory. The name of the test file should be suffixed by Test.php. Add a class that extends the webTestBase. Also, you need to add a namespace for the easy location of the class./p pAdd the name of the module to get loaded. i.e,br / public static $module = ['search_config'];/p pNow lets start writing the test cases. The functions which should be executed should be prefixed by 'test'. For instance, to navigate to a particular link and check whether it returns the correct page;br / public function testLink() {br / $this-gt;drupalGet('mypages/search');br / $this-gt;assertResponse(200);br / }/p pYou can run this test by going to Configuration-gt;Testing-gt;Select the test.br / Also, add this test file to the .info.yml file. The following line of code will be sufficient enough.br / files[]: src/Tests/fileTest.php/p pThere are various types of test cases, here are the a href=https://www.drupal.org/node/265828assertions/a available.br / So, here is the complete structure of a sample test file to check the accessibility of a page in my search configuration module:br / lt;?php/p pnamespace Drupal\search_config\Tests;br / use Drupal\simpletest\WebTestBase;/p p/**br / * Class searchTestbr / * @group search_configbr / */br / class SearchConfigFormTest extends WebTestBase {br / public static $module = ['search_config'];/p p /**br / * Function to test the accessibility of the search configuration module location.br / */br / public function testSearchConfigURL() {br / $this-gt;drupalGet('admin/config/search/pages');br / $this-gt;assertResponse(200);br / }br / }/p pWe need to ensure that we write the group of test, i.e the @group tag. Here in this case is the search_config. The tests won't appear in the testing option in the absence of this tag. Also, ensure that a good definition of the function is given as comments for better understanding for the users reading the code.br / You could also try out the various other assertions available to explore the various functionalities implemented. The a href=https://www.drupal.org/project/search_config/releases/8.x-1.x-devdevelopment version/a of the module is currently available in the Drupal core. /p pStay tuned for further updates on this porting process./p /div/div/divdiv class=field field-name-field-tags field-type-taxonomy-term-reference field-label-abovediv class=field-labelTags:nbsp;/divdiv class=field-itemsdiv class=field-item even rel=dc:subjecta href=/taxonomy/term/1 typeof=skos:Concept property=rdfs:label skos:prefLabel datatype=drupal-planet/a/div/div/div
Categories: Drupal Feeds

Acquia Developer Center Blog: A Gentle Introduction to Data Science

Tue, 08/09/2016 - 9:23am
div class=field field-name-field-blog-image field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item evenimg typeof=foaf:Image src=https://dev.acquia.com/sites/default/files/styles/blog__190_x110_/public/blog/datascience.jpg?itok=k-pjZJzV width=140 height=85 alt=data science //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:encodedpThe words Data Science are not themselves sources of dread in most people. At just four and seven letters, respectively, they're almost too cute to be really off-putting like some of the other terms you come across when you begin digging into the field; terms like k-nearest neighbors or tessellation./p pAnd if you can hear the phrase Euclidian minimum spanning tree without feeling as though you've encountered something both bizarrely fascinating and deeply disturbing, you are a stronger intellectual force than I./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
Categories: Drupal Feeds

Cheeky Monkey Media: Bootstrap Carousel + Drupal Paragraphs = Magic

Tue, 08/09/2016 - 9:17am
span class=field field--name-title field--type-string field--label-hiddenBootstrap Carousel + Drupal Paragraphs = Magic/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-08/bootstrap_plus_drupalparagraphs.jpg width=1380 height=444 alt=Bootstrap Carousel + Drupal Paragraphs = Magic by Calvin Tyndall, Hybrid Monkey Wrencher at Cheeky Monkey Media //div span class=field field--name-uid field--type-entity-reference field--label-hiddena title=View user profile. href=https://cheekymonkeymedia.ca/users/calvin class=usernamecalvin/a/span span class=field field--name-created field--type-created field--label-hiddenTue, 08/09/2016 - 14:17/span div class=clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__itempstrongNOTE: /strongThis tutorial assumes you have some knowledge of Drupal site building, field and field display management. It will include some theming code examples./p pIf you've never heard of the Paragraphs module, it allows you to create bundles of fields and then call in those bundles via a paragraphs field on another entity. You can then add any number of these bundles into the entity, in any combination, to build out a page or some other super snazzy component./p pBuild bundles for a masthead, a pull quote, a banner, a simple text area... etc., and an editor now has a collection of tools to build dynamic pages, beyond the oldschool Title/Body/WYSIWYG situation. There are even modules that will help you get all parallaxy and animated with paragraphs./p pThe really beautiful thing is, you can nest paragraphs items. Yes, paragraphs items, within paragraphs items within... (The word Inception popped up a lot as we worked out various models)./p pOk, so here's a practical example I built recently./p/div
Categories: Drupal Feeds

Anexus: How to add ReactJS in Drupal 8 with Composer

Tue, 08/09/2016 - 8:37am
span class=field field--name-title field--type-string field--label-hiddenHow to add ReactJS in Drupal 8 with Composer/span div class=clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__itempInside the Drupal-verse the usage of Composer in our workflow is getting more and more popular./p pTo be honest, the immersion of composer in Drupal community hasn't been easy, but changes never are easy./p pFor the beginning of 2015, a new project sees the light a href=http://drupal-composer.orgDrupal Composer/a with the idea of modifying the way we do our development process in Drupal./p pDrupal Composer project cover from install Drupal core, modules, themes, dependencies, patches and a long list of etc./p pOne of the elements that Drupal Composer it's going to replace is the famous *Drush Make*./p pAs I said the changes are not easy, and mostly everybody in our community is little lost (including me) regarding became familiar with this new way of doing our daily task in your jobs./p pFor that reason, I want to share with your, how to install a href=https://github.com/facebook/reactReactJS/a as a library to be used in our a href=https://www.drupal.org/8Drupal 8/a Projects./p pMaybe you could be thinking, well what is the fuss, and we could install ReactJS easily using a href=https://bower.ioBower/a; /p pBut, the problem of use Bower is related with the fact of Bower doesn't know anything about Drupal, Bower doesn't have any idea where libraries in Drupal must be allocated, for that reason isn't the proper tool for our needs./p h21. Drupal Installation./h2 pIn this example I will assume that did you install Drupal using *Drupal Composer* project, using an instruction similar to the following:/p pre $ composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction/pre h22. Adding repository/h2 pThe library, ReactJS is not part of composer a href=https://packagist.orgPackagist/a, but event that is possible to define a custom repository using ReactJS GitHub repository, adding a new composer repository in your composer.json file/p pre repositories: [ { type: package, package: { version: 15.3.0, name: drupal-libraries/reactjs, type: drupal-library, source: { url: https://github.com/facebook/react.git, type: git, reference: 15.3.0 }, dist: { url: https://github.com/facebook/react/releases/download/v15.3.0/react-15.3.0.zip, type: zip } } } ]/pre pAs you can see, we provide the ReactJS information in two formats, the first one is the GitHub repo and the second is a zip file of a specific release, depends of composer options, ReactJS will be clones or just downloaded and extracted. /p h23. Adding ReactJS  in your project /h2 pWith your new ReactJS repository correctly added in your composer.json file the only remaining task in download the code using the next instructions./p pre $ composer require drupal-libraries/reactjs 15.3.0/pre pWhen this command finished we will get inside strongem/web/libraries//em/strongstrongemreactjs/em/strong the requires files/p pre libraries `-- reactjs |-- build | |-- react-dom.js | |-- react-dom.min.js | |-- react-dom-server.js | |-- react-dom-server.min.js | |-- react.js | |-- react.min.js | |-- react-with-addons.js | `-- react-with-addons.min.js |-- examples | |-- basic | |-- basic-click-counter | |-- basic-commonjs | |-- basic-jsx | |-- basic-jsx-external | |-- basic-jsx-harmony | |-- basic-jsx-precompile | |-- fiber | |-- jquery-bootstrap | |-- jquery-mobile | |-- quadratic | |-- README.md | |-- shared | |-- transitions | `-- webcomponents `-- README.md/pre pI recommend checking the slides strongemImproving your Drupal 8 development workflow/em/strong a href=http://weknowinc.com/talks/2016/drupalgov-workflowhttp://weknowinc.com/talks/2016/drupalgov-workflow/a for more references about how to use Composer in Drupal 8 projectsbr /  /p pIf you are interested in more tricks and tips related to the new workflow in Drupal 8, stay tuned because a href=http://jmolivas.com/Jesus Olivas/a and I will propose a BOF in DrupalCon Dublin to talk about the subject. /p /div span class=field field--name-uid field--type-entity-reference field--label-hiddenspan lang= about=http://www.anexusit.com/users/enzo typeof=schema:Person property=schema:name datatype= xml:lang=enzo/span/span span class=field field--name-created field--type-created field--label-hiddenTue, 08/09/2016 - 07:37/span div class=field field--name-field-blog-image field--type-image field--label-hidden field__items div class=field__item img src=http://www.anexusit.com/sites/default/files/drupal8-reactjs.png width=426 height=598 alt= typeof=foaf:Image //div /div div class=field field--name-field-comments field--type-disqus-comment field--label-hidden field__itemdrupal-render-placeholder callback=\Drupal\disqus\Element\Disqus::disqus_element_post_render_cache arguments=0=node1=616 token=f0a7abb9/drupal-render-placeholder/div
Categories: Drupal Feeds

InternetDevels: Drupal 8: overview of the Commerce 2.x module for online stores

Tue, 08/09/2016 - 7:28am
div class=field field--name-field-preview-image field--type-image field--label-hiddendiv class=field__itemsdiv class=field__item evenimg src=http://st3.internetdevels.net/sites/default/files/public/blog_preview/the_commerce_2x_module_for_drupal_8.jpg width=937 height=622 alt=Drupal 8: overview of the Commerce 2.x module for online stores //div/div/divdiv class=field field--name-body field--type-text-with-summary field--label-hiddendiv class=field__itemsdiv class=field__item evenp style=text-align: right;emE-commerce in Drupal 8 is a topic of interest for many developers. If you are among them, you’ve come to the right place — our a href=http://internetdevels.com/outsource/hire-drupal-developer target=_blankDrupal developer/a has written a blog post on the Commerce 2.x module./em/p a href=http://internetdevels.com/blog/the-commerce-2x-module-for-Drupal-8Read more/a/div/div/div
Categories: Drupal Feeds

ComputerMinds.co.uk: Drupal 8 Config Management - how should I add config to a D8 site?

Tue, 08/09/2016 - 7:00am
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-items id=md1div class=field-item even itemprop=articleBodypFor me this is the biggest unanswered question hanging over my development of Drupal 8 websites: How should I add config to a Drupal 8 site?/p pThis article will provide plenty of options, but unfortunately no definitive answer./p /div/div/div
Categories: Drupal Feeds

MD Systems blog: MD Systems introduced NP8 to the Big Apple

Tue, 08/09/2016 - 3:46am
At the beginning of July we attended NYC Drupal camp, which is part of a bigger, mission-driven open source conference called Open camps. NYC Drupal camp is one of the biggest community-organized Drupal events in the world and we are always eager to return to it.br /
Categories: Drupal Feeds

Chromatic: The Road to Speaking at DrupalCon

Mon, 08/08/2016 - 12:06pm
pEarlier this year a href=https://events.drupal.org/neworleans2016/sessions/aha-understanding-and-using-render-arrays-drupal-8I was fortunate to speak at DrupalCon New Orleans/a. I'd been working towards speaking at DrupalCon for a few years and it wasn’t until after I spoke that I reflected on just how much effort went into it. I had underestimated the process. Because I’m likely not alone in doing so, I’d like to share what I have learned along the way./p pI'll start with a href=#why-speakwhy I wanted to speak at DrupalCon/a. I'll then share a href=#my-storymy story/a before providing some a href=#adviceconcrete advice for every step of the way/a./p h2a name=why-speak/aWhy speak at DrupalCon?/h2 h3The audience benefits/h3 pWe’re an open source community and a well-crafted presentation is a valuable form of contribution. It provides information in a format that is often more effective than lines of code and walls of text. It also provides attendees with immediate access to the author for questions. Not to mention, the audience in the room is a small percentage of whom a recorded session will reach./p h3Your organization benefits/h3 pSponsoring an event like DrupalCon isn't always within reach for a smaller organization. While a session should never be a sales pitch, each one is a marketing opportunity. A chance to mention the organization, sport its logo, and hand out swag. The success of a session can also boost the perception of a given agency or organization./p h3You benefit/h3 pPublic speaking is an effective way to conquer a common fear and build confidence. Even veteran speakers still get nervous. Battling those nerves and coming out victorious is an excellent feeling./p pPublic speaking engagements are also an impressive line on a resume. Or perhaps it helps convince your boss that you’ve gone the extra mile and deserve that raise./p pFinally, even though you’ll be the one presenting, you will learn a lot while preparing. It’s common to believe you don't know enough about a topic to talk about it. If you're interested in a topic, propose it anyway and use it as motivation to dive deep into that topic./p h2a name=my-story/aMy story: You want to speak at DrupalCon? Start smaller/h2 pI first proposed a session hoping for a benefit I didn't already mention: a free ticket to DrupalCon Austin (2014). I'd co-founded a self-funded company and we were trying to save money. We submitted a session together and I knew we were in trouble when the proposal asked about our previous speaking experience. We didn't have any and our session wasn't selected. Strike one./p pThe company didn't last (not because we had to pay for the ticket), but I still wanted to speak at a DrupalCon. I now knew I would need to first speak at smaller events./p pI was living in Chicago and a href=http://2015.midcamp.org/session-proposal/need-better-way-organize-your-features-go-ask-aliceMidCamp 2015 accepted one of three sessions I proposed/a. I then proposed three for DrupalCon Los Angeles shortly thereafter. Unfortunately, MidCamp was after LA session selection so I still had little to show. Once again, my sessions weren’t selected. (Of course, it could’ve also been because my topics weren’t worthy.) Strike two./p pShortly after LA I moved to Golden, CO, and shortly after that a href=http://2015.drupalcampcolorado.org/session/contributing-client-work-cultureI spoke at DrupalCamp Colorado/a. Unfortunately my session didn't get recorded, but I was refining my skills nonetheless. Months later a href=https://chromatichq.com/blog/badcamp-2015-transitioning-theme-and-theme-functions-render-arrays-and-templatesI spoke about theme functions and render arrays at BADCamp 2015/a and I loved it. After BADCamp, I felt like I had established a track record and found a topic worthy of DrupalCon./p pI took a third swing. I proposed a session on render arrays to DrupalCon New Orleans (2016). I spent over five hours writing just the proposal. A month or two later I was ecstatic when I received word that my session was selected. Home run!/p pSpeaking at DrupalCon was a lot of fun, and was worth everything it took to get there. Looking back, I am thankful that the organizers consider experience at smaller events. Without that experience I would have been much less prepared. Speaking at DrupalCamps helped me refine my techniques and mental approach. It helped me build the confidence it takes to speak in front of a couple hundred people./p h2a name=advice/aAdvice for speaking at any Drupal event/h2 pThere are plenty of a href=http://speaking.io/websites/a, a href=http://bradfrost.com/blog/post/on-speaking/articles/a, and a href=https://www.youtube.com/watch?v=pVumgiMJeagvideos/a dedicated to providing advice for public speaking. I'm going to keep my advice to a list more tailored to Drupal events. I will link to some of those websites and articles when appropriate./p h3Picking an event/h3 ul lia href=http://drupical.com/Drupical/a is a great way to find DrupalCamps and other events. If nothing else, attend and attempt to speak at the camps closest to you./li liIf you’re able to travel for a DrupalCamp, you might as well attend the bigger ones. You can often find camp websites from previous years. See how many sessions they had, who from the community spoke, and how many people attended./li liSpeaking at local meetups is another opportunity to practice. You may find the smaller and more familiar audience to be a benefit or it might make you more nervous./li /ul h3Picking a topic/h3 ul liConsider the event's audience when brainstorming topics. DrupalCons often focus on the newest technology. Sessions at smaller events are more likely to be about less ambitious topics./li liOnly speak about topics you’re excited about. If not, it will be difficult to prepare for, and the audience will suffer from your lack of enthusiasm./li liIf you don't have confidence in your knowledge on intermediate topics, propose a beginner session. There are plenty of beginners at Drupal events and they need those sessions. That said, your lack of confidence may just be a href=https://en.wikipedia.org/wiki/Impostor_syndromeImposter Syndrome/a speaking./li /ul h3Proposing a session/h3 ul liWhen proposing a session, a href=http://larahogan.me/blog/my-presentation-workflow-and-challenges/tell a story/a. a href=https://events.drupal.org/barcelona2015/session-submission-liveAnother simple formula/a: introduce a pain point, allude to your solution, and explain what you’re going to cover. a href=https://2016.badcamp.net/sessions/proposeBe sure to proofread it!/a Compare it to those written by seasoned veterans and try to determine if yours is on the same level./li liUpdate your profile on the event's site with your picture and information. Make sure your online presence elsewhere, such as your Drupal.org profile, is up to date. Most events don’t do blind selections and they will look around to determine if you’re worthy./li liDrupalCon track chairs and DrupalCamp organizers make themselves available for feedback on session proposals. Ask them about yours! Listening to their suggestions and building familiarity with them is only going to help./li /ul h3Preparing and practicing/h3 ul liWhen preparing slides for a session, I’d recommend the design tips listed on a href=http://speaking.io/speaking.io/a. I’d recommend reading the entire site, actually. It is my favorite resource on speaking about technical topics. I also bought a href=http://speaking.io/deliver/remotes/the remote he suggests/a and I love it./li liI aim to finish building my slides a week before my talk. I then practice once a day for the week leading up to the talk. This reduces the pressure and gives me time to tweak anything I don't like while rehearsing./li liI also rehearse my talk in front of my wife. It helps get over the nerves because it’s hard to practice in front of someone you know well. She often has no idea what I’m talking about, but if she still doesn’t after 45 minutes of talking, I may have failed. Her questions often expose weaknesses in what I'm saying./li /ul h3Presenting a session/h3 ul liI received great advice before first speaking at MidCamp: If you've arrived early and are waiting to start your session, talk to people in the audience. It helps break the tension./li liMost Camps and all DrupalCons record the sessions. This may require you to remember to start the recording before you begin speaking. A volunteer will explain the technology to you, so you don’t have to worry about that. Just don’t forget to hit the record button!/li liAs for the rest, I’d again recommend reading a href=http://speaking.iospeaking.io/a’s advice on a href=http://speaking.io/prep/scoping-out-the-room/scoping out the room/a, a href=http://speaking.io/deliver/nervousness/dealing with nervousness/a, a href=http://speaking.io/deliver/your-voice/delivery/a, and a href=http://speaking.io/react/handling-questions/handling questions/a. Zach covers these topics better than I ever would./li liStart talking and have fun!/li /ul pThat’s about all I’ve got. Please reach out on Twitter (a href=https://twitter.com/guschilds@guschilds/a or a href=https://twitter.com/chromatichq@chromatichq/a) if you have any questions or any ideas to add to the list. We are an open source community, after all!/p
Categories: Drupal Feeds

Drupal core announcements: Don’t Miss the Drupal Midwest Developer Summit — Sign Up Today!

Mon, 08/08/2016 - 11:24am
pimg src=/files/midwestdrupalsummit2016-horizontal.png //p pIt’s 80 degrees and sunny in beautiful Ann Arbor, Michigan, and we are enjoying a tasty cold beverage while dreaming of sprints for Drupal 8 and the community that comes with them./p pMake your plans to join us for the Drupal Midwest Developer Summit, August 19-21, on the University of Michigan campus, in Ann Arbor MI./p pDrupal community members will be sprinting for 3 days to make D8 the best it can be. You don’t have to be a coder to come! We also need help with writing documentation, designing UI, and helping to organize the sprints./p pWe will be having a group lunch on Friday and Saturday provided by your registration fees./p pSign up now before registration closes in a little over a week./p h2Register at a href=https://mwds2016.eventbrite.comhttps://mwds2016.eventbrite.com/a/h2 pQuestions? Contact a href=mailto:mlhess@drupal.orgmlhess@drupal.org/a./p
Categories: Drupal Feeds

Acquia Developer Center Blog: Cf Shell: Streamlining CloudFormation Development with a Familiar Approach

Mon, 08/08/2016 - 10:46am
div class=field field-name-field-blog-image field-type-image field-label-hiddendiv class=field-itemsdiv class=field-item evenimg typeof=foaf:Image src=https://dev.acquia.com/sites/default/files/styles/blog__190_x110_/public/blog/server-room.jpg?itok=FBNnTJD_ width=140 height=85 alt=server room //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:encodedpAs Amazon Web Services has grown into the vast platform that it is today, it has created many opportunities for innovation: in how we interact with the products and how we fit all the pieces together. AWS's API-based nature has allowed an ecosystem of products to arise, all piggybacking on each other, ultimately enabling developers to explore unique ways to use their products./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
Categories: Drupal Feeds

Deeson: Getting to grips with automated deployment in Drupal 8

Mon, 08/08/2016 - 9:24am
pstrongMany agencies have a well defined way of deploying updates to their customers’ Drupal 7 sites. Deeson is no exception to that rule. With the massive changes in Drupal 8, we figured this process would need to be looked at again. Our recent a href=https://www.deeson.co.uk/blog/deesons-pixar-inspired-notes-dayNotes Day/a, a dedicated day for improving how we work as an agency, was the perfect opportunity to do so./strong/p h4Before we start/h4 pTo get a good understanding of what we were trying to (re)build, here’s a quick run-down of a common Drupal 7 set-up:/p olliWe use Drush make to download and patch everything that isn’t custom./li liCustom modules, themes and libraries are version controlled, while contributed code isn’t. This keeps the repository small./li liDrupal core is the exception: It is also version controlled so we can easily track changes to .htaccess files and the like./li liConfiguration is stored using the Features module. Our features are version controlled as custom modules./li liThe .gitignore file is configured for all of the above./li liWe use the Master module to enable/disable modules per environment/li /olp /p h4Composer all the things! Or not?/h4 pOur first goal was to move away from Drush make and use what everyone else is using: Composer. Drupal 8 uses it to build its own dependencies and has a href=https://www.drupal.org/node/2718229recently opened a Composer repository of its own/a. Keep in mind this is still in alpha./p pBut here we already ran into a major issue. a href=https://packagist.org/Packagist/a, the main Composer repository, a href=https://packagist.org/packages/drupal/drupalalready lists Drupal as a package/a. So if we want to grab the “drupal/drupal” package or the “drupal/core” package, Composer grabs it from Packagist instead of the official Drupal repository. This is due to Packagist trumping all other repositories./p pYou can, however, disable Packagist as a repository. But then you disable it for all required packages. Meaning if your site also needs a library from Packagist, you’re out of luck. There is no way to disable Packagist for just one package./p pTo add insult to injury, there’s also another community-built repository at a href=https://packagist.drupal-composer.org/https://packagist.drupal-composer.org//a and a “drupal/drupal” on Packagist which claims to replace “drupal/core”, even though the latter is the one you ideally want to use./p pstrongConclusion:/strong We have sources all over the web claiming to host Drupal for Composer, hardly any of them play together nicely and with the official repository in alpha it doesn’t seem like the situation will improve any time soon./p p /p h4So what should we use?/h4 pIf you are dead-set on using Composer, have a look ata href=https://github.com/bojanz/drupal-project/blob/8.x/composer.json the drupal-project repository on Github/a by Bojan Živanović. He knows a ton about Composer and managed to get it to work with Drupal 8./p pAs you can tell by looking at his repository, there is a lot more needed than just a composer.json file to get it to work. We found this to be a dealbreaker as we would be relying on Bojan’s expertise blindly without knowing half of what’s actually going on within our build process./p pIf you share our inhibitions and want to see how things evolve first, we do have good news! Drush make still works beautifully so you can port that workflow straight to Drupal 8 with little to no alterations. We decided to go with this option for the time being./p p /p h4Next up: Configuration management/h4 pWith Drupal 8 came the configuration management initiative (CMI). This basically replaces the Drupal 7 Strongarm module by allowing you to export any configuration as a YAML file./p pWe figured we’d use this instead of Features because it’s always good to cut out the middle man, right? Wrong. It turns out you can’t simply ship some YAML file updates to your server and expect the site to “revert” to the new state like Features used to do in Drupal 7./p pIf you want to update your configuration, you’ll need to both export the new YAML file and write an update hook that details exactly what’s changed. This is obviously quite cumbersome./p pFurthermore, you can’t enable a module that has certain configuration if it already exists in the website. Seeing as features are modules that do exactly that, the Features team had to swap out the configuration manager in Drupal 8 in order to make this work. Sounds dirty, but at least it works./p pstrongConclusion:/strong We gladly accept the presence of the middle man known as Features. We would have loved to use “just” Drupal core for this. Sadly it seems CMI fixed a lot of things, but not deployment workflows./p p /p h4Wow, so what about the Master module?/h4 pSo far we’ve scored 0 out of 2. The silver lining being that we can keep using the old workflow just fine. So with high hopes we took a look at the Drupal 8 version of the Master module. At least, we tried to - we couldn’t because there is no release for Drupal 8./p pAccording to the module maintainer “derhasi”, a href=https://www.drupal.org/node/2397817there are no plans to port Master to Drupal 8/a. Because this news has made us all really sad pandas, we may spend one of our developer lounges cooking up a successor because let’s face it: Nobody likes to score 0 out of 3./p p /p h4In conclusion/h4 pTo sum things up: It’s perfectly safe to use your old workflow for the time being. We’ve tried and tested it and it all works fine. Except Master. Master is really, really dead right now./p pHowever, we don’t want to advocate stagnation so we will keep a close eye on future developments regarding this subject./p pIt would also be great to hear from the people behind what we just investigated: Larry Garfield (Crell) for CMI or Bojan Živanović (bojanz) for Composer. Let’s see if we can get them to weigh in on the matter and get a discussion going./p
Categories: Drupal Feeds

Kristian Polso: How to install Drupal 8 (and Composer) on Windows 10 Bash

Mon, 08/08/2016 - 8:29am
Microsoft released Windows 10 Anniversary Update on August 2nd 2016, and this update included a much awaited Windows Subsystem for Linux, which allows the user to run bash and command line Linux applications. It uses Ubuntu 14.04 as the base and as such is a great platform for local PHP development. In this tutorial I will show you how to install Drupal 8 (and Composer) environment on it. Roughly speaking, the necessary steps for this are:
Categories: Drupal Feeds

LevelTen Interactive: drupal_set_message() Cheatsheet: Variables, links, and formatting

Mon, 08/08/2016 - 12:00am
img typeof=foaf:Image src=http://getlevelten.com/sites/default/files/styles/600x300/public/content/blog/images/screen_shot_2016-08-05_at_10.12.56_am.png?itok=aGJFxGOF width=600 height=300 alt=drupal set message / pWhen developing custom modules, it is often helpful to the end-user to print out various messages to alert them to errors or explain what has just been done. Drupal does this all the time - for example, after saving a new node, a green notice is printed to the page letting the author know the article has been saved:/p pa class=colorbox colorbox-insert-image href=http://getlevelten.com/sites/default/files/inline-images/saving_new_article.png rel=gallery-all/a...a href=/blog/kristin-brinner/drupal-set-message-cheatsheet-variables-links-and-formatting class=more-linkRead more/a/p
Categories: Drupal Feeds

INsReady: Use the official Docker Drupal library and its developer version

Sun, 08/07/2016 - 11:36pm
div class=field field-name-body field-type-text-with-summary field-label-hiddendiv class=field-itemsdiv class=field-item even property=content:encodedpBy now, you probably have heard many great things about Docker's approach to DevOps. I first looked into Docker in 2015, when I was mentoring a GSoC project, and the project had a need to open new Drupal 8 sandbox very often. Since then I have been pushing updates to the a href=https://hub.docker.com/_/drupal/official Docker Drupal library/a./p h2Docker or the approach Containerization, in my opinion, is like Drupal. It makes DevOps like building legos. My use cases are below:/h2 ulliQuickly create a new sandbox for testing. It only takes two commands (including downloads and configurations) in a few seconds to create a new site on local computer or on a public server. a href=https://insready.com/en/blog/testing-new-drupal-8-installation-2-docker-commandsSee this tutorial/a./li liFront-end development has become complex with development tools dependency. But, with Docker, we can put designers or front-end developers back to their focus. See example, one command to a href=https://insready.com/en/blog/containerize-zen-style-guide-driven-developmentget everything for Zen 7.x-6.x Style-guide Driven Development/a or a href=https://hub.docker.com/r/insready/polymer-dev/Polymer development tool kit/a/li liBasing on the official Docker Drupal library, we created a href=https://hub.docker.com/r/insready/drupal-dev/a version for development/a. The purpose is that the development version inherits the official library but includes all the dev tools, so developers use dev container, while the deployment team always knows they will deploy the exactly same system-requirements container as the developers use. Plus, the dev version has Xdebug Remote debugging enabled as default; all those took to set up was one command./li liSometimes, I tech Drupal to students at universities. I used to ask my students to make a full backup before class, and prepare to install Ubuntu on day one. But, now, no matter they use Windows, MacOS or Linux. I send them to the a href=https://insready.com/en/blog/testing-new-drupal-8-installation-2-docker-commandssame tutorial/a and ask them to build a first simple Drupal site in 30 minutes./li liWe built our own muti-site hosting with run-time PHP separation. a href=https://github.com/INsReady/Data-SSH-ContainerDiagram demonstration here./a/li liSome projects have multiple Drupal sites or other web projects, they do communicate with each other (Our recent example was this a href=https://insready.com/en/blog/case-study-launching-inventory-control-system-commerceork-8x-20-alpha4-drupal-81Drupal Commerce on Drupal 8 to Magento stock synchronization/a). With the tools above, we can create dev environments the same way before, and two extra commands to network them together. Xdebuging them at the same time with different PHP versions or dependencies is just as easy as typing a new URL on the address bar./li liAt the end of the work, you always know, you can completely shut down your dev environments or delete them. There will be no hidden wasted resources left, including CPU or Disk space./li /ulh2A few things to keep in mind about the official Docker Drupal library/h2 ulliThere are many contributed Docker libraries for Drupal on the web. With the official library, you need at least two commands to build a Drupal site, one command is for creating a database, the other is for installing Drupal and all supporting software (except database). Some contributed libraries even made one command to achieve this. However, one-command approach is more like a Virtual Machine approach, which puts everything into one box and ready to use. Although, there is nothing wrong with this approach, this approach won't allow your DevOps experience like lego building. Docker's value is more than a faster VM. /li liThe official Docker Drupal library follows closely to the a href=https://www.drupal.org/documentation/installofficial Drupal installation documentation/a. This allows the docker library always follow the Drupal requirements and best practice./li liThe official library is not trying to be one solution for all. In fact, this image doesn't contain most PHP libraries for contributed modules. However, this library tries to be the base building block for all Drupal sites. Here is one example: a href=https://hub.docker.com/r/insready/drupal-commerce/Commerce on Drupal 8 distribution library and its developer version built on top of the official library/a/li liThis library is a href=https://github.com/docker-library/drupalopen sourced here/a. Constructive critique is welcome!/li /ul/div/div/divdiv class=field field-name-field-tag field-type-taxonomy-term-reference field-label-abovediv class=field-labelTag:nbsp;/divdiv class=field-itemsdiv class=field-item evena href=/en/taxonomy/drupalplanet typeof=skos:Concept property=rdfs:label skos:prefLabelDrupal Planet/a/divdiv class=field-item odda href=/en/taxonomy/term/63 typeof=skos:Concept property=rdfs:label skos:prefLabelDocker/a/div/div/div
Categories: Drupal Feeds

Chapter Three: Twig Extensions and Views FTW in Drupal 8

Sat, 08/06/2016 - 10:58pm
pimg alt=Twig Extensions, Views and Drupal 8 data-align=right data-entity-type=file data-entity-uuid=6bf3f168-8d65-411c-ac48-f0ce47c82ef3 src=/sites/default/files/inline-images/twignar.jpg style=float: right; margin: 0px 0px 12px 12px; /(This module was tested on drupal 8.1.8)/p h1 id=problem-to-solveProblem to solve/h1 pSometimes working with Views can be a challenge, in some cases you want to modify the values or process the content of the field./p pMany developers use the preprocess functions, or alter the query of the view, howevernbsp;there is another option:nbsp;strongtwig filters/strong./p h2 id=the-requirements-The Goals:/h2 pBeing able to calculate the reading time of any given node (body field)./p pThe field needs to output: 5 min read, 9 min read, depending on the word count of the node./p
Categories: Drupal Feeds

OSTraining: 7 New Improvements You'll See in Drupal 8.2

Fri, 08/05/2016 - 3:44pm
div class=ost-intro-imageimg src=https://www.ostraining.com/images/drupal8/drupal-82.jpg alt=7 New Improvements You'll See in Drupal 8.2 width=200 height=134 //div pThe Beta version of Drupal 8.2 has arrived and is ready for testing./p pThere are many upgrades to the developer experience, but what changes will end-users see?/p pHere are 7 improvements that users will see in Drupal 8.2./p
Categories: Drupal Feeds

Rakesh's DSoC 16 blog: Solving merge Conflicts in drupal8 - GSoC16 - Week10

Fri, 08/05/2016 - 11:33am
span property=schema:name class=field field--name-title field--type-string field--label-hiddenSolving merge Conflicts in drupal8 - GSoC16 - Week10/span span rel=schema:author class=field field--name-uid field--type-entity-reference field--label-hiddenspan lang= about=/user/1 typeof=schema:Person property=schema:name datatype=rakesh/span/span span property=schema:dateCreated content=2016-08-05T16:33:34+00:00 class=field field--name-created field--type-created field--label-hiddenFri, 08/05/2016 - 22:03/span
Categories: Drupal Feeds

Zivtech: Why Your Employees Should Learn to Teach

Fri, 08/05/2016 - 8:01am
div class=field-body h2How Formal is Your Training?/h2 br / In the summer of 2014, we did our own developer boot camp. We got a grant from the City of Philadelphia.br /br / The people who applied for the boot camp were so much more diverse than the people who usually apply for tech jobs. We didn't try to have women and minorities in our boot camp; it was a diverse application pool. They were mostly recent college grads; some of them were still in college, and some didn't have a tech background. There were science and humanities majors. They were starting to see the writing on the wall.br /div class=asset-wrapper asset aid-201 asset-image editor contenteditable=false data-asset-cid=1470070568700 div class=content div class=field-asset-imageimg alt= height=371 src=/sites/default/files/styles/asset_image_full/public/assets/images/PhillyDevCamp.png?itok=YkjPAEzr width=667 //div div class=field-asset-image-copyright /div div class=field-asset-image-description /div /div /div br /br / The boot camp was a six week course. It was amazing to see how hard they worked. Some of them were going to be more backend, some more frontend, and some would be better project managers. All different skills, and we hired some people, which was another reason for doing it. br /br / Find out who is reliable, who learns quickly, and who communicates well. Then hire the star students. I helped others get jobs in other companies. What we do is a trade, and you need to go through an apprenticeship to be really good. br /br / It's hard to make time for your people when you're a leader. You are going from meeting to meeting, and everyone's running up on you, and there are a thousand emails. I tell myself, None of that is as important as what someone's asking me right now. They're not always asking me technical questions. Sometimes they're asking me how to deal with a client, or sometimes they talk about their personal lives.br /br / The most important thing I need my people to learn is not how to be a great developer. The most important thing for them to learn is to value training people. When they value training people, they can train more people.br /br / If all they do is learn to be a great developer, I'll get some value out of them. If they learn to teach everyone around them, and to grow up the next generation that we hire, that’s a lot more value. Luckily, teaching is a really great way to learn. br /br / How we work is we teach, and we learn, and we teach, and we learn.br /br /br /ema href=https://www.zivtech.com/growyourownDownload/a the full Grow Your Own white paper for free./embr / /div nav role=navigation class=links-inline/nav
Categories: Drupal Feeds