Planet Drupal

Subscribe to flux Planet Drupal
Drupal.org - aggregated feeds in category Planet Drupal
Mis à jour : il y a 10 sec

Drupal @ Penn State: One liner to install php 7, mysql 5.6, apache 2.4, drush and drupal on centos 7

dim, 19/07/2015 - 07:06

It was a nice little saturday in happy valley. Since my son is forcing us to watch the Sponge Bob Square Pants movie over and over, I decided to multi-task. Bryan Ollendyke has been talking about PHP 7 a tad bit lately so I decided to whip up an instance. 

Granted this is not ready for prime-time just yet, however, it is extremely fast and everything that I have tested so far works fine. Turn on authcache and it is REALLY fast!

Catégories: Elsewhere

Tyler Frankenstein: Headless Drupal Web App with Angular JS and DrupalGap

sam, 18/07/2015 - 22:20

In this tutorial (for NYC CAMP 2015) we'll explore how to use Drupal 7 and DrupalGap 2 (powered by Angular JS) to build a decoupled ("headless") web application for Drupal. In a nutshell, here is what the app will do:

  1. A user runs the app in their browser
  2. The browser asks the user for access to their current location
  3. The app passes their location to Drupal
  4. Drupal will return nearby content (if any) to the app
  5. The app will display the locations on a map and let the user click on them to see more details

Ready? Let's rock and roll, no time to fiddle...

Catégories: Elsewhere

Wuinfo: Test Driven Coding Style

sam, 18/07/2015 - 03:11

Like Chinese philosophy Yin and Yang, Coding and testing support each other. Here I want to introduce a method to increase the rate of software project success. It is a critical thinking in programming, an agile methodology on a micro-scale level. What is it? In every line of code, every loop or conditional block, we look for multiple solutions. For each solution, we evaluate possibilities of going wrong. Pick the most reliable one. It helps us remove most of code vulnerability at beginning.

Knowing how to test is more important than knowing how to coding. A good function is stable, fast and, requires less memory and computing resources. It is not necessary to be complicated or has difficult API functions under the hood. Usually, it has less code and seems to be simpler than the rest. And it is the result of various tests and trying different methods. We choose the best way to compose the code base on various tests. It ensures robust software system with less vulnerability.

Let us say there is a project that send human beings to the Mars. If we are part of the project and our responsibility is to land the spaceship on the surface of the planet safely. How to make sure 'Landing Function' work without any deadly 'bug'? To us, what is the most important thing for it? It is not the landing gear; it is not the parachute. It is the tests. Under different situations, we performing hundreds or thousands of tests to validate each equipment. Find those thousands testing cases is the most difficult and important task. We need to find as close condition as possible under which when landing the spaceship on the Mars. The temperature, the speed of the spaceship, the chemical in the air, etc. Test materials under all sorts of combined circumstances. Any possibility that can go wrong, we will let it fail in the test.

When we solve a problem or fix bugs, we do the same thing. We do some research. By doing some research, we guess the cause of a problem. Then, we try to prove it with many tests. If the test results are positive, then, we came to a conclusion. Otherwise, we continue guesses and tests. Insufficient tests may lead us to a wrong conclusion.

Again, the tricky thing is how we test it. It is same when building new functions or modules. Whenever there is a solution, we put it under different conditions and validate it. We cover it with enough test cases. Like Chinese philosophy Yin and Yang, Coding and validating support each other.

When building a complex function, we may divide it into many baby steps. Each step is important to the overall success. Exhaust the ways testing each step to make sure each one is good. The result of the previous step can safely serve the next step. Finding a good way to test each step is crucial. Because there are many ways to do a thing. We need to choose the best one with tests. To each baby step, there can be a dozen ways to take. Able to find the most reliable way is a merit of a good software developer or a project leader. When pushes code to production, it can be way more complicated and possible to break. As laws of Murphy, anything that can go wrong will go wrong. So, have multiple test scenarios prepared for the smallest function unit. It is essential to make our code safe and sound. We will never overestimate the importance of it.

When it comes to a complex function, dividing it into small functional units that are easy to verify. Let's say the CYouTube project. We divide it into multiple steps and sub-steps. Each step has an easy and clear goal to achieve.

  • Pull JSON data from YouTube
  • Create Drupal queue task for each item
  • Create a file entity of video for each task
  • Each of those major Steps has multiple sub-steps. For example, pulling data from YouTube has following sub-steps.

  • Collect YouTube channel name from Drupal nodes field.
  • Get Youtube Channel upload playlist ID from YouTube with the collected channel name.
  • Cache function for playlist ID
  • Download YouTube video list JSON data with the playlist ID.
  • Parse the downloaded JSON into an array for next major step. That is to create Drupal queue tasks
  • Each of the sub-task or major task is easy to verify. Whenever, something goes wrong, we can follow the steps and find the broken one. From large scale to small, we can use this methodology. When we practise it more, our minds become more capable to find those steps with clear goals; We will foresee the problem when we choose the way to implement each step. That is before we do some real coding; That is how we can develop software that requires less maintenance.

    Test-driven development (TDD) relies on the repetition of a very short development cycle. The developer writes an automated test case before writing code. Our approach is a step ahead of it. When thinking about the solution, we find test cases first. Passing those test is the goal of next step - coding. We start think about test case when we read the requirement document. When we write code, we are thinking about how to break it. Whenever we finish a function, it went though many verification tests by ourselves. When it finishes, we have a much better chance to have a fully functioning module. If it does not work out, we can always return to each step and find the broken link by reiterating the verification process. I believe it is the most efficient way to develop something.

    Catégories: Elsewhere

    Four Kitchens: Making reactive Headless Drupal 8 interfaces with Meteor

    ven, 17/07/2015 - 23:30
    Meteor + Drupal = Real time Drupal interfaces

    Meteor is a JavaScript framework that enables developers to quickly create reactive, highly accessible applications. It can be an incredibly powerful tool, especially when paired with Drupal, which is a great content management system that makes it really easy to create well-structured content models and interact with data.

    Why not combine the two and let Drupal provide Meteor with semantic data with Meteor rendering that data in a reactive way?

    Drupal How-Tos
    Catégories: Elsewhere

    Aten Design Group: The Publishing Experience on HRW.org

    ven, 17/07/2015 - 21:34

    Human Rights Watch (HRW) has been sharing important stories for over 30 years and we were excited about enhancing the digital story-telling experience in the latest relaunch of HRW.org. Out-of-the-box, Drupal provided a great platform for us to craft tools that matched HRW’s internal publishing workflows, while allowing their publishers to create long-form content with videos, galleries and other rich content.

    Embedded Media

    Aten's design team set the bar with the new design direction for HRW.org. Their vision for the long-form articles included flexibility for embedding media content throughout the text. After a lengthy evaluation period with Drupal’s Media module, it become clear that HRW needed more flexibility than it provided. In addition to embedding file based media (i.e. images), there were requirements around embedded text based content like quotes and callouts for other node based content. For consistency, we went with the Node Embed approach that we’ve blogged about before. Having a node-based workflow also provided a familiar workflow for HRW’s publishers.

    Long-form Reports

    One of HRW’s most important tasks is creating in-depth reports on certain issues around the world. It's not uncommon for these reports to approach 100 pages In PDF form. Two goals of the relaunch included the report creation workflow in Drupal and improving report navigation.

    Report Creation Workflow

    HRW has an internal workflow for editing and publishing reports that they’ve used for years. The end product of that workflow is a printed report and an online HTML version. Rather than trying to force a new internal workflow, we discussed pain points HRW had with their current process and built a couple tools to provide a better experience.

    HTML Upload

    When creating report nodes in Drupal, HRW can upload the HTML file that was created outside of the content management system. The upload process adds anchor tags and generates a table of contents based on semantic heading tags, detects image references that do not exist on the site yet, and makes a few other formatting changes The report content and table of contents are then saved in the database rather than processing the uploaded content on the fly.

    Report Navigation

    In past iterations, reports were broken up into many pages. Now, users can use the table of contents to quickly jump to relevant sections of the report. Having reports on a single page also allows users to use built in browser tools like “Find” to search for keywords.

    Featured Content

    HRW has many topic and location based landing pages where editors can curate content. HRW wanted the flexibility to manually feature content or, given the large number of these pages, have the most relevant automatically show up. To achieve this, we used Views, Entity Reference, and a custom module to tie the two together. The custom code checks the Entity Reference field for manually curated content then utilizes Views to pull the relevant content into the remaining content slots available. This allows HRW to mix curated and automated content easily without having to choose one approach over the other.

    Related Content

    Rather than showing users additional content at the bottom of an article based on time or tag, we worked with HRW to craft an algorithm, or scoring system, to display related content. When deciding which relevant content to show, date, geography, and topic are all taken into consideration. Similar to featured content, HRW has the flexibility to manually relate content on any article with the algorithmic suggestions filling missing slots.

    Sharelines

    Once HRW publishes important information, they leverage social channels like Twitter to help spread the word. We provided HRW publishers the ability create curated Sharelines that are displayed prominently for users to Tweet directly from the article.

    It was exciting to work on such a large publishing project and help provide tools to help tell important stories in many languages. We hope you enjoy browsing the new HRW.org!

    Catégories: Elsewhere

    Four Kitchens: Nearly Headless Drupal

    ven, 17/07/2015 - 20:31

    Drupal is a pretty strong content manager, allowing you to build robust data models, easily enable content revisioning, and build a publishing workflow complex enough for even the strictest of editorial standards. However, the blistering speed of development on Drupal 8 appears glacial when compared with the rate of invention on the frontend of web development.

    Drupal
    Catégories: Elsewhere

    OSTraining: Use the Masquerade Module to Test Drupal Roles

    ven, 17/07/2015 - 20:27

    If you have a large Drupal site, you may have a large number of roles and users.

    To thoroughly test your site and make sure everything is working correctly, it's smart to browse your site under different roles.

    Yes, you can create fake accounts for each user role, but that becomes very cumbersome if you have more than a couple of roles.

    The Masquerade module is very easy to use, and it allows yourself to see the site through the eyes of any user you choose:

    Catégories: Elsewhere

    Acquia: Gender balance in tech sales through data-driven, objective hiring

    ven, 17/07/2015 - 18:48
    Language Undefined

    At a recent Acquia all-company meeting, I was glad to hear that half of the current group of Acquia U students and 7 out of 12 of the latest "BDR" hires in Sales were women. Acquia's CEO, Tom Erickson added that this was the result of some "objective, data-driven" hiring practices. I had to know more. I got Acquia Senior Manager of Business Development and Sales, Chris Hemberger on the line to talk about all of this.

    Catégories: Elsewhere

    Drupal core announcements: Recording from July 17th 2015 Drupal 8 critical issues discussion

    ven, 17/07/2015 - 15:18

    This was our 8th critical issues discussion meeting to be publicly recorded in a row. (See all prior recordings). Here is the recording of the meeting video and chat from today in the hope that it helps more than just those who were on the meeting:

    If you also have significant time to work on critical issues in Drupal 8 and we did not include you, let me know as soon as possible.

    The meeting log is as follows (all times are CEST real time at the meeting):


    [11:11am] jibran: https://www.drupal.org/node/2525910
    [11:11am] Druplicon: https://www.drupal.org/node/2525910 => Ensure token replacements have cacheability + attachments metadata and that it is bubbled in any case [#2525910] => 149 comments, 22 IRC mentions
    [11:12am] alexpott: https://www.drupal.org/node/2525910, https://www.drupal.org/node/2493911 is the issue dawehner is talking about
    [11:12am] Druplicon: https://www.drupal.org/node/2525910 => Ensure token replacements have cacheability + attachments metadata and that it is bubbled in any case [#2525910] => 149 comments, 23 IRC mentions
    [11:12am] Druplicon: https://www.drupal.org/node/2493911 => Update guzzle, goutte and mink-goutte-driver to the latest release [#2493911] => 140 comments, 6 IRC mentions
    [11:13am] dawehner: GaborHojtsy++
    [11:13am] dawehner: GaborHojtsy++
    [11:13am] alexpott: https://www.drupal.org/node/2524082 is the config overrides https://www.drupal.org/node/2524082
    [11:13am] Druplicon: https://www.drupal.org/node/2524082 => Config overrides should provide cacheability metadata [#2524082] => 110 comments, 32 IRC mentions
    [11:13am] Druplicon: https://www.drupal.org/node/2524082 => Config overrides should provide cacheability metadata [#2524082] => 110 comments, 33 IRC mentions
    [11:14am] GaborHojtsy: https://www.drupal.org/node/2338081
    [11:14am] Druplicon: https://www.drupal.org/node/2338081 => Local Tasks, Actions, and Contextual links should use a TranslationWrapper to encapsulate safe translatable strings from YAML files [#2338081] => 62 comments, 16 IRC mentions
    [11:14am] jibran: https://www.drupal.org/node/2493911
    [11:14am] Druplicon: https://www.drupal.org/node/2493911 => Update guzzle, goutte and mink-goutte-driver to the latest release [#2493911] => 140 comments, 7 IRC mentions
    [11:15am] WimLeers: https://www.drupal.org/node/2525910
    [11:15am] Druplicon: https://www.drupal.org/node/2525910 => Ensure token replacements have cacheability + attachments metadata and that it is bubbled in any case [#2525910] => 149 comments, 24 IRC mentions
    [11:15am] WimLeers: https://www.drupal.org/node/2532490
    [11:15am] Druplicon: https://www.drupal.org/node/2532490 => Unrouted URLs break toolbar but are hidden by caching [#2532490] => 31 comments, 8 IRC mentions
    [11:17am] WimLeers: https://www.drupal.org/node/507488?page=1#comment-10127746
    [11:17am] Druplicon: https://www.drupal.org/node/507488 => Convert page elements (local tasks, actions) into blocks [#507488] => 280 comments, 57 IRC mentions
    [11:22am] WimLeers: plach's issue: https://www.drupal.org/node/2351015
    [11:22am] Druplicon: https://www.drupal.org/node/2351015 => URL generation does not bubble cache contexts [#2351015] => 300 comments, 57 IRC mentions
    [11:23am] Fabianx-screen: https://drupalreleasedate.com/ shows 997 majors and 376 added in the last year.
    [11:24am] jibran: https://www.drupal.org/node/2504141
    [11:24am] Druplicon: https://www.drupal.org/node/2504141 => Information disclosure/open redirect vulnerability via blocks that contain a form [#2504141] => 66 comments, 12 IRC mentions
    [11:28am] dawehner: https://github.com/guzzle/guzzle/issues/1166
    [11:29am] dawehner: https://www.drupal.org/node/2493911
    [11:29am] jibran: https://www.drupal.org/node/2493911#comment-10124104
    [11:29am] Druplicon: https://www.drupal.org/node/2493911 => Update guzzle, goutte and mink-goutte-driver to the latest release [#2493911] => 140 comments, 8 IRC mentions
    [11:29am] Druplicon: https://www.drupal.org/node/2493911 => Update guzzle, goutte and mink-goutte-driver to the latest release [#2493911] => 140 comments, 9 IRC mentions
    [11:37am] dawehner: https://www.drupal.org/node/2528178
    [11:37am] Druplicon: https://www.drupal.org/node/2528178 => Provide an upgrade path for #2354889 (block context manager) [#2528178] => 45 comments, 9 IRC mentions
    [11:38am] dawehner: https://www.drupal.org/node/2528178#comment-10123746
    [11:38am] Druplicon: https://www.drupal.org/node/2528178 => Provide an upgrade path for #2354889 (block context manager) [#2528178] => 45 comments, 10 IRC mentions
    [11:43am] jibran: https://www.drupal.org/node/2464427#comment-10127680
    [11:43am] Druplicon: https://www.drupal.org/node/2464427 => Replace CacheablePluginInterface with CacheableDependencyInterface [#2464427] => 94 comments, 9 IRC mentions
    [12:14pm] dawehner: https://www.drupal.org/node/2338081
    [12:14pm] Druplicon: https://www.drupal.org/node/2338081 => Local Tasks, Actions, and Contextual links should use a TranslationWrapper to encapsulate safe translatable strings from YAML files [#2338081] => 62 comments, 17 IRC mentions

    Catégories: Elsewhere

    OSTraining: Can't Find the "Install new module" Link in Drupal?

    ven, 17/07/2015 - 01:54

    When developers install Drupal modules, they rely on Drush or version control to manage their work.

    However, most ordinary Drupal users do everything through the admin interface. They install modules via the "Install new modules" link.

    Sometimes that link goes missing. If you can't find your "Install new modules" link, here are four possible solutions.

    Catégories: Elsewhere

    DrupalCon News: Meet the Local Community!

    jeu, 16/07/2015 - 18:42

    The European DrupalCon in 2015 will take place in the beautiful city of Barcelona, one of the most visited and explored Spanish and European destinations for visitors from all around the world. But beyond the touristic appeal, Spain and Barcelona are the houses of very active and healthy Drupal communities.

    Catégories: Elsewhere

    Pronovix: Interview with a d8upgrade user

    jeu, 16/07/2015 - 15:18

    If you are still hesitating if it's worth the effort to sign up for d8upgrade, we wanted to give you an account from one of our users who did already do so. We asked omong_kosong, if we could interview him for a blogpost, what follows are his answers to the questions we sent him.

    What do you think about the d8upgrade service? Was it helpful?

    Catégories: Elsewhere

    Code Karate: Create Secret URLs with Drupal 7 Token Content Access

    jeu, 16/07/2015 - 14:33
    Episode Number: 209

    Have you ever wanted to create a page on your Drupal 7 website and send it over to a friend or group of people… but you don’t want the general public to see it? You could always set it up so they just log in, but that’s an extra step and not all of the people you want to send this to have user accounts on your site.

    Tags: DrupalDrupal 7Site BuildingDrupal Planet
    Catégories: Elsewhere

    Commerce Guys: Five things you should know about Drupal 8 on Platform.sh

    jeu, 16/07/2015 - 13:56
    If you are thinking about building something on Drupal 8, or maybe you saw the the recent television interview with our CEO Frederic Plais on France’s BFM Business channel, then here is what some of the hype is all about

    1. Drupal 8 is coming, and Platform.sh has been ready since 2014 While other PaaS providers are playing catch-up, we’ve been running Drupal 8 successfully since last year, providing Drush 7 support and a Symfony-based CLI for local development. Platform.sh is also multi-technology, so that Drupalists looking to “get off the island” can easily run Drupal and Symfony and very soon Drupal and NodeJS side-by-side.

    2. Leading Swiss publisher Suedostschweiz.ch is using Platform.sh and Drupal 8 in production, others are already in the pipeline Since going live in June, Suedostschweiz.ch has been providing Switzerland with cutting-edge news, radio and TV in the form of a specially developed Drupal 8 portal. Since its launch, the site has taken over 12m hits in a 7 day period, making it one of the largest Drupal 8 sites in the world right now.

    And that’s just the beginning. We have several other Drupal 8 sites that are currently in development and we’re working with our partners to deliver many more.

    See more on Südostschweiz see the following release:
    https://platform.sh/press/2015/05/groundbreaking-drupal-8-news-portal-go...

    3. Platform.sh and Fastly (CDN) unleash Drupal 8 tagged caching News portals and other sites with frequent content updates have been subject to at least one serious constraint up to now; careful scheduling of content updates that requires the entire global cache to be invalidated and re-built. The downside being massive spikes as every request is passed through to your backend webservers. That’s now a thing of the past, as Platform.sh can selectively invalidate both the reverse proxy, and via our own specially developed API, the CDN itself. This is one of the reasons Suedostschweiz.ch selected Platform.sh for its new hosting PaaS.

    4. The Drupal Association (DA) is using Platform.sh for Drupal 8 (D8) Usability Testing The Drupal 8 Usability Testing that was recently conducted in Minneapolis made great use of Platform.sh. This phase of Drupal 8 development is crucial to the success of the new CMS, and benefited greatly from Platform.sh’s unique ability to spin up multiple identical environments - on-demand and within seconds - for testing against many hundreds of different variables. Many of Drupal's leading lights are clearly recognising the value of Platform.sh to their landmark projects.

    You can find out more on the D8 usability testing here: https://groups.drupal.org/node/470398

    5. Platform.sh Enterprise offers a Drupal 8-ready, triple-redundant architecture that is secure, resilient and effortlessly scalable. 24/7 white glove support and comprehensive documentation round out the offer. With highly credible financial backers (including the recent grant from the European Union’s Horizon 2020 program see https://platform.sh/2015/06/european-horizon-2020-grant/ ), we are accelerating our roadmap with a wealth of features that will boost the benefits of Drupal 8 and everything that goes with it.

    Interested? Then get in touch at https://platform.sh/contact/
    Catégories: Elsewhere

    Symphony Blog: How to share Drupal content via Facebook with correct images

    jeu, 16/07/2015 - 10:41

    When you share a post of your Drupal site via Facebook, it will automatically detect the images of your node for you to choose. But sometimes, it does not detect any images, or the detected images are not what you want. How can you deal with that?

    An easy method is uploading the main image manually. That's fine, because you are the owner of the site, you know which ones to choose. However, if your readers share that piece of content and it has an ugly image, it does not look attracting at all.

    In this tutorial, we show you how to set meta data for your Drupal nodes so the correct images will be chosen, when you share them via Facebook.

    read more

    Catégories: Elsewhere

    KnackForge: Drupal : Add an icon to the menu links

    jeu, 16/07/2015 - 08:33

    We all like decorated items than normal ones. Everyone like to add icon/image to their site's menu links but we need some tricks to add that into our drupal site's menu link. I am going to show you various methods to add an icon/image to the drupal menu links.

    1. theme_menu_link() : 

    It would return html elements for the menu and it's submenu. We can change the menu html elements using this function and this function must be written in our theme's template.php file. In this example, I am going to add icons to the main menu.

    /** * Implementation of theme_menu_link__MENU_NAME(). */ function THEME_NAME_menu_link__main_menu(array $variables) { $element = $variables ['element']; $sub_menu = ''; if ($element ['#below']) { $sub_menu = drupal_render($element ['#below']); } $icon = 'icon-' . $element['#title']; $output = l($icon . $element ['#title'], $element ['#href'], $element ['#localized_options']); return '<li' . drupal_attributes($element ['#attributes']) . '>' . $output . $sub_menu . "</li>\n"; }

    This will add our new unique class to all main menu links, we could simply add the icons with class using css style.

    2. Menu Icons :

    The menu icons is a drupal contributed module. It is one of the simplest solutions to add the icons/images through UI. This module allows you to upload an image in the menu-item configuration form.

    Catégories: Elsewhere

    Drupal @ Penn State: ELMSLN - Coming to a camp near you

    mer, 15/07/2015 - 23:36

    I was made aware that it’s been close to a year since I actually did a demo of the reason that I contribute so many modules to drupal. org. For those that don’t know, the reason I exist is a project called ELMS Learning Network. It is a Drupal 7 based deployment methodology that takes the many parts of an LMS and fragments them across a series of drupal distributions.

    Catégories: Elsewhere

    Cheeky Monkey Media: Into the Fire with Foundation and The Big “D”rupal

    mer, 15/07/2015 - 23:26

    Cheeky Monkey broke my Foundation cherry.  It’s been a pleasurable experience.

    Coming from frameworks like Zen Grids (+ Drupal Theme) and Susy2 Grids, I can appreciate (and need) some major control over the grids.  I have to say though, foundation does a bang up job of letting you control the ‘big stuff’ with ease, and still being able to get down into the nitty griddy(see what I did there?) -- and change what you like without too much fuss.

    Drupal, Drupal he’s our man.

    And then, oh yeah, there’s a Drupal theme for it!  ...

    Catégories: Elsewhere

    Four Kitchens: Introducing Saucier

    mer, 15/07/2015 - 23:11

    With the first party API building tools built into Drupal 8 core, there’s been a lot of talk about building semantic APIs in Drupal; when, how, and why you should or should not. However, a commonly overlooked piece of this picture is how to go about actually consuming these APIs. And as it turns out, consuming an API, even a well designed one, can present a number of challenges. That’s why we created Saucier, a Node.js framework used to quickly create web pages from data that has been consumed from a Drupal API.

    JavaScript Drupal
    Catégories: Elsewhere

    Pages