This website is composed of information connected through taxonomy. It is simultaneously a proof-of-concept and a means to allow Agaric to share and store information both within the collective and the world as part of our open documentation philosophy.

User login

This website is composed of information connected through taxonomy. It is simultaneously a proof-of-concept and a means to allow Agaric to share and store information both within the collective and the world as part of our open documentation philosophy.

Place a block in a Paragraph in Drupal 8

If you have a block that does something useful, or even has content in it that you'd like to reuse, and you are using Paragraphs on your site

The Drupal 8 port of Block reference has generated a lot of discussion.

The last comment at this time suggested that inclusion of the ability to Add a block plugin field formatter being in Plugin module should do it.

The saga of Drupal link-link

Are your builds failing because of this?

Easily add content with update hooks: use default content module exports to create content that needs to be in sync with configuration

An approach for keeping content that is added as part of development synchronized with test and production environments is to use the Default Content module to export the content. It's built for the content to be exported to an installation profile's 'content' folder, and then the module, if enabled, automatically brings the content in when the site is installed.

Getting a node (or other entity) and playing with it on the command line

Here's one way to get a node so that you can play with it on the command line and figure out what different methods actually do:

array_pop(\Drupal::service('entity_type.manager')->getStorage('node')->loadByProperties(['title' => 'Sample node']))

There's surely faster ways to do it with an ID, and maybe even better would be to use devel generate here. Anyway, this gives a node that can be messed with, like so, putting it all together:

Keeping Drupal's contextual links working even when the whole content item is linked offsite or triggering a lightbox

We have a site where one content type (publicity, for news items and awards) are listed, but the whole thing is wrapped in an anchor tag and linked to outside content. To prevent leaving the site before the contextual edit link is shown, i did this:

So if you think there's a crazy bug in permission to access text formats...

...it's probably because there is already content in the text area that is set to something to which the user no longer has access.

It seems really freaky when you have access to one text format, and it says:

"This field has been disabled because you do not have sufficient permissions to edit."

So you add another text format, and now you have access to the field... and the format it must have been saying you didn't have permissions for before, what???

Give custom blocks template suggestions by type and views blocks by view ID

<?php
/**
* Implements hook_theme_suggestions_HOOK_alter() for blocks.
*/
function kidneys_theme_suggestions_block_alter(array &$suggestions, array $variables) {

Argument 2 passed to hook help() must be an instance of RouteMatchInterface

I got this error message, that argument two passed to my module's implementation of hook_help() "must be an instance of RouteMatchInterface, instance of Drupal\Core\Routing\CurrentRouteMatch given", and it's a misleading one.

CurrentRouteMatch in fact (unsurprisingly) implements the RouteMatchInterface. The problem was i hadn't actually defined CurrentRouteMatch— i needed to have a use statement at the top of my module (or use the full PSR4 path in the parameter definition of the hook implementation, but i went with the former). Like so: