Skip to Content

Newsfeeds

Entity Reference Gallery Formatter

New Drupal Modules - 16 July 2015 - 9:12am

Entity Reference Gallery Formatter provides a field formatter for displaying referenced entities as galleries.

Categories: Drupal

Pronovix: Interview with a d8upgrade user

Planet Drupal - 16 July 2015 - 6:18am

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?

Categories: Drupal

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

Planet Drupal - 16 July 2015 - 5:33am
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
Categories: Drupal

Dynamic panes

New Drupal Modules - 16 July 2015 - 5:03am

Dynamic panes module allows developers to put specific Panels panes into the page and then content editors can control what blocks will be displayed in each pane without going into Panels administration pages, all control available through frontend with IPE-like editing.

Categories: Drupal

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

Planet Drupal - 16 July 2015 - 4:56am
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/
Categories: Drupal

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

Planet Drupal - 16 July 2015 - 1:41am

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

Categories: Drupal

Aerial Maps and Your Game

Gnome Stew - 16 July 2015 - 12:00am

Recently I needed a forest road map for an encounter, and my creativity was running a bit low. The best I could come up with was the standard “road with trees on either side.” Online aerial maps helped me break out of the creative slump, and I thought I’d share some of my observations here.

FINDING THE RIGHT MAP

If you’d like to find an aerial map, you may wish to start close to home. Need a warehouse district for your modern game? I bet you know some areas in your town or from somewhere you’ve lived in the past. Your local supermarket, downtown, or park can provide great fodder for maps. For my forest road, I chose an area near my parents’ house with lots of trails. I know the area well and within a few minutes I had a map I could use.

Choosing a familiar area allows you to provide realistic details while you GM. After all, this is your old stomping grounds, though the players don’t need to know that. Also, it makes it much easier to ad-lib if they surprise you or go “off map.”

Of course, you aren’t limited to your own town. If you run a modern game, imagine an adventure based around Mount Rushmore or Times Square. If you run a fantasy or historical game, check out some European castles, Stonehenge, or Machu Pichu. There’s even Google Mars.

Now that you’ve found your map, let’s look at where you might go from here.

USING THE MAP AS IS (MOSTLY)

If you’ve found the right map, you may be able to just crop it and run. If you are using a virtual tabletop, you may wish to shrink the size a bit, and lower the quality of your jpeg image to about 90%. This will help keep your filesize manageable. If you need a print version, consider the free site blockposters.com. They allow you to upload and slice your image to the desired size. Then it will create a pdf for you. Print it out, glue or tape it together, and you’re ready for a tabletop game.

You may need to doctor your map a bit. Suppose you need a UFO landing site. Find a nice field, paste a spaceship onto a separate layer, and then adjust the sizes to your needs. You can easily add statues, vehicles or even a dead Celestial in the same way.

REDRAWING THE MAP

Sometimes finding a game-ready map just isn’t possible. Often the resolution may be too grainy, or there may be undesired elements on the image. That asphalt highway just may not cut it in Middle-Earth. When that happens, you can still use the aerial map for inspiration.

Let’s look at an example. Here’s the forest road that started this whole thing. It has a hill, an open field, short cliffs, and some rubble from past mining in the area. Overall, it is much more varied than what I originally had in mind.

Now here’s the hand drawn map. It was sketched in pencil, and then inked with a drawing pen. It was then scanned into the computer and colored with paint.net. You’ll notice I simplified it a bit, and added the suggestion of a couple side roads to the east and northwest. Maybe they’ll go check those out at some point in the future. Redrawing the map gave me the freedom to make some adjustments.

If you feel your artistic skills are lacking, you can still use aerial maps. Print one out, and then use a lightbox or a window to trace over the parts of the image you want. Move roads, buildings, etc… as needed. Your players will appreciate the map, and you probably draw better than you think.

CONCLUDING THOUGHTS

Aerial maps have their limitations. Not every locale is available, and sometimes you’ll want a more custom site. However, they can be a great source of inspiration, and often a timesaver. If you have any experience or thoughts about these kind of maps, share them below.



Categories: Game Theory & Design

KnackForge: Drupal : Add an icon to the menu links

Planet Drupal - 15 July 2015 - 11:33pm

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.

Categories: Drupal

The World-System of Game Development - by Benjamin Quintero

Gamasutra.com Blogs - 15 July 2015 - 10:47pm
The game development industrial revolution has transitioned us from product laborers to middleware consumers. good or bad?
Categories: Game Theory & Design

Are You Punishing Players Who Pay? Rethinking Monetization Strategies. - by Rob Weber

Gamasutra.com Blogs - 15 July 2015 - 10:47pm
Are you using a monetization strategy that chokes players out of games they otherwise enjoy? Logically, developers may think if they identify users who are willing to pay for a premium experience, then they should restrict rewarded ads. It's flawed logic.
Categories: Game Theory & Design

Reactions to a woman’s voice in an FPS game: The moderating role of status and skill - by Wai Yen Tang

Gamasutra.com Blogs - 15 July 2015 - 10:47pm
A field experiment examining negative and positive reactions to male vs. female voice within an FPS game. The role of players' status and performance are examined.
Categories: Game Theory & Design

About framesets in friGame - by Franco Bugnano

Gamasutra.com Blogs - 15 July 2015 - 10:47pm
Framesets are the cool new feature in the latest development version of friGame, and in this blog post we will see what they are and the motivation behind their implementation.
Categories: Game Theory & Design

Breaking the Laws of Physics - by Avimaan Syam

Gamasutra.com Blogs - 15 July 2015 - 10:40pm
How updating from Unity 4 to Unity 5 with IGF Grand Prize winner Outer Wilds has been a challenge due to our crazy implementation of physics.
Categories: Game Theory & Design

Slick Entity Reference

New Drupal Modules - 15 July 2015 - 4:41pm

Field formatter for Entity Reference fields, using Slick.

Categories: Drupal

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

Planet Drupal - 15 July 2015 - 2:36pm

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.

Categories: Drupal

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

Planet Drupal - 15 July 2015 - 2:26pm

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!  ...

Categories: Drupal

Four Kitchens: Introducing Saucier

Planet Drupal - 15 July 2015 - 2:11pm

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
Categories: Drupal

Kongregate's new Launchpad program aims to take web games mobile

Social/Online Games - Gamasutra - 15 July 2015 - 10:52am

Kongregate's new incubator is being marketed to indie game makers as a program to help them design, fund and promote their game on the web -- and if it does well enough, on mobile as well. ...

Categories: Game Theory & Design

RESTful Panels

New Drupal Modules - 15 July 2015 - 9:44am
Categories: Drupal

OpenConcept: Conforming to coding standards with linters

Planet Drupal - 15 July 2015 - 9:27am

At the the DrupalNorth code sprint, I spent some time chatting about code linters, and how to use them to ensure your code conforms to coding standards. So, I thought I'd share the process that works for me.

If you find a better process, please blog about it and post a link in the comments!

This tutorial assumes:

  • You write or modify code in a language like PHP, JavaScript, CSS, Bash, etc.
What is a linter?

Simply put, a linter is a static analysis tool that you can run to ensure that your code is free from syntax and/or style errors.

Types of linters

To help me prioritize fixing linter messages, I usually classify linters into two types:

  • Linters that check for syntax errors, and,
  • Linters that check for coding standards violations.

I consider linters that check for syntax errors manditory, since I can't really think of a time when I would want code which contains syntax errors (in PHP and JavaScript, syntax errors cause unrecoverable fatal errors if the file containing the code is ever parsed (i.e.: white screen of death, JavaScript engine halting)). I will not commit code unless these types of linters give the okay.

I consider linters that check for coding standards violations strongly recommended (as they affect the maintainability of your code), but technically optional (because code that doesn't conform to standards still works). I try to avoid committing code that doesn't pass these linters; but there are some circumstances when that is unavoidable (e.g.: if I have to commit a contributed module, or if it's a hotfix and there's a plan to make the code more-maintainable later).

Checking for syntax errors

Many interpreted languages and shells have a syntax-checker built into them, for example:

  • php -l $file will check a PHP script for syntax errors,
  • bash -n $file will check a BASH shell script for syntax errors,
  • ruby -c $file will check a Ruby script for syntax errors,
  • perl -c $file will check a Perl script for syntax errors,
  • zsh -n $file will check a ZSH shell script for syntax errors, and,
  • fish -n $file will check a Fish shell script for syntax errors.

I wasn't able to find any built in syntax linters for JavaScript, Python, and PowerShell, but please leave a comment if you know of one.

Checking for coding standards

Github has put together a showcase of clean code linters, but note that they are limited to ones developed on Github.

As a Drupal developer, I usually use:

Since Drupal's coding standards differ slightly from other communities, all of these tools need to be configured slightly before you can use them. I'll explain how to install and configure all of these below.

Note that PHP CodeSniffer, the Drupal coding standards sniffs, and the Drupal Best Practice sniffs are used by the Drupal Automated Project Review tool.

PHP CodeSniffer

To set up PHP CodeSniffer, I'm assuming that:

  • You know how to use the command-line,
  • PHP is installed on your machine and in your PATH,
  • You have installed Composer,
  • You want to install PHP CodeSniffer globally (i.e.: for all projects), and,
  • Composer's ~/.composer/vendor/bin folder is in your PATH.
Installing
  1. Tell Composer to install PHP CodeSniffer globally:

    composer global require 'squizlabs/php_codesniffer'
  2. Install the Coder module globally, so we can use it's Drupal coding standards and best practices sniffs:

    composer global require 'drupal/coder'
  3. Register the Drupal and DrupalPractice Standards with PHP CodeSniffer:

    phpcs --config-set installed_paths ~/.composer/vendor/drupal/coder/coder_sniffer
Use

To check that a file conforms to the Drupal coding standards, run:

phpcs --standard=Drupal $file

To check that a file conforms to the Drupal best practices, run:

phpcs --standard=DrupalPractice $file Setting a default coding standard

It is possible to set a default coding standard (i.e.: so you can just run phpcs $file), but:

  • You still have to run

    phpcs --standard=DrupalPractice $file

    to check that the file conforms to best practices, and,

  • If you ever have to work on non-Drupal projects, you'll have to explicitly state:

    phpcs --standard=PEAR $file

    for php's default functionality.

Instead of setting a default, you could create an alias in your shell. For example, if you use Bash, adding...

alias drupalcs='phpcs --standard=Drupal'

... to your .bash_profile or .bashrc will let you run...

drupalcs $file

... instead of...

phpcs --standard=Drupal $file

If you use another shell, this is left as an exercise to the reader.

Fix coding standards violations with the PHP Code Beautifier (phpcbf)

PHP CodeSniffer also ships with a command called phpcbf (PHP Code Beautifier), which can fix some coding standards violations automatically. For example, to convert a file to the Drupal coding standards, run:

phpcbf --standard=Drupal $file

A word of warning: I haven't tested phpcbf very extensively, so your mileage may vary. It may eat your code and/or socks.

Ignoring files, or parts of a file

You might want to ignore coding standards violations on legacy code that the team has decided isn't worth the effort to convert to coding standards.

  • You can ignore whole files by adding a

    // @codingStandardsIgnoreFile

    comment at the top of the file, immediately after the opening PHP tag.

  • You can ignore certain parts of a file by surrounding that part of the file with

    // @codingStandardsIgnoreStart

    and

    // @codingStandardsIgnoreEnd

    comments.

See the PHPCodeSniffer advanced usage instructions for more information.

ESLint

To set up ESLint, I'm assuming that:

  • You know how to use the command-line,
  • You have installed Node.js,
  • Node.js' npm ("Node Package Manager") executable is in your PATH, and,
  • You want to install ESLint globally (i.e.: for all projects).
Installing
  1. Tell npm to install ESLint globally:

    npm i -g eslint

    On certain machines, you may need to run this command with sudo; but try it without sudo first.

Configuring

ESLint needs a .eslintrc file (and usually, a .eslintignore file as well) in your project's root directory.

If you're working on a Drupal 8 project, ESLint will just work, because it's configuration files ship with Drupal 8.0.x core. For other projects, you'll need to copy .eslintrc from Drupal 8 core.

Drupal 8.0.x core's .eslintignore probably won't work for your project, but I've put together some templates for your D7 projects, and you can also refer to the official .eslintignore documentation if you need to customize them further.

Use

To check that a JavaScript file conform to Drupal coding standards, run:

eslint $file CSSLint

To set up CSSLint, I'm assuming that:

  • You know how to use the command-line,
  • You have installed Node.js,
  • Node.js' npm ("Node Package Manager") executable is in your PATH, and,
  • You want to install CSSLint globally (i.e.: for all projects).
Installing
  1. Tell npm to install ESLint globally:

    npm i -g csslint

    On certain machines, you may need to run this command with sudo; but try it without sudo first.

Configuring

CSSLint needs a .csslintrc file in your project's root directory.

If you're working on a Drupal 8 project, CSSLint will just work, because it's configuration file ships with Drupal 8 core. For other projects, you'll need to copy .csslintrc from Drupal 8 core.

Use

To check that a CSS file conforms to Drupal coding standards, run:

csslint $file Running the coding-standards linters

Once PHP CodeSniffer, ESLint, and CSSLint have been installed and configured, you can:

  • Check that a PHP file conforms to Drupal coding standards with:

    phpcs --standard=Drupal $file
  • Check that a PHP file uses Drupal best practices with:

    phpcs --standard=DrupalPractice $file
  • Check that a JavaScript file conforms to Drupal coding standards with:

    eslint $file
  • Check that a CSS file conforms to Drupal coding standards with:

    csslint $file
A note on the history of Drupal coding standards checkers

In the past, most of us used the Coder module to check that our work conformed to the Drupal coding standards and documentation standards. However, the Coder module relied on parsing PHP, JavaScript, etc. code using regular expressions, which were hard to understand, write, and maintain, and couldn't catch all cases (because almost all programming languages are parsed with tokenizers and context-free grammars).

The move to PHP CodeSniffer started with the Drupal Code Sniffer (drupalcs) module, which eventually was imported into the Coder module's 7.x-2.x branch. It concentrated on checking PHP code only.

As the Drupal Community developed our own CSS coding standards and JavaScript coding standards, we needed a way to automatically check those too. Rather than writing our own parsers, we decided to "get off the island" and use what the wider web development community was using.

Stay tuned

Next week, I will blog about automatically running linters when you commit code, which can be pretty useful.

Topic: Primary Image: 
Categories: Drupal
Syndicate content


Google+
about seo