All RPGs and Storygames by Tod Foley are now available at DrivethruRPG. Bring these games to your table!
Code examples for Drupal 8.
Covers major sub-systems of Drupal 8 feature with examples code.
How to use correctly in Drupal 8 projects.
Decoupled Days 2019 last month, the third edition of the conference, was fantastic. I had the privilege to speak and attend last year, as well. The conference has quickly risen to be one of my favorite conference of the year.
Not familiar with Decoupled Days? Spawned in the “Hallway Track” of DrupalCon between its founders, the conference originated as Decoupled Drupal Days in 2017. Last year saw the phasing out of the word “Drupal” as the conference became focused on decoupling in general, not just Drupal. That is one reason it has quickly become a favorite event. It is an engineering and design conference. The act of decoupling in a system requires specific system design and presents engineering challenges. The organizers identify it as:
The only conference on the future of CMS, headless CMS, and decoupled CMS.
This module enables Zoom meetings to be used as Course objects.
The object allows for creation of new Zoom meetings or using existing ones.
A lightweight API is included.
Users attending these meetings will be marked complete in the object if they attend for the configured minimum amount of time.
DeveloperÂ RockstarÂ Games says that ribbon-cutting has caused players to flock to the game in a way they hadnâ€ t seen since Onlineâ€ s launch in 2013. ...
This module adds a new sitemap type which is compliant with the guidelines for Google News
It is an extension to the Simple XML Sitemap module which is required.
There's a whole heap of goodies in the download or in the box, depending on which version you have. Apparently the box also contains dice, otherwise there's no difference in the contents. Two books, reference cards, maps, pregenerated characters and some standees... everything you need to leap back into the near future.
Where to start? The 45-page Rulebook seems promising. This begins with The View From the Edge, an essay that sets out the stall of what it means to be cyberpunk. This paints the picture from the earliest days, when cyberpunk was the province of science-fiction authors, through the fictional alternate history that permeates the game from its first incarnation as *Cyberpunk 2013* and then *Cyberpunk 2020* - don't worry if you are not familiar with these games, you'll get the idea. However, the Fourth Corporate War has cut a swathe through everything, and much of what the cyberpunk of 2020 thought was normal is no more. Even Night City was a casualty, a nuke apparently. We're now in 2045, but there's still a place for the hip, freerolling, wired-in cyberpunk, operating more on the wrong side of the law than the right.
A brief precis of what a role-playing game is, for those who don't know, and a glossary of streetslang - you gotta sound right, choombatta, and then on to section 2: Soul and the New Machine. This takes a closer look at the philosophy, the look and feel, of cyberpunk... and reminds that, a major corporate war and the use of nuclear weapons later, there are few if any vestiges of civilization that would be familiar to people in society today. Players need to remember that it's personal, style over substance, attitude is everything, and you need to live on the edge. Oh, and rules are there to be broken. Then there's a look at Roles (read: character classes). There are nine: Rockerboys, Solos, Netrunners, Execs, Techs, Lawmen, Fixers, Medias, and Nomads (not all are covered in the Jumpstart). Next an overview of the character sheet, follwed by details of what everything means in terms of playing the character game mechanics-wise. The skills used for the pre-generated characters are explained.
Next up, 3: Lifepath. This is the system for generating a background for a character, and even with pre-generated ones there is scope for putting your own spin on the character that you are going to play. At each stage you may choose an option or roll for it. There's an example of how to do this, along with explanations of what this means for the player... and how it provides a bit of fun for the GM as well. All that backstory ready to exploit!
Then comes 4: Putting the Cyber into the Punk. This looks at the uses and abuses of cyberware, how to be stylish about your enhancements, and how the end-point of the exercise is survival - yours. With a few scary notes on cyberpsychosis, there are details of the various types of cybernetic enhancement you can have. Just remember: it's as much about fashion as it is about utility. We then move on to 5: Getting it Down. This covers how you actually play the game, when its time to use game mechanics rather than role-play to advance the plot. A lot covers combat because, let's face it, that's when you need to get the dice out... and of course it's a part of the game that most people enjoy. There's also a bit about task resolution, especially opposed tasks, when you want to use one of your skills to accomplish something.
Next, my favourite bit: 6: Netrunning in the Time of the Red. This explains the gear you need to go netrunning and how to use it, both in-game and in terms of game mechanics. This includes getting into brawls in the Net, which can be as deadly as doing so in the meat world. There are also times the Netrunner will have to go along with the rest of the infiltration team and brave the dangers of that sort of combat as well. This ends with an example Netrun, then back to real-world combat with 7: Thursday Night Throwdown, a variant on the original Friday Night Firefight rules. It's all an aid to streamline combat, to give you all the thrills without getting bogged down in the minutae of the rules. An alternate to brawling, the use of Reputation as a competitive sport, is also covered here. Finally there are summary cards of each of the pregenerated characters.
Speaking of pregenerated characters, there are 6 of them, with rather silly names - Torch the Tech, or Grease the Fixer... well, you may change those to something a bit more sensible if you prefer. Each comes with a page of backstory, character portrait and a full character sheet, as separate cards to give to each player.
The second book (or PDF) provided is the World Book. This provides 50-odd pages of background, setting, and adventure, starting with 1: Welcome to the Time of the Red. More detailed recent history explaining what the Fourth Corporate War was and how much damage it did to the world you now inhabit. The United States is fragmented, no longer a superpower. Night City, even 20 years later, is still a mess. The rest of the world is also in a state of flux. A good chance to make your mark, you might think, if you survive long enough, that is. Megacorps also suffered, but there are still corporations flexing the muscles pretty much unchecked. Then 2: Dark Future Countdown gives a detailed timeline of events from the 1990s onwards to the present day of 2045.
It may be battered, but Night City is still there, according to section 3. This gives a potted history from its foundation in 1994 to the present, bombs included. It's in the middle of a veritable fury of rebuilding, plenty of opportunity there. Just avoid the Hot Zone Wasteland, where the central business district used to be. Plenty here on politics, public services and law and order... yes, there is some! The next section 4: Everyday Things gives the lowdown on living there, aimed particularly at newcomers (which players will be, even if their characters are not... it's often best to play the characters as new arrivals too, so both can learn together about their new home). Vehicles, weapons, getting the news, shopping, it's all here. The food sounds terrible, though.
We then move into GM territory with 5: Running Cyberpunk Red. Plenty of good ideas about how to make the environment come to life for your group, opposition they might face, activities they can engage in. There are some sample encounters you can throw in whatever is happening, whatever the characters are trying to do. Finally, there is a fully-fledged adventure, The Apartment. The basic idea is that all the characters in the soon-to-become party live in the same apartment block, one of the few privately-owned (by one of them) blocks in the entire city. Someone wants to change that, gobble it up... and so the party needs to unite and fight for their home. There are notes on the other residents, and suggestions as to what might happen: pick and mix as you choose. There are some plans too. But that's not all. A collection of Screamsheets present more ideas for further adventures which you'll have to flesh out, three of them.
This contains all you need to get going, to see if the new version of *Cyberpunk* appeals. It doesn't matter if you don't know the original game, but if you do it moves the timeline along in a logical and believable manner. If you don't, just jump in and enjoy the delights that await!
In the previous entry, we learned that the Migrate API is an implementation of an ETL framework. We also talked about the steps involved in writing and running migrations. Now, let’s write our first Drupal migration. We are going to start with a very basic example: creating nodes out of hardcoded data. For this, we assume a Drupal installation using the standard installation profile which comes with the Basic Page content type.
As we progress through the series, the migrations will become more complete and more complex. Ideally, only one concept will be introduced at a time. When that is not possible, we will explain how different parts work together. The focus of today's lesson is learning the structure of a migration definition file and how to run it.Writing the migration definition file
The migration definition file needs to live in a module. So, let’s create a custom one named ud_migrations_first and set Drupal core’s migrate module as dependencies in the *.info.yml file.
Now, let’s create a folder called migrations and inside it a file called udm_first.yml. Note that the extension is yml, not yaml. The content of the file will be:type: module name: UD First Migration description: 'Example of basic Drupal migration. Learn more at https://understanddrupal.com/migrations.' package: Understand Drupal core: 8.x dependencies: - drupal:migrate
The final folder structure will look like:id: udm_first label: 'UD First migration' source: plugin: embedded_data data_rows: - unique_id: 1 creative_title: 'The versatility of Drupal fields' engaging_content: 'Fields are Drupal''s atomic data storage mechanism...' - unique_id: 2 creative_title: 'What is a view in Drupal? How do they work?' engaging_content: 'In Drupal, a view is a listing of information. It can a list of nodes, users, comments, taxonomy terms, files, etc...' ids: unique_id: type: integer process: title: creative_title body: engaging_content destination: plugin: 'entity:node' default_bundle: page
YAML is a key-value format with optional nesting of elements. They are very sensitive to white spaces and indentation. For example, they require at least one space character after the colon symbol (:) that separates the key from the value. Also, note that each level in the hierarchy is indented by two spaces exactly. A common source of errors when writing migrations is improper spacing or indentation of the YAML files.
A quick glimpse at the file reveals the three major parts: source, process, and destination. Other keys provide extra information about the migration. There are more keys that the ones shown above. For example, it is possible to define dependencies among migrations. Another option is to tag migrations so they can be executed together. We are going to learn more about these options in future entries.
Let’s review each key-value pair in the file. For id, it is customary to set its value to match the filename containing the migration definition, but without the .yml extension. This key serves as an internal identifier that Drupal and the Migrate API use to execute and keep track of the migration. The id value should be alphanumeric characters, optionally using underscores to separate words. As for the label key, it is a human readable string used to name the migration in various interfaces.
In this example we are using the embedded_data source plugin. It allows you to define the data to migrate right inside the definition file. To configure it, you define a data_rows key whose value is an array of all the elements you want to migrate. Each element might contain an arbitrary number of key-value pairs representing “columns” of data to be imported.
A common use case for the embedded_data plugin is testing of the Migrate API itself. Another valid one is to create default content when the data is known in advance. I often present introduction to Drupal workshops. To save time, I use this plugin to create nodes which are later used in the views creation explanation. Check this repository for an example of this. Note that it uses a different directory structure to define the migrations. That will be explained in future blog posts.
For the destination we are using the entity:node plugin which allows you to create nodes of any content type. The default_bundle key indicates that all nodes to be created will be of type “Basic page”, by default. It is important to note that the value of the default_bundle key is the machine name of the content type. You can find it at /admin/structure/types/manage/page In general, the Migrate API uses machine names for the values. As we explore the system, we will point out when they are used and where to find the right ones.
In the process section you map columns from the source to node properties and fields. The keys are entity property names or the field machine names. In this case, we are setting values for the title of the node and its body field. You can find the field machine names in the content type configuration page: /admin/structure/types/manage/page/fields. Values can be copied directly from the source or transformed via process plugins. This example makes a verbatim copy of the values from the source to the destination. The column names in the source are not required to match the destination property or field name. In this example they are purposely different to make them easier to identify.
You can download the example code from https://github.com/dinarcon/ud_migrations The example above is actually in a submodule in that repository. The same repository will be used for many examples throughout series. Download the whole repository into the ./modules/custom directory of the Drupal installation and enable the “UD First Migration” module.Running the migration
Let’s use Drush to run the migrations with the commands provided by Migrate Run. Open a terminal, switch directories to Drupal’s webroot, and execute the following commands.$ drush pm:enable -y migrate migrate_run ud_migrations_first $ drush migrate:status $ drush migrate:import udm_first
The first command enables the core migrate module, the runner, and the custom module holding the migration definition file. The second command shows a list of all migrations available in the system. Only one should be listed with the migration ID udm_first. The third command executes the migration. If all goes well, you can visit the content overview page at /admin/content and see two basic pages created. Congratulations, you have successfully run your first Drupal migration!!!
Or maybe not? Drupal migrations can fail in many ways and sometimes the error messages are not very descriptive. In upcoming blog posts we will talk about recommended workflows and strategies for debugging migrations. For now, let’s mention a couple of things that could go wrong with this example. If after running the drush migrate:status command you do not see the udm_first migration, make sure that the ud_migrations_first module is enabled. If it is enabled, and you do not see it, rebuild the cache by running drush cache:rebuild.
If you see the migration, but you get a yaml parse error when running the migrate:import command check your indentation. Copying and pasting from GitHub to your IDE/editor might change the spacing. An extraneous space can break the whole migration so pay close attention. If the command reports that it created the nodes, but you get a fatal error when trying to view one, it is because the content type was not set properly. Remember that the machine name of the “Basic page” content type is page, not basic_page. This error cannot be fixed from the administration interface. What you have to do is rollback the migration issuing the following command: drush migrate:rollback udm_first, then fix the default_bundle value, rebuild the cache, and import again.
Note: Migrate Tools could be used for running the migration. This module depends on Migrate Plus. For now, let’s keep module dependencies to a minimum to focus on core Migrate functionality. Also, skipping them demonstrates that these modules, although quite useful, are not hard requirements for running migration projects. If you decide to use Migrate Tools make sure to uninstall Migrate Run. Both provide the same Drush commands and conflict with each other if the two are enabled.
What did you learn in today’s blog post? Did you know that Migrate Plus and Migrate Tools are not hard requirements for Drupal migrations projects? Did you know you can place your YAML files in a migrations directory? What advice would you give to someone writing their first migration? Please share your answers in the comments. Also, I would be grateful if you shared this blog post with your friends and colleagues.
This blog post series, cross-posted at UnderstandDrupal.com as well as here on Agaric.coop, is made possible thanks to these generous sponsors. Contact Understand Drupal if your organization would like to support this documentation project, whether the migration series or other topics.
The web is constantly growing, evolving and—thankfully—growing more accessible and inclusive.
It is becoming expected that a user can interact with a website solely via keyboard or have the option to browse in their native language. There are many ways to serve the needs of non-native-language users, but one of the more robust is Drupal Multilingual.
Unlike 3rd party translation plugins like Google Translate or browser translation tools, Drupal's suite of core Multilingual tools allows you to write accurate and accessible translated content in the same manner as you write in your default language content. With no limit on the number languages, settings for right-to-left content, and the ability to translate any and all of your content, Drupal 8 can create a true multi-language experience like never before.
There is, however, a bit of planning and work involved.
Hopefully, this blog series will help smooth the path to truly inclusive content by highlighting some project management, design, site building, and development gotchas, as well as providing some tips and tricks to make the multilingual experience better for everyone. Part one will help you decide if you need multilingual as well as provide some tips on how to plan and budget for it.
This module provide additional functionality to the admin user or management for accessing fields based on domain.
The main functionality of this module to provide an admin interface from which we have to set particular fields based on the active domain for editing and / or adding node content.
You must have the Domain Access module enabled to use this module. This has only been tested against the latest Domain Access module, version, 7.x-3.16.
This is an image field formatter, which inherited settings from the build-in default image field formatter in the Drupal core, acts the same as the built-in one, but if the image does not exist, display an avatar letter generated instead. The letter depends on the account's display name.Dependencies
https://github.com/laravolt/avatar, install it by composer