All of a sudden, on a commit which had nothing to do with drush as far as I can tell, drush stopped working on platform.sh. I got an error like this:
Sometimes, you've got a Drupal twig function that doesn't exist in PatternLab, and it prevents PatternLab from building.
You get this error:
Views has a setting to exclude the current nid from the URL from the listing one is currently viewing. This is essential when you have, say, a list of related nodes that are are defined by a category that includes the current node. If you don't exclude the current node, your current node will be listed in the "related content" block on itself. Well, obviously one is related to oneself, one thinks.
First, I tired to accomplish this through the UI with these steps, below.
So, your debug output isn't working.
You checked to make sure you followed all the steps here.
But still... no theme debug output. WTF?
Try turning on and off twig caching. For me, it seemed something was stuck or whatever. First turn it on:
Image style tokens don't show up in the media browser, and so you sort of have to guess at how to use them. I figured it out by studying the merged commit that added the functionality.
Pluralizing and singularizing words got very easy with the inclusion of the Doctrine Inflector class in Drupal 8 core.
The task at hand here is to allow the client to create a classed wrapper around multiple elements using CKEditor in Drupal 8.
The fundamental problem here is the CKEditor's built in "Styles" dropdown classes each
<p> individually, while we need a class wrapping them.
You could probably make or install your own CKEditor plugin, but that's not what I did.
You never know when you're going to encounter data ravaged by clients, cast aside and mauled, an antelope passed by lions to jackals.
But fortunately, data is much easier to repair than a gaping wound.
Here's the SQL query I'd use to replace non-breaking spaces with regular spaces. You'll need to replace it with whatever your search term is:
Here's the controlling issue for adding timezone support to Drupal core. As of now, August 1st, 2017, it doesn't appear to be ready.
Instead, I just added a timezone field to the node using the Timezone module, then appended it to the date range on field preprocess.
This won't work for you if you have multiple dates on an entity with different timezones (you might want to try the patch linked above), but it will fit most use cases.
Over the last several days, I've railed in my head against the matroshka structure of Drupal entities. But when I tried to break out some helper functions, and when I realized what each of the different properties each entity had, I realized the complexities of entities were warranted. Life is complex, and thus Drupal is complex.
Entity references load a Media Entity, which load an Image from an image field, which load a File. The alt and title are on the Image, while the file URI is on the file.
This is pretty simple, but it took me a minute, because I kept trying to use the base
Entity class, like an angry baby trying to remove a clenched fist from a bottle.
This function gets all the Media ID's from the database whose names begins with a specific string. I'm using this for an array of default images.
It can take a minute to figure out what method to use to get the file URL from the file URI.
Here's what I did:
Zebras. (I just wanted to use my "z" illumination.)
In general, it's not necessary to add a timezone to both start and end dates. But if you modify the date format, that's exactly what will happen.
So how do we add the site timezone just to the end of the DateTimeRange?
Here's how I did this:
Another day learning Drupal 8, but today is troubling.
Here's where I'm at. I'm theming search results, and I need to load field values to pass to twig templates—specifically a styled url for img
Entities values are not loaded on search results, only little snippets, so I have to load them the hard way, because we want images and nice theming on our search results.