Newsfeeds

Admin Theme Change

New Drupal Modules - 21 March 2017 - 2:01am

This module is used to show ANY SELECTED theme based on selective routes/paths and render selected theme for that route/path.
Note : if user has permissions to view SELECTED theme then only theme will be accessible.
Ex: If any authenticated user want to view '/abc' route in admin theme and '/xyz' in CUSTOM theme
this module will help to show selected routes/paths in respective selected theme.

Categories: Drupal

Valuable but not profitable: Garden Wars Postmortem - by Cory Spooner

Gamasutra.com Blogs - 21 March 2017 - 1:59am
Garden Wars can be summed up as a definitely-not-profitable project, that almost pays for itself in other ways (but not quite). Here are the top 8 reasons why development was tougher than it should have been.
Categories: Game Theory & Design

Web Omelette: Storing user data such as preferences in Drupal 8 using the UserData service

Planet Drupal - 21 March 2017 - 1:30am

Have you ever needed to persist some irregular data relating with a user account? Things like user preferences or settings that are kinda configuration but not really? Storing them as configuration means having to export them, and that’s no option. Storing them in State is an option, but not a good one as you’d have to maintain a State value map with each of your users and who wants to deal with that…

In Drupal 7, if you remember way back when, we had this data column in the user table which meant that we could add to the $user->data array whatever we wanted and it would get serialised and saved in that column (if we saved the user object). So what is the equivalent of this in Drupal 8?

I’m happy to say we have the exact same thing, but of course much more flexible and properly handled. So not exactly the same. But close. We have the user.data service provided by the User module and the users_data table for storage. So how does this work?

First of all, it’s a service. So whenever we need to work with it, we have to get an instance like so:

/** @var UserDataInterface $userData */ $userData = \Drupal::service('user.data');

Of course, you should inject it wherever possible.

The resulting object (by default) will be UserData which implements UserDataInterface. And using this object we can store as many pieces of data or information for a given user as we want. Let’s explore this a bit to learn more.

The interface has 3 methods or handling data: get(), set(), delete(). But the power comes in the method arguments. This is how we can store some data for User 1:

$userData->set('my_module', 1, 'my_preference', 'this is my preference');

So as you can see, we have 4 arguments:

  • The module name we want this piece of data to be findable by
  • The user ID
  • The name of the piece of data
  • The value of the piece of data

This is very flexible. First, we can have module specific data. No more colluding with other modules for storing user preferences. Stay in your lane. Second, we can have multiple pieces of data per user, per module. And third, the value is automatically serialised for us so we are not restricted to simple strings.

Retrieving data can be done like so:

$data = $userData->get('my_module', 1, 'my_preference');

This will return exactly this is my preference (in our case). And deserialisation also happens automatically if your data got serialised on input.

Deleting data is just as easy:

$userData->delete('my_module', 1, 'my_preference');

Moreover, most of the arguments of the get() and delete() methods are optional. Meaning you can load/delete multiple pieces of data at once. Check out UserDataInterface to see how omitting some arguments can return/delete sets of records rather than individual ones.

And that is pretty much it. And in true Drupal 8 form, there’s nobody stopping you from overriding the service and using your own UserDataInterface implementation that has that little extra something you are missing. So no, you probably don’t have to create that custom table after all.

Categories: Drupal

Observations From A Gamer's Chair: Tips on Generating Sci-Fi Locations

RPGNet - 21 March 2017 - 12:00am
How to create a sense of wonder.
Categories: Game Theory & Design

Token Link

New Drupal Modules - 20 March 2017 - 11:38pm

This module was created to speed up slow administrative pages, fix memory limit errors, and solve client site javascript timeouts caused by a high number of tokens loading on the initial page request. This module solves these problems by replacing any call to render the entire token tree with a call to render only a link which if clicked will perform a second page request as an overlay.

Categories: Drupal

PreviousNext: Lifting the Lid on our Containers

Planet Drupal - 20 March 2017 - 8:19pm

We have been running containers in production for more than a year now and want to share some of the lessons learnt, by open sourcing our container suite.

Categories: Drupal

Chart.js Full

New Drupal Modules - 20 March 2017 - 3:42pm

This module provides simple Chart.js integration with your Drupal 7 or Drupal 8 (coming soon) site's statistics.

Categories: Drupal

What makes a great in-game loot box? Devs weigh in

Social/Online Games - Gamasutra - 20 March 2017 - 3:32pm

"We wanted it to be this festive Christmas experience," Halo 5 dev Christopher Bloom tells Kotaku. "But you can't do it all the time or you lose the specialness." ...

Categories: Game Theory & Design

Shorthand

New Drupal Modules - 20 March 2017 - 3:03pm

This module provides integration with Shorthand, an application which describes itself as "beautifully simple storytelling". It connects your Shorthand account with Drupal and allows you to publish your stories on a Drupal website. Create your Shorthand account to get a User ID and API Token (found on the account settings page) which are prerequisite for using this module.

Categories: Drupal

Drupal Modules: The One Percent: Drupal Modules: The One Percent — Alert to Administrator (video tutorial)

Planet Drupal - 20 March 2017 - 3:01pm
Drupal Modules: The One Percent — Alert to Administrator (video tutorial) NonProfit Mon, 03/20/2017 - 17:01 Episode 24

Here is where we bring awareness to Drupal modules running on less than 1% of reporting sites. Today we'll take a look at Alert to Administrator, a module which displays an alert every time a user logs in as an administrator.

Categories: Drupal

Lots of new Tanks Expansion Packs Previewed

Tabletop Gaming News - 20 March 2017 - 3:00pm
With Battlefront headed to North Africa with their latest Flames of War releases, they’ve decided to head that direction in Tanks, their armored skirmish game as well. In May/June, they’ll be coming out with 6 new sets. From the announcement: Across the sands of North Africa the Afrika Korps and 8th Army battle it out. […]
Categories: Game Theory & Design

Emergency Alerts

New Drupal Modules - 20 March 2017 - 2:39pm
Emergency Alerts

A Drupal 8 module to provide emergency alerts.

Quickstart

Enable this module and configure to set alert title and message, severity, and to turn on block or full page override.

(optional) Add region emergency_alert to your theme and in templates. For example (in theme.info.yml),

Categories: Drupal

Castles & Crusades Players’ Handbook Up On Kickstarter

Tabletop Gaming News - 20 March 2017 - 2:00pm
Printing books is expensive. You’ve got to get together all the writing, all the artwork, and the layout done. Then you’ve got to send those files off to the printer. And you want to get as good a quality product as you can. Well, quality costs money. Even for popular titles, it might take a […]
Categories: Game Theory & Design

People remain calm as the world ends, video game study suggests

Virtual Reality - Science Daily - 20 March 2017 - 1:23pm
As the world ends, will you lock arms and sing 'Kumbayah' or embark on a path of law-breaking, anti-social behavior? A new study, based upon the virtual actions of more than 80,000 players of the role-playing video game ArcheAge, suggests you'll be singing. The study found that despite some violent acts, most players tended toward behavior that was helpful to others as their virtual world came to an end.
Categories: Virtual Reality

Renegade Game Studios Announces Scott Pilgrim’s Precious Little Card Game

Tabletop Gaming News - 20 March 2017 - 1:00pm
When reading over the description for this game, all I could think of was the old Toys R Us jingle, “I don’t wanna grow up. I’m a Toys R Us kid…” And now I’ve probably gotten that stuck in a lot of your heads, too. No, I’m not ashamed. Anyway, Renegade Game Studios has announced […]
Categories: Game Theory & Design

Test Project 2

New Drupal Modules - 20 March 2017 - 12:24pm
Categories: Drupal

Warlord Games Taking Pre-orders For To Kill A King Supplement To Pike & Shotte

Tabletop Gaming News - 20 March 2017 - 12:00pm
The most interesting thing about King Charles the I is that he was 5’6″ tall at the start of his reign, but only 4’8″ tall at the end of it (source). … Ok, seriously, that’s the only thing I could hear while reading about this book. Warlord Games has started taking pre-orders for their new […]
Categories: Game Theory & Design

Monday Terrain Corner

Tabletop Gaming News - 20 March 2017 - 11:00am
Well, I’m coming to realize that this is not going to be a regular week. With all the prep and hype for GAMA last week, even though I realize that I leave for Adepticon this week, it’s still sort of a, “oh yeah, that…” instead of, y’know, “Oh yeah! That!!” At Adepticon, one of the […]
Categories: Game Theory & Design

CrowdRiff

New Drupal Modules - 20 March 2017 - 10:37am
Categories: Drupal

Necronomicards Volume II Up Now On Kickstarter

Tabletop Gaming News - 20 March 2017 - 10:00am
You know, normally, you’re trying to keep various Lovecraftian horrors from invading our mortal realm. But, you know, sometimes you just want your brain melted into insanity. Amirite? That’s what you do in Necronomicards. There’s a new expansion for the game that’s up now on Kickstarter. It adds new tactical elements as well as lets […]
Categories: Game Theory & Design

Pages

Subscribe to As If Productions aggregator