Newsfeeds

Hook 42: Drupal Core Initiative Meetings Recap - August 5th - 9th, 2019

Planet Drupal - 8 August 2019 - 12:12pm
Drupal Core Initiative Meetings Recap - August 5th - 9th, 2019 Will Thurston-… Thu, 08/08/2019 - 19:12
Categories: Drupal

Twitch launches beta for all-in-one streaming app Twitch Studio

Social/Online Games - Gamasutra - 8 August 2019 - 12:09pm

The streaming platform Twitch is looking to cut out the middleman, announcing today that it has its own program in the works to handle both setting up streams and going live on Twitch. ...

Categories: Game Theory & Design

Locale Manual Translate String

New Drupal Modules - 8 August 2019 - 10:59am

Adding manually a String Translation which it will be available in the translation Drupal interface

Categories: Drupal

Now's the time to submit your best Design talk ideas for GDC 2020!

Social/Online Games - Gamasutra - 8 August 2019 - 9:21am

If you have a great idea for a talk that would fit in well with the Design track at GDC 2020 in March, organizers want to hear it -- before submissions close next Thursday, August 15th! ...

Categories: Game Theory & Design

Mediacurrent: Composer-Patches: The Dependency You Never Knew You Needed

Planet Drupal - 8 August 2019 - 8:49am

For most Drupal projects, patches are inevitable. It’s how we, in the Drupal community, share code. If that scares you, don’t worry-- the community is working hard to move to a pull/merge request workflow. Due to the collaborative nature of Drupal as a thriving open source community and the always growing ecosystem of contrib modules, patches are the ever-evolving glue that can hold a site together.  

Before Drupal 8, you may have seen projects use drush make which is a Drupal specific solution. As part of the “get off the island” movement,  Drupal adopted existing dependency manager Composer. Composer does a decent job alleviating the headaches of managing several sites with different dependencies. However, out of the box Composer will revert patched core files and contrib modules and it is for that reason composer-patches project was created. In this blog post, we are going to review how to set up composer-patches for a composer managed project and how to specify local or remote hosted patches.

The setup

In your favorite command line tool, you will want to add the composer-patches project:

composer require cweagans/composer-patches:~1.0 --update-with-dependencies

With this small change, your project is now set up for success because composer can manage your patches. 

Local patches

Sometimes you will find that you need patch contrib or core specifically for your project and therefore the patch exists locally. Composer-patches can apply that patch for you, we just need to tell it where it is.  Let’s look at an example project that has core patch applied and saved locally in the project root directory ‘patches/core-invalid-config-structures.patch’:
    ...
    "extra": {
      "patches": {
        "drupal/core": {
          "Core Invalid config structures ":"patches/core-invalid-config-structures.patch"
        }
      }
    }

In your composer.json, you will want to add an “extra” section if it doesn’t already exist.  Composer-patches will take the packages listed in “patches” and try to apply any listed patches. In our above example, the package we are patching is “drupal/core”. Patches are declared as follows:

“Patch description”: “path to patch file”

This information will be printed on the command line while composer tries to update the package which makes it important to summarize the patches purpose well.  If you would like to see what this looks like in the wild, take a look at our distribution Rain which leverages a couple of contrib patches.

After manually updating composer.json, it is always a good idea to run composer validate to confirm the json syntax is right.  If you get the green success message run composer update drupal/[projectname], e.g. composer update drupal/core to have the patch applied. 

You will know that the patch is applied based on the output:

As you can see, the package getting patched is removed, added back and the patch is applied. 

Note: Sometimes I feel like I have to give composer a nudge, always feel comfortable deleting /core, /vendor, or /modules/contrib, but if you delete composer.lock know that your dependencies could update based off your constraints.  Composer.json tracks our package dependencies at certain version constraints while composer.lock is the recipe of computed versions based off those constraints. I have found myself running the following:

rm -rf core && rm -rf modules/contrib && rm -rf vendor
composer install

Remote Patches

When possible we should open issues on Drupal.org and post patches there. That way, the community can work together to solve a problem and usually you’ll get a more reliable, lasting solution. Think about it this way - would you rather only you or your team review a critical patch to your project or hundreds of developers?

To make composer-patches grab a remote patch make the following changes:
    ...
    "extra": {
      "patches": {
        "drupal/core": {

          "#2925890-10: Invalid config structures ":"https://www.drupal.org/files/issues/2018-09-26/2925890-10.patch"
        }
      }
    } 

The only change here is rather than the path to the local patch, we have substituted it for the URL the patch. This will have a similar success message when applied correctly:

Tips 

So far, I’ve shown you how to get going with composer-patches project but there are a lot of settings/plugins that can elevate your project.  A feature I turn on for almost all sites is exit on patch failure because it is a big deal when a patch fails.  If you too want to turn this feature on, add the following line to your “extras” section in your composer.json:

"composer-exit-on-patch-failure": true,

I have also found it helpful to add a link back to the original issue in the composer.json patch declaration. Imagine working on a release and one of your patches fail but the only reference you have to the issue is the patch file url? It is times like these that a link to the issue can make your day.  If we made the same change to our example before, it would look like the following:

 "drupal/core": {
          "#2925890-10: Invalid config structures (https://www.drupal.org/project/drupal/issues/2925890)" : "https://www.drupal.org/files/issues/2018-09-26/2925890-10.patch"
        }

Conclusion

Composer-patches is a critical package to any Drupal project managed by Composer. In this blog I showed you how to get started with the project and some of the tips and tricks I’ve learned along the way. How does your team user composer-packages? Do you have a favorite setting that I didn’t mention? Feel free to drop a comment and share what works for you and your team.

Categories: Drupal

Mediacurrent: Composer-Patches: The Dependency You Never Knew You Needed

Planet Drupal - 8 August 2019 - 8:49am

For most Drupal projects, patches are inevitable. It’s how we, in the Drupal community, share code. If that scares you, don’t worry-- the community is working hard to move to a pull/merge request workflow. Due to the collaborative nature of Drupal as a thriving open source community and the always growing ecosystem of contrib modules, patches are the ever-evolving glue that can hold a site together.  

Before Drupal 8, you may have seen projects use drush make which is a Drupal specific solution. As part of the “get off the island” movement,  Drupal adopted existing dependency manager Composer. Composer does a decent job alleviating the headaches of managing several sites with different dependencies. However, out of the box Composer will revert patched core files and contrib modules and it is for that reason composer-patches project was created. In this blog post, we are going to review how to set up composer-patches for a composer managed project and how to specify local or remote hosted patches.

The setup

In your favorite command line tool, you will want to add the composer-patches project:

composer require cweagans/composer-patches:~1.0 --update-with-dependencies

With this small change, your project is now set up for success because composer can manage your patches. 

Local patches

Sometimes you will find that you need patch contrib or core specifically for your project and therefore the patch exists locally. Composer-patches can apply that patch for you, we just need to tell it where it is.  Let’s look at an example project that has core patch applied and saved locally in the project root directory ‘patches/core-invalid-config-structures.patch’:
    ...
    "extra": {
      "patches": {
        "drupal/core": {
          "Core Invalid config structures ":"patches/core-invalid-config-structures.patch"
        }
      }
    }

In your composer.json, you will want to add an “extra” section if it doesn’t already exist.  Composer-patches will take the packages listed in “patches” and try to apply any listed patches. In our above example, the package we are patching is “drupal/core”. Patches are declared as follows:

“Patch description”: “path to patch file”

This information will be printed on the command line while composer tries to update the package which makes it important to summarize the patches purpose well.  If you would like to see what this looks like in the wild, take a look at our distribution Rain which leverages a couple of contrib patches.

After manually updating composer.json, it is always a good idea to run composer validate to confirm the json syntax is right.  If you get the green success message run composer update drupal/[projectname], e.g. composer update drupal/core to have the patch applied. 

You will know that the patch is applied based on the output:

As you can see, the package getting patched is removed, added back and the patch is applied. 

Note: Sometimes I feel like I have to give composer a nudge, always feel comfortable deleting /core, /vendor, or /modules/contrib, but if you delete composer.lock know that your dependencies could update based off your constraints.  Composer.json tracks our package dependencies at certain version constraints while composer.lock is the recipe of computed versions based off those constraints. I have found myself running the following:

rm -rf core && rm -rf modules/contrib && rm -rf vendor
composer install

Remote Patches

When possible we should open issues on Drupal.org and post patches there. That way, the community can work together to solve a problem and usually you’ll get a more reliable, lasting solution. Think about it this way - would you rather only you or your team review a critical patch to your project or hundreds of developers?

To make composer-patches grab a remote patch make the following changes:
    ...
    "extra": {
      "patches": {
        "drupal/core": {

          "#2925890-10: Invalid config structures ":"https://www.drupal.org/files/issues/2018-09-26/2925890-10.patch"
        }
      }
    } 

The only change here is rather than the path to the local patch, we have substituted it for the URL the patch. This will have a similar success message when applied correctly:

Tips 

So far, I’ve shown you how to get going with composer-patches project but there are a lot of settings/plugins that can elevate your project.  A feature I turn on for almost all sites is exit on patch failure because it is a big deal when a patch fails.  If you too want to turn this feature on, add the following line to your “extras” section in your composer.json:

"composer-exit-on-patch-failure": true,

I have also found it helpful to add a link back to the original issue in the composer.json patch declaration. Imagine working on a release and one of your patches fail but the only reference you have to the issue is the patch file url? It is times like these that a link to the issue can make your day.  If we made the same change to our example before, it would look like the following:

 "drupal/core": {
          "#2925890-10: Invalid config structures (https://www.drupal.org/project/drupal/issues/2925890)" : "https://www.drupal.org/files/issues/2018-09-26/2925890-10.patch"
        }

Conclusion

Composer-patches is a critical package to any Drupal project managed by Composer. In this blog I showed you how to get started with the project and some of the tips and tricks I’ve learned along the way. How does your team user composer-packages? Do you have a favorite setting that I didn’t mention? Feel free to drop a comment and share what works for you and your team.

Categories: Drupal

Auto Save Form

New Drupal Modules - 8 August 2019 - 8:22am

# Auto Save Form

This module automatically stores and recovers form values to prevent
losing data when editing an form.

The plugin listens for the form change and keyup events and then stores
the values of your form controls (select, input, and textarea) in the local
storage and automatically clears the storage on form submit.

## Installation
1) Copy all contents of this package to your modules directory preserving
subdirectory structure.

Categories: Drupal

Should Minors Have A Constitutional Right To Realistically Violent (But Fun) Video Games? - by Steven Chung

Gamasutra.com Blogs - 8 August 2019 - 7:41am
In light of technology advances, recent shootings and the current composition of the U.S. Supreme Court, a law banning the sale of violent video games to minors might be allowed under the U.S. Constitution.
Categories: Game Theory & Design

Commerce Stripe Payment Intent

New Drupal Modules - 8 August 2019 - 7:30am

This module is a fork of commerce_stripe. I use commerce_stripe for a long time in D7 project with some patchs to support 3DS and other features which has never been commited.

It implements Stripe with :

Categories: Drupal

Are Videogames Ready To Talk About Sex? - by Josh Bycer

Gamasutra.com Blogs - 8 August 2019 - 7:26am
Videogames have explored many topics in the past, however sex has been kept away from most markets. With more indie developers talking about sex and sexuality, is the industry ready for more adult conversations on it?
Categories: Game Theory & Design

Promoting your indie game: The best online tools & links - by Thomas Reisenegger

Gamasutra.com Blogs - 8 August 2019 - 7:18am
A list of the best online tools to promote your ubdue game (PR, marketing, community etc.). Most of them are for free. Based on experience of running the indie PR & marketing agency Future Friends Games for 2 years.
Categories: Game Theory & Design

The Door Problem of Combat Design - by Andrew Yoder

Gamasutra.com Blogs - 8 August 2019 - 7:17am
An examination of classic level design and techniques for inviting the player into arenas instead of fighting from the doors.
Categories: Game Theory & Design

7 video games to boost your creative mind - by Herbert Llanas

Gamasutra.com Blogs - 8 August 2019 - 7:15am
There are some of the most amazing video games to boost your creative mind in the best possible way.
Categories: Game Theory & Design

wishdesk.com: Why build a local business website on Drupal 8

Planet Drupal - 8 August 2019 - 6:30am
If you have a local business, you will benefit immensely from a strong online presence. In this post, we will discuss why Drupal 8 is a great choice to build a local website.
Categories: Drupal

Specbee: Setup Responsive Images in Drupal 8 - A Step-by-Step Guide

Planet Drupal - 8 August 2019 - 5:11am
Setup Responsive Images in Drupal 8 - A Step-by-Step Guide Akshay Devadiga 08 Aug, 2019 Top 10 best practices for designing a perfect UX for your mobile app

Back in early 2010, when Jason Grigsby pointed out that simply setting a percentage width on images was not enough, and that you needed to resize these images as well for a better user experience. He pointed out that if you served the right sized images on the original responsive demo site, more than 75% of the weight of those images can be shaved on smaller screens. 

Ever since, the debate on responsive images have evolved in what is the best solution to render the perfect, responsive images without any hassle.

We all know how Drupal 7 does a great job in handling responsive images with its modules. However, with Drupal 8, things are even better now!

Responsive Images in Drupal 8

The Responsive Image module in Drupal 8 provides an image formatter that maps the breakpoint of the original image to render a flawless responsive image using a picture tag.

When we observe how Drupal 8 handles responsive images when compared to Drupal 7, some of the features to be noted are:

Drupal 7 consists of the contributed module picture element, which in the latest version is known as Responsive Images.
In addition to this, Responsive images & Breakpoint modules are a part of the Drupal core in the latest version of the CMS.

The Problem

One of the major problems with the images in web development is, browsers do not know about the images, and are clueless about what sized images are rendering in relation with a viewport of different screens until the CSS & Javascripts are loaded.

However, the browser can know about the environment in which the images are rendering, which includes the size of the viewport and resolution of the screen.

The Solution 

As we mentioned in previous sections, responsive images use picture element which basically has sizes and srcset attributes which play a major role in notifying the browser to choose the best images based on the image style selections.  

So Drupal 8 has done a great job in providing the responsive images module in the core. This will download the lower sized images for the devices with lower screen resolution, resulting in better website load time and improved performance. 

Steps to reproduce
  1. Enable Responsive images and breakpoint module.
  2. Setup the breakpoints for your projects theme.
  3. Setting up the image styles for responsive images
  4. Creating a responsive image style for your theme
  5. Assigning the responsive image style to an image field.
Enable Responsive images and breakpoint module

Since it's a part of drupal 8 core, we will not require any other extra module. All you have to do is enable the responsive images module, since the breakpoint module will be installed with the standard profile. Else enable the breakpoint module.

To enable the module goto->admin->extends select the module and enable the module.

Setup the breakpoints for your project's theme
 

Setting up the theme’s breakpoint is the most important part for the responsiveness of your site.


If you are using a core theme like bartik , seven, umami or claro, you will already have the breakpoints file and you don’t have to create any new ones. 

However, if you are using a custom theme for your project, it is important that you define the breakpoints in "yourthemename.breakpoints.yml" which can be found in your theme directory, usually found in "/themes/custom/yourthemename".

Each breakpoint will assign the images to media query.  For example images which are rendering in mobile might be smaller i.e width less than 768px, where in medium screens will have a width between 768px to 1024px.


Each breakpoint will have: 

label:  Is the valid label given for the breakpoint.
mediaQuery:  Is the viewport within which the images are rendered.
weight:  For the order of display.
multipliers:  It's a measure of the viewport's device resolution normally 1x will be used for standard sizes and 2x for retina display.

Setting up the image styles for responsive images

Now we will have to create an image style for each of the breakpoints. You can configure your own Drupal 8 image styles at admin->config->media->image-styles

Click ‘Add image style’.  Give the valid name for your image style & use scale and crop effect which will provide the cropped images. If the images are stretched, add multiple image style for different viewports.

Creating a responsive image style for your theme 

This is where you provide the multiple image style options to the browser and let the browser choose the best out of the lot. 


To create new responsive Drupal 8  image style navigate to:
Home -> admin- > config-> media->responsive-image-style and click on ‘Add responsive image’. 

Give a valid name for your responsive image style & select the breakpoint group (choose your theme) & assign the image styles to the breakpoints listed 

There are multiple options for the image style configurations

  • Choose single image style: Where you can select the single image style that will be rendered on the particular screen
  • Choose multiple image style: Where you can select the multiple-image style and also specify the viewport width for the image style

At last, there is an option to select a fallback image style. The fallback image style should only appear on the site if an error occurs.

Assigning the responsive image style to an image field 
  • Once all the configurations are done, move to the image field by adding the responsive image style.
  • To do that go to the field’s manage display and select the responsive image style which we created.
  • Add content and see the results on the page with a responsive image style.

     

Final Results 

 The image at a minimum width of 1024px (For large Devices).

Image at minimum width of 768px (For Medium Devices).

Image at maximum width 767px (For Small Devices).

Drupal Planet Shefali ShettyApr 05, 2017 Subscribe For Our Newsletter And Stay Updated Subscribe Shefali ShettyApr 05, 2017 Recent Posts Image Setup Responsive Images in Drupal 8 - A Step-by-Step Guide Image Top 15 Drupal Distributions for Accelerating Your Web Development Process Image Headless Drupal – Why Top Enterprises Are Choosing Decoupled Drupal Websites? Explore Our Drupal Services TAKE ME THERE Featured Success Stories

Know more about our technology driven approach to recreate the content management workflow for [24]7.ai

link

Find out how we transformed the digital image of world’s largest healthcare provider, an attribute that defined their global presence in the medical world.

link

Develop an internal portal aimed at encouraging sellers at Flipkart to obtain latest insights with respect to a particular domain.

link
Categories: Drupal

Gnomecast #72 – GMing from NOTHING

Gnome Stew - 8 August 2019 - 5:00am

Join Ang, John, and Chris for a discussion about getting comfortable running games without any prep and relying on improvisation. Will these gnomes be able to improvise their way out of getting tossed in the stew this week?

Download: Gnomecast #72 – GMing from NOTHING

Resources mentioned in this show include:

Get details on GEM fund-matching for the 2019 IGDN Metatopia Sponsorship here.

Follow Chris at @Thelight101 on Twitter and Christoper M. Sneizak on Facebook.

Follow John at @johnarcadian on Twitter and anywhere fine John Arcadians are bartered or sold, like johnarcadian.com.

Follow Ang at @orikes13 on Twitter and see pictures of her cats at @orikes13 on Instagram.

Keep up with all the gnomes by visiting gnomestew.com, following @gnomestew on Twitter, or visiting the Gnome Stew Facebook Page. Subscribe to the Gnome Stew Twitch channel, check out Gnome Stew Merch, and support Gnome Stew on Patreon!

For another great show on the Misdirected Mark network, check out Panda’s Talking Games!

Categories: Game Theory & Design

Body node ID class

New Drupal Modules - 8 August 2019 - 4:05am

Body node ID class module is used to add node ID (nid) as a class to <body> tag on node pages.
In Drupal 7 core there was a unique node ID class in the <body> tag.
This is forward-port of that functionality for Drupal 8.

Installation

Install as you would normally install a contributed Drupal module.

Categories: Drupal

Srijan Technologies: Your Step-by-Step Drupal Migration Guide

Planet Drupal - 8 August 2019 - 3:14am

With Dries’ latest announcement on the launch of Drupal 9 in 2020, enterprises are in an urgent need to upgrade from Drupal 7 and 8 to version 9.

Categories: Drupal

Agiledrop.com Blog: Interview with Ricardo Amaro: The future is open, the future is community and inclusion

Planet Drupal - 8 August 2019 - 1:54am

In our latest interview, Ricardo Amaro of Acquia reveals how his discovery of Drupal has enabled him to work on projects he enjoys and that make a meaningful impact. Give it a read to learn more about his contributions and what the Drupal community in Portugal is like.

READ MORE
Categories: Drupal

Character Class: Multi-Classing: The Tactician

RPGNet - 8 August 2019 - 12:00am
When you prepare for 45 minutes before opening the door.
Categories: Game Theory & Design

Pages

Subscribe to As If Productions aggregator