Articles
Entities
Custom node routes
Sometimes it can be handy to have extra pages for a node (or any entity). For example:Read article →Rendering fields in Drupal 9 (the right way)
Many of us at ComputerMinds have always taken pride on doing Drupally things the right way whenever possible, and then helping the community do so too. One of these things is displaying values from fields on content entities. We wrote before about how to do this in Drupal 7 and…Read article →Rendering Drupal fields (the right way)
Once upon a time, we wrote an article about how to render fields on their own in Drupal 7, which was really handy because Drupal 7 wasn't always intuitive. It's common to want to display a field outside of the context of its main entity page, like showing author information in…Read article →Get the entity for a route
In Drupal 7, we had menu_get_object() to get the object in code for whichever node, term, or whatever entity makes up the current page. But in Drupal 8, that has been replaced, and entities can usually be operated on in a generic way. If you know the type of entity you want,…Read article →Loading config programmatically
In Drupal 8, there are many ways to interact with configuration from PHP. Most will allow you to write the config values, but some are read-only. Some will include 'overrides' from settings.php, or translations. There are many layers of abstraction, that each have different…Read article →Language lessons: What are you translating?
It seems an obvious question to ask, but what are you translating?Read article →Place blocks inside your content with EBA
Previously on this website I have written about rendering blocks programmatically and adding things to content to be managed alongside fields. It's time to combine the two! On many projects, we find ourselves needing to render a block consistently across all content of a…Read article →You should use Entity cache
If you have a Drupal 7 site, then you should be using the Entity cache module, here's why:Read article →Add stuff to a node and configure it like fields
UPDATE: The Extra Field and Extra Field Settings Provider modules facilitate doing this sort of thing in Drupal 8. Read on for older Drupal sites, and for the concepts behind this.Read article →Rendering Drupal 7 fields (the right way)
(We have a Drupal 8 version of this article now too!)Read article →Let's talk
Got a project in mind?
You'll talk to a developer, not a salesperson.