Newsfeeds

DrupalCon News: DrupalCon Takeaways - Rachel Lawson

Planet Drupal - 17 July 2017 - 11:19am

Oh! Hey there, my name is Piyush Jain and as a new staff member at the Drupal Association I wanted to learn what the community likes so much about DrupalCon. 

This week, I spoke with Rachel Lawson (rachel_norfolk), who has been part of the Drupal community for 11 years, and attended 6 DrupalCons.

Categories: Drupal

Freelock : Building a Membership site in Drupal 8

Planet Drupal - 17 July 2017 - 11:02am

Memberships are not all the same. Some memberships last a lifetime, others last a year, or a month. Some memberships are for an individual, others for a couple, others for an entire family.

Some memberships are for a particular time period -- the 2017 season, the 2017/18 school year, Summer -- others are for a particular length of time starting when you purchase it.

Drupal 8Drupal PlanetMembershipCustom DevelopmentCRM
Categories: Drupal

Monday Terrain Corner

Tabletop Gaming News - 17 July 2017 - 11:00am
And we’re back once more in the office. The start of the work week is upon us. It feels like it’ll be an eternity until next weekend, but we’ll make it there. I hope your weekend was good. I spent all day Saturday playing games with my friend, as I mentioned. There was Ascension, Munchkin, […]
Categories: Game Theory & Design

Highlight Changes

New Drupal Modules - 17 July 2017 - 10:38am

Highlight Changes provides a way for a user to visually see then changes made when editing content and entities. The modules provides feedback when values are changed, and a interface for the user to view and revert changes to a field.

Highlight changes tracks the initial value of a input when the page is rendered, when that input's value is changed, notice is placed next to the field, that provides a link to view and revert the changes made to the initial values.

This supports and works with core field widgets, CKEditor, Chosen and other modules as well.

Categories: Drupal

RuneScape is going multi-platform as a mobile MMORPG

Social/Online Games - Gamasutra - 17 July 2017 - 10:38am

Developer Jagex has laid plans to make the full version of its massively multiplayer online game playable on smartphones, complete with cross-platform play between PC and mobile. ...

Categories: Game Theory & Design

Revolutionaries RPG Up On Kickstarter

Tabletop Gaming News - 17 July 2017 - 10:00am
They say you want a revolution. Well, you know, we all wanna rule the world. In this case, it’s time to cast off the shackles of British rule so the colonies can become an independent nation on its own. That’s just what you’ll be doing in Revolutionaries, a new RPG that’s set during the American […]
Categories: Game Theory & Design

Video Game Deep Cuts: The 4D Cyberpunk Fire - by Simon Carless

Gamasutra.com Blogs - 17 July 2017 - 9:15am
This week's highlights include the Cyberpunk RPG's original author, 4D Toys' brain-bending surreality, Fire Pro Wrestling's resurgence, and lots more.
Categories: Game Theory & Design

Wyrd Monday Preview

Tabletop Gaming News - 17 July 2017 - 9:14am
So yeah, Monday may not be most people’s favorite day, but Wyrd does what they can to make it better with their regular previews. This time around, it’s a look at the artwork for the Guild Investigator. Wyrd previews a new model from the upcoming fifth Malifaux 2E Book, Broken Promises. They look at the […]
Categories: Game Theory & Design

Comic Relief Technology Blog: Pattern Lab — the beauty of a shared styling library

Planet Drupal - 17 July 2017 - 9:11am
For those who aren’t familiar with the concept of Pattern-Lab (or a Pattern Library), it’s essentially a living style guide; a common tool in… Read More
Categories: Drupal

Cryptozoic to Release Train Heist

Tabletop Gaming News - 17 July 2017 - 9:00am
It’s great to see a Kickstarter game make it to general release. That’s what we’ve got here, as Train Heist, which was originally run on Kickstarter from Tower Guard Games, will be seeing a wide release to gaming outlets via their teaming up with Cryptozoic. In the game, the players must work together to thwart […]
Categories: Game Theory & Design

Mediacurrent: Comparing Drupal and Sitecore, Part 2 of 2

Planet Drupal - 17 July 2017 - 9:00am

This is Part 2 of 2 of my Drupal vs Sitecore blog series. In the first part, I've compared the two from the perspectives of content authoring, marketing, and business. In this part, I look at the two platforms from an IT and community perspective. I also need to repeat my disclaimer that I'm a long-time Drupalist, but in this blog post I endeavor to be even-minded and objective.
 

Categories: Drupal

CiviCRM Blog: Developing with CiviCRM Entity and the Drupal API

Planet Drupal - 17 July 2017 - 8:23am

If you are a Drupal developer coming new to CiviCRM, it can be a bit of a "culture shock" to realize that CiviCRM is not your typical Drupal module.

CiviCRM has a separate and independent evolution and ecosystem, and its standard practices and APIs reflect that. From installation of the module itself, to creating customizations and modifications of its standard behavior, you are entering into a different "world" when you implement and develop client solutions with CiviCRM.

CiviCRM Entity can help a Drupal developer make the transistion by enabling them to use some of the standard Drupal API features they have grown accustommed to, while still providing insight into the data structures and interconnections of CiviCRM.

For people who spend the majority of their time developing in CiviCRM, it can feel the same way, in reverse. For all-day CiviCRM developers, CiviCRM Entity can be an opportunity to better leverage your Drupal CMS for customizations and new features.  So this introduction to Developing with CiviCRM Entity and the Drupal API is for you too.

How's it work?

The premise behind CiviCRM Entity is really quite simple, though its ramications are profound. What CiviCRM Entity does is automate the process of exposing CiviCRM API entities and actions as Drupal entity types. Basically a Drupal entity type is the standard Drupal data model for a database table.  You map metadata to columns, and this provides one consistent way to store, retrieve, and manipulate database table data for Drupal Core and the entire ecosystem of contributed modules that can go with it. Because CiviCRM does not by itself engage its data with Drupal's Entity API, the majority of Drupal modules are not aware of CiviCRM's data and cannot act on it.

CiviCRM Entity implements all the necessay hooks to define the CiviCRM data as Drupal entity types.  It registers the entity types with hook_entity_info(), sets up the metadata with a hook_entity_property_info_alter() implementation, and extends the default Entity API objects and controllers.  Inside the controller responsible for load, save, and delete, instead of using Drupal's standard PDO SQL query operations, CiviCRM API calls are used.  This makes CiviCRM Entity a "remote entity" module, but specifically designed to work with CiviCRM only. 

This bit alone does the most important thing. It makes Drupal think CiviCRM data is Drupal data.  You can attach Drupal fields, to CiviCRM data.  You can use Drupal's entity_metadata_wrapper. All the rest of the code in the module and its submodules dealing with specific integration enhancements is just gravy.

Using the metadata wrapper, we built up one bit of Drupal Form API code, that woks with all the entities, and provides Drupal standard CRUD forms. Now you got Manage Fields and Manage Display pages for each entity type. Now the Rules module will play nice. Now Drupal developers can build cool custom stuff, using their familar tools.

Entity Field Query

EntityFieldQuery is Drupal 7's standard programmatic way to query the database tables exposed as entities. So let's say we want to find all the Home location type addresses for a particular contact. If there are results there will be an array with key of the entity type name containing objects keyed by id.

$contact_id = 3099; $query = new EntityFieldQuery(); $address_ids = $query->entityCondition('entity_type', 'civicrm_address') ->propertyCondition('contact_id', $contact_id) ->propertyCondition('location_type_id', 1) ->execute(); if (!empty($address_ids['civicrm_address'])) { // do something } Load Drupal Entity objects

Following the example above, we have a query result, and now want to load the entity objects.

if (!empty($address_ids['civicrm_address'])) { // entity_load returns an array of entity objects keyed by id $address_entities = entity_load('civicrm_address', array_keys($address_ids['civicrm_address'])); // maybe you just want the individual entity objects... foreach ($address_ids['civicrm_address'] as $id => $result) { $address_entity = entity_load_single('civicrm_address', $id); // get the city of the address $city = $address_entity->city; } } Saving entities

Now lets make sure our city in our address has every word capitolized, and save the address. The data as you see it in the CiviCRM admin backend will immediately reflect the changes.

$address_entity->city = ucwords($address_entity->city); entity_save('civicrm_address', $address_entity); Deleting Entities

If you want to delete an entity, you can use entity_delete().  Remember that these functions eventually get to the controller, which is a wrapper around CiviCRM API calls.  This matters especially for contacts, because by default deleting contacts sends them to the CiviCRM "trash", instead of completely deleting them.

entity_delete('civicrm_address', $address_entity->id); The Entity Metadata Wrapper 

If you start getting serious about programmatically manipulating entities, you want to start using the Entity Metadata Wrapper. This object encapsulates all these operations in an object oriented way.  It becomes especially useful when you are manipulating multi-lingual fields. It also can use entity level validation based on the entity metadata for each property of the entity type.  I would encourage its use in favor of manipulating the entity object directly, or using the entity_X functions. The code is much more readable and easier to write, and with validation it is much safer. There is a great article about the benefits of the wrapper which goes into detail.

You can pass the entity_metadata_wrapper function the entity object, or simply the id of the entity, and it will lazy load the object. If all you have is the id to start, no need to load the entity object first.

$address_wrapper = entity_metadata_wrapper('civicrm_address', $address_id); $city = $address_wrapper->city->value(); if($address_wrapper->city->validate(ucwords($city))) { $address_wrapper->city = ucwords($city); $address_wrapper->save(); } // get the updated entity object $updated_address_entity = $address_wrapper->value(); // nevermind, lets just delete the entity $address_wrapper->delete(); Custom Rules Action Example

A very practical use case of using the Drupal API for CiviCRM is creating custom Rules conditions or actions. Lets say we want to encapsulate this logic of automatically making the city of an address have uppercase words.  We may want to encapuslate functionality like this and pass it on to our site builders or clients who can use it when they need it. Once you find out how easy it is to create custom Rules actions, you'll have a powerful tool in your toolbox. There's lots of documentation on the web for doing this. 

Lets put this in a little module, I'm calling it civicrm_custom. Create a directory in your sites/all/modules directory named civicrm_custom

To read the rest of the article, and to get the code to build the Rules action, visit the Skvare.com blog.

ToolsDrupal
Categories: Drupal

Fantasy Flight Games Previews New Leaders From Rise of the Empire Expansion for Star Wars: Rebellion

Tabletop Gaming News - 17 July 2017 - 8:00am
The best soldiers that either the Imperials or the Rebels can train still need good leaders to fully realize their potential. And the entire military strategy can’t be just left to chance. Someone needs to be in charge of it. The Rise of the Empire expansion for Star Wars: Rebellion will bring 8 new leader […]
Categories: Game Theory & Design

Mediacurrent: Mediacurrent's Drupal Theme Generator

Planet Drupal - 17 July 2017 - 7:55am

In a fast moving industry like ours, it is imperative that we have tools that allow us to build environments (front and back-end), quickly, while providing consistency all across. The same way we have DevOps processes for quickly spinning off a complete Drupal built with composer, drush, Drupal console and more, we need a system that automates the process of creating Drupal themes which include all the essential tools needed for a modern, best practices and standards compliant environment.
 

Categories: Drupal

Acquia Developer Center Blog: Building an Open Source Photo Gallery with Face and Object Recognition (Part 1)

Planet Drupal - 17 July 2017 - 7:28am

In this two-part series of blog posts, I'm going to show you how we built a Drupal 8 photo gallery site, integrated with Amazon S3, Rekognition, and Lambda to automatically detect faces (allowing us to automatically identify names!) and objects found in our photos.

Tags: acquia drupal planet
Categories: Drupal

How to Manage Taxes as an Indie Developer - by Jennifer Mendez

Gamasutra.com Blogs - 17 July 2017 - 7:23am
Looking to sell your game internationally? Here are a few things you should know about taxes.
Categories: Game Theory & Design

Games software/hardware over $150B in 2017, $200B by 2021, record $2.8B invested - by Tim Merel

Gamasutra.com Blogs - 17 July 2017 - 7:22am
Games software/hardware combined could drive >$150B for the first time in 2017, with software taking around 3/4 and hardware around 1/4 (Note: this is games software/hardware combined – non-hardware revenues could deliver >$110B globally this year)
Categories: Game Theory & Design

State-of-the-art HLSL to GLSL Converter - by Egor Yusov

Gamasutra.com Blogs - 17 July 2017 - 7:22am
This post introduces HLSL2GLSLConverter, a standalone tool that allows converting DirectX shaders authored in HLSL5.0 into GLSL source suitable for OpenGL/GLES applications.
Categories: Game Theory & Design

What we learned improvising a live game soundtrack - by Joost van Dongen

Gamasutra.com Blogs - 17 July 2017 - 7:21am
We did a couple of live stage performances where we improvised a new soundtrack to someone playing Journey and Ori And The Blind Forest. This post shares a video compilation of the performance and explains our approach and what did and didn't work.
Categories: Game Theory & Design

Video game music systems at GDC 2017: pros and cons for composers - by Winifred Phillips

Gamasutra.com Blogs - 17 July 2017 - 7:20am
In the GDC 2017 audio track, several interactive music systems were presented. In part 2 of her 3 article series, video game composer Winifred Phillips discusses the pros & cons of these systems, while also sharing case studies from her own projects.
Categories: Game Theory & Design

Pages

Subscribe to As If Productions aggregator