All RPGs and Storygames by Tod Foley are now available at DrivethruRPG. Bring these games to your table!
If you’ve ever wished there was a way to easily import CSV data into your Drupal website then this post is for you. With the new Entity Import module, website admins can easily add and configure new importers that map CSV source files to Drupal 8 entities. Entity Import adds a user interface for Drupal 8’s core migration functionality. It lets you add importers for any entity in the system, map source data to entity fields, configure process pipelines, and of course, run the import.Why Another Drupal Import Module?
In Drupal 8 there are already several good options for importing and migrating content using the admin interface.
The Feeds module is one approach for importing content, with a great user interface and huge community of support. Feeds has been around for 7+ years, has been downloaded 1.8 million times, and, according to its Drupal project page, is being used on more than 100,000 websites.
The Migrate module, a part of core for Drupal 8, is an incredibly powerful framework for migrating content into Drupal. With Migrate, developers can create sophisticated migrations and leverage powerful tools like rollback, Drush commands, and countless process plugins for incredibly complex pipelines.
We use both Migrate and Feeds extensively. (Check out this recent post from Joel about getting started with Migrate.) Recently, though, we needed something slightly different: First, we wanted to provide Drupal admins with a user interface for configuring complex migrations with dependencies. Second, we needed Drupal admins to be able to easily run new imports using their configured migrations by simply uploading a CSV. Essentially, we wanted to give Drupal admins an easy-to-use control panel built on top of Drupal core’s migrate system.My First Use Case: Complex Data Visualizations
Here at Aten, we do a lot of work helping clients with effective data visualizations. Websites like the Guttmacher Institute’s data center and the Commonwealth Fund’s 2018 interactive scorecard are great examples. When I started working on another data-heavy project a few months ago, I needed to build a system for importing complex datasets for dynamic visualizations. Drupal’s core migration system was more than up for the task, but it lacks a simple UI for admins. So I set about building one, and created Entity Import.Getting Started with Entity Import Download and Install
Entity Import is a Drupal module and can be downloaded at https://Drupal.org/project/entity_import. Alternatively, you can install Entity Import with composer:
composer require drupal/entity_import
Entity Import is built directly on top of Drupal’s Migrate module, and no other modules are required.Adding New Importers
Once the Entity Import module is installed, go to Admin > System > Entity Import to add new importers. Click “Add Importer.”
For each importer, you will need to provide:
- Name - In my case I used “Dataset,” “Indicators,” and “Topics.” Generally speaking, I would name your importers after whatever types of data you are importing.
- Description - An optional description field to help your Drupal administrators.
- Page - Toggle this checkbox if you want to create an admin page for your importer. Your administrators will use the importer page to upload their CSV files.
- Source Plugin - At the time of this writing, Entity Import provides just one source plugin: CSV. The system is fully pluggable, and I hope to add others – like XML or even direct database connections – in the future.
- Plugin Options - Once you choose your source Plugin (i.e. CSV) you’ll have plugin-specific configuration options. For CSVs, you can choose whether or not to include a header row, as well as whether or not to support multiple file uploads.
- Entity Type - Specify which entity type your data should be imported into.
- Bundles - Once you pick a entity type, you can choose one or more bundles that your data can be imported into.
Each Importer you add will have its own configuration options, available under Admin > Configuration > System > Entity Importer. Configuration options include:
- Mappings - Add and configure mappings to map source data to the appropriate destination fields on your entity bundles. (Important side note: when creating mappings, the human readable name can be whatever you wish; the machine name, however, needs to match the column header from your source data.)
- Process Plugins - When you add new mappings you can specify one or more process plugins directly in the admin interface. This is where things get interesting – and really powerful. Drupal 8 provides a number of process plugins for running transformations on data to be migrated (read more about process plugins in Joel’s recent migrations post). With Entity Import, you can specify one or more process plugins and drag them into whatever order you wish, building process pipelines as complicated (or simple) as you need. Your admins can even manage dependencies on other imports; for example, mapping category IDs for an article importer to categories from a category importer. Again, no coding necessary. Entity Import provides a user interface for leveraging some of Migrate’s most powerful functionality.
Once you’ve added and configured importers, go to Admin > Content > [Importer Name] to run a new import. You’ll see three tabs, as follows:
- Import - This is the main import screen with upload fields to upload your CSV(s). If your import has dependencies specified in any of its process plugins, the import(s) it depends on will show up on this screen as well. (TODO: Currently, the interface for managing multiple, interdependent imports is a little complicated. I’d like to make it easier for users to visualize the status of all interdependent migrations at-a-glance.)
- Actions - After you run an import, you can rollback using the options on the actions tab. (TODO: I’d like to add other actions as well; for example, the ability to change or reset import statuses.)
- Logs - Migration logs are listed for each import, allowing admins to quickly see if there are any errors. You can quickly filter logs by message type (i.e. “notice” or “error”).
Soon after wrapping up a working prototype for the data visualization project I mentioned above, I was tasked with another project. A prominent university client needed to quickly import an entire course catalog into Drupal. Beyond running a single import, this particular organization needed the ability to upload new CSVs and update the catalog at any point in the future. The use case was a perfect match for Entity Import. I installed the module, spent a few minutes adding and configuring the course importer, and presto!Next Steps for Entity Import
Writing clean, reusable code packaged as modules is a huge benefit for Drupal development workflows. Even better, Drupal.org module pages provide really great tools for collaboration with features like issue tracking, release management, and version control built into the interface. I have a few TODOs that I’ll be posting as issues in the days ahead, and I am excited to see if Entity Import fills a need for others like it has for me.
If you run a data or content -intensive website and have trouble keeping everything up to date, Entity Import might be just the ticket. We’d love to give you a quick demo or talk through how this approach might help – just give us a shout and we’ll follow up!
Drupal 8 websites can easily exchange data with third-party websites or apps. These can be iOS or Android devices, applications on Vue.js, React, Angular, or other JS frameworks, and so on. Web services in Drupal 8 core take care of the smooth interaction. To share Drupal data, developers often use REST export with Views in Drupal 8. Today, we will take a closer look at Views REST export.Read more
This module implements the Instamojo Payment Gateway in Drupal Commerce.About Instamojo Payment Gateway
Instamojo lets you collect payments instantly. Start simply by creating a link by adding details. Share with your audience, through a link. And start collecting payments in minutes!
As you emerge from the Pineward Forest you see the mountains known as the Airy Peaks. They loom in the north, grey, black, and unnaturally bare of snow. The Red Runner River guides your approach to the mountains and the town known as Foot. The river narrows as you come up to a stone bridge arching over it. On the other side you see the farmlands being worked by people, you notice all of them are human. Beyond them, in the shadow of the mountains, rests the town of Foot. It sits right in a crook of the mountains and the Red Lake, called such because the water is red. Some believe the water is colored with the blood of all who’ve died within the Peaks.
A waterfall feeds the lake, pouring out of the mountain but you don’t really hear it as you reach the edge of the town which has been built up around a strange building. It rests in what looks like the indentation of a huge dragons footprint. The sign hanging by the door shows a set of scales with red dragon scales on them.
Surrounding the odd shaped building are several storefront establishments making up the center of town. Near the back of the town is a one story building with several towels drying in the windows. A sign of a bathtub stands near the pathway leading to the front of the building and steam can be seen escaping from a chimney in the roof.
You can’t help but notice the local constables station and jail. The tall stone tower with bars on the windows and the man wearing a star on his green jacket sitting out front in a rocking chair are a dead giveaway.
A short road heads to the Red Lake on the east side of town. It ends at a dock and a red and white river boat, or a lake boat in this case. The water wheels on the ship are a multicolor affair but the colors are all stained red from the water of the lake. A few people move about the deck attending to tasks.
In the back of the center of town a metallic ringing of hammer on metal can be heard. It’s a blacksmith’s forges where several dwarves and humans work weapons, farm implements, armor, and other various pieces. Attached to the forge building and area is the storefront.
Just to the left of the Blacksmith is a two story building with no first floor windows. When you walk near the door a variety of smells and scents assault your nose. The sign hanging by the door has two flasks painted on it, one filled with a red liquid and the other a bubbling green.
To the west of that building is a road leading right to an opening in the mountain with a large painted sign pointing down it. It reads:
The Airy Peaks & the Goblin’s Wares.
Adventure & Fortune Await You.
There are several other buildings in the town. One is a general store with several wheelbarrows outside the stone building. A shop that has several displays of clothing in the window and a sign with a spool of thread and a needle. Then there are a bunch of houses, some near the mountain, which very suddenly rises up out of the ground, and others trailing off towards the farms. To the west you see the multicolor beauty of a flower field filled with all the colors of the rainbow right next to an old stone tower. In the middle of the field is a stone block. Surrounding the flower field is a forest.
Welcome to the town of Foot. May your stay be filled with adventure and fortune.
The town of Foot is the home base of any Airy Peaks campaign. It’s a place for adventurers to rest between delves into the Peaks, pick up rumors, spend their coin, make alliances and enemies with other adventurer’s, find hirelings, and get caught up in an intrigue or two, especially since it’s the home of the Cult of the White Fangs, the Church of Purity, and a nest of vampires. The characters might even meet a young lady who is really a golem.
In my next few Airy Peaks articles I’ll be talking more about the town of Foot and when the series about Foot is done you’ll have a home base town you can use for your games.
Map by Drew Smith
Provides a plugin type for extra fields in entity view display and entity form display.
This module allows developers and site builders to add custom fields by simply providing a plugin. Site builders can use these fields in entity view modes and entity form modes as normally like field group.
In addition, this module provides several very useful plugins that can be used as an example.
How do you seamlessly transition from your successful crowdfunding campaign to your own platform? Xsolla Store is the solution. ...
This module provides a CKEditor plugin to add a colored page break in content. This is a simple module which will allow to add page break in content with using color codes.
The Contact module requires you to enter a recipient when creating/editing a contact form to send an e-mail to when your form is submitted.
This module makes the 'Recipient' field optional, so it won't send an e-mail when the form is submitted. This might be useful when using the contact_storage module when you only want to save the submissions, but don't want to send an e-mail.
The Twig Tools module provides additional Twig filters and functions.Current Filters:
- Sanitizes all strings in an array for use as valid class names.
- Filters all non-unique values from an array.
- Removes all falsy values from an array.
This module allows you to bulk import the contents of folders from Acquia DAM into your Drupal site. This extends the functionality provided by Media: Acquia DAM, allowing you to have assets in Drupal without having to first associate them to another Drupal entity.
Flufftopia. One year later. Numbers and thoughts about a (probably) dead project - by Daniel da Silva
So obviously, the pendulum of progress stopped swinging on my game. As much as I tried to prevent it, pressing obligations just wouldn’t take a back seat (nor would the burglars who, a few weeks ago, stole 90% of my wardrobe and who last week stole my monitor). So after a string of hectic weekends and even crazier weeks, this weekend has been pretty wide open for doing whatever I want to do. And not a moment too soon!
So after doing all the other things I try to do with my weekends, I finally loaded up the ol’ Inform 7 IDE and started working on my game. To get me back in the swing of things, so to speak, I started reading through what I’d already written. It was an interesting experience.
Strangely, what impressed me most was stuff I had done that I have since forgotten I learned how to do. Silly little things, like actions I defined that actually worked, that had I tried to write them today, probably would have had me stumped for a while. Go me! Except, erm, I seem to have forgotten more than I’ve retained.
I also realized the importance of commenting my own code. For instance, there’s this snippet:
A thing can be attached or unattached. A thing is usually unattached. A thing that is a part of something is attached.
The problem is, I have no idea why I put it in there – it doesn’t seem relevant to anything already in the game, so I can only imagine that I had some stroke of genius that told me I was going to need it “shortly” (I probably figured I’d be writing the code the next night). So now, there’s that lonely little line, just waiting for its purpose. I’m sure I’ll come across it some day; for now, I’ve stuck in a comment to remind myself to stick in a comment when I do remember.
It reminds me of all the writing I did when I was younger. I was just bursting with creativity when I was a kid, constantly writing the first few pages of what I was sure was going to be a killer story. And then I’d misplace the notebook or get sidetracked by something else, or do any of the million other things that my easily distracted self tends to do. Some time later, I’d come across the notebook, read the stuff I’d written and think, “Wow, this is great stuff! Now… where was I going with it?” And I’d never remember, or I’d remember and re-forget. Either way, in my mother’s attic there are piles and piles of notebooks with half-formed thoughts that teem with potential never to be fulfilled.
This situation – that of wanting to resume progress but fumbling to pick up the threads of where I left off – has me scouring my memory for a term I read in Jack London’s Call of the Wild. There was a part in the book where Buck’s owner (it’s late, his name has escaped me) has been challenged to some sort of competition to see if Buck can get the sled moving from a dead stop. I seem to remember that the runners were frozen to the ground. I thought the term was “fast break” or “break fast” or something to that effect, but diligent (does 45 seconds count as diligent?) searching has not confirmed this or provided me with the right term. Anyway, that’s how it feels tonight – I feel as if I’m trying to heave a frozen sled free from its moorings.
The upside is, I am still pleased with what I have so far. That’s good because it means I’m very likely to continue, rather than scrap it altogether and pretend that I’ll come up with a new idea tomorrow. In the meantime, I’ll be looking for some SnoMelt and a trusty St. Bernard to get things moving again.
So I didn’t get as much coding done over the weekend as I had hoped, mainly because the telephone company *finally* installed my DSL line, which meant I was up til 5:30 Saturday am catching up on the new episodes of Lost. That, in turn, meant that most of the weekend was spent wishing I hadn’t stayed up until such an ungodly hour, and concentration just wasn’t in the cards.
However, I did get some stuff done, which is good. Even the tiniest bit of progress counts as momentum, which is crucial for me. If the pendulum stops swinging, it will be very hard for me to get it moving again.
So the other day, as I was going over the blog (which really is as much a tool for me as it is a way for me to share my thoughts with others), I realized I had overlooked a very basic thing when coding the whole “automatically return the frog to the fuschia” bit…
As the code stood, if the player managed to carry the frog to another room before searching it, the frog would get magically returned to the fuschia. This was fairly simple to resolve, in the end – I just coded it so that the game moves (and reports) the frog back to fuschia before leaving the room. I also decided to add in a different way of getting the key out of the frog – in essence, rewarding different approaches to the same problem with success.
Which brings me to the main thrust of today’s post. I have such exacting standards for the games I play. I love thorough implementation. My favorite games are those that build me a cool gameworld and let me tinker and explore, poking at the shadows and pulling on the edges to see how well it holds up. A sign of a good game is one that I will reopen not to actually play through again, but to just wander around the world, taking in my surroundings. I’ve long lamented the fact that relatively few games make this a rewarding experience – even in the best games, even slight digging tends to turn up empty, unimplemented spots.
What I am coming to appreciate is just how much work is involved in the kind of implementation I look for. Every time I pass through a room’s description, or add in scenery objects, I realize just how easy it is to find things to drill down into. Where there’s a hanging plant, there’s a pot, dirt, leaves, stems, wires to hang from, hooks to hang on, etc. Obviously, unless I had all the time in the world, I couldn’t implement each of these separately, so I take what I believe to be the accepted approach and have all of the refer to the same thing. Which, in my opinion, is fine. I don’t mind if a game has the same responses for the stems as it does for the plant as a whole, as long as it has some sort of relevant response. Even so, this takes a lot of work. It might be the obsessive part of me, but I can’t help but think “What else would a person think of when looking at a hanging plant?”
Or, as I’ve come to think of it: WWBTD?What Would Beta Testers Do?
I’ve taken to looking at a “fully” implemented room and wondering what a player might reasonably (and in some cases unreasonably) be expected to do. This is a bit of a challenging process for me – I already know how my mind works, so trying to step outside of my viewpoint and see it from a blind eye is hard. I should stop for a second to note that I fully intend to have my game beta tested once it reaches that point, but the fewer obvious things there are for testers to trip over, the more time and energy they’ll have for really digging in and trying to expose the weaknesses I can’t think of.
I’ve found one resource that is both entertaining and highly informative to me: ClubFloyd transcripts. ClubFloyd, for the uninitiated (a group among which I count myself, of course) is a sort of cooperative gaming experience — if anyone who knows better reads this and cares to correct what may well be a horrible description, by all means!– where people get together on the IFMud and play through an IF title. The transcripts are both amusing and revealing. I recently read the Lost Pig transcript and it was quite interesting. The things people will attempt to do are both astonishing and eye-opening. In the case of Lost Pig (which, fortunately, I had already played before reading the transcript), what was even more amazing was the depth of the game itself. I mean, people were doing some crazy ass stuff – eating the pole, lighting pants on fire, and so on. And it *worked*. Not only did it work, it was reversible. You obviously need the pole, so there’s a way to get it back if, in a fit of orc-like passion, you decide to shove it in down Grunk’s throat.
Anyway, my point is, the transcripts gave me a unique perspective on the things people will try, whether in an effort to actually play the game, to amuse themselves, or to amuse others. Definitely good stuff to keep in mind when trying to decide, say, the different ways people will try to interact with my little porcelain frog.Other Stuff I Accomplished
So I coded in an alternate way to deal with the frog that didn’t conflict with the “standard” approach. I also implemented a few more scenery objects. Over the course of the next few days, I’m going to try to at least finish the descriptions of the remaining rooms so that I can wander around a bit and start really getting to the meat of it all. I also want to work on revising the intro text a bit. In an effort to avoid the infodumps that I so passionately hate, I think I went a little too far and came away with something a bit too terse and uninformative. But that’s the really fun part of all of this – writing and re-writing, polishing the prose and making it all come together.
Whattaya know. Midnight again. I think I’m picking up on a trend here.