You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Drupal 8 || 9 - Getting Taxonomy Terms from different levels programmatically
Introduction
In this snippet I've gathered some examples and cases about how to get taxonomy terms programmatically in Drupal, using always the same method and the same mechanics: get terms and then processing it in order to get only the required under certain criteria.
BASH Aliases commands for a Linux (Debian / Ubuntu) environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Github CLI is a console tool for working on interactions with Github from terminal. This tool allow to add new extension by developing them and adding to the main gh prompt as sub-commands from your command line. Read More about how to implement custom Github CLI extensions.
For this example we use a private extension not available for public purposes but you can explore some others existing Github CLI extensions. See the list of available extensions at https://github.com/topics/gh-extension.
In order to follow the next steps just change [RESOURCE] by your marked extension.
Drupal 8 || 9 - Composing directions for files from GraphQL using Data Producers in Fields Resolvers
Use Case
Well, I have a Content Type "basic page" (a classic) and inside I can use Layout Builder to put in some custom blocks with fields. For this case I need to reach values from a certain block "FactBox" and some of its fields: title, subtitle, body...you know. But I have to get values from an entity reference field too. I have a media field for uploading documents "listOfDocuments" (name of type: MediaPdf), and I need to send to the frontend layer name of the file, url, the internal uri... How can I get the values? this is the use case here.
The Query I'd like to resolve
As you can see, I'm trying to reach values from fields: uri, url, name of a media entity MediaPdf in a field ListOfDocuments included on a block called MyCustomBlock which is present in the main zone of Layout Regions inside a Content Type Page and we're testing the query against a specific node with url /basic-page. Along the way, I will take advantage and get other field values included in the custom blo