developer resources
Codebales holds an ever growing number of solutions to problems that we have experienced in our day to day code writing
Selected filter
23
results
Andrew Fletcher
•
The issue – I have a content type that includes an entity reference revisions field named field_introduction. This field points to a paragraph, which itself contains a text field also named field_introduction, of the type Text (formatted, long). How can I access the content stored in this paragraph's field_introduction field?
In Drupal, managing content structured through fields and entities allows for flexible and dynamic content architectures. One common scenario involves accessing data from a...
Andrew Fletcher
•
When executing the following command, the response I'm getting is
npm ERR! code...
Andrew Fletcher
•
In Twig, the {% extends %} tag is used to inherit and extend the contents of...
Andrew Fletcher
•
As you're using Bootstrap 5 and applying a style for the hover state of an...
Andrew Fletcher
•
In Drupal Twig templates, you can set a variable like paragraph_parent to the...
Andrew Fletcher
•
Update Drupal to 10.1.x and I'm receiving the following error
Twig\Error\SyntaxError: Unexpected "spaceless" tag (expecting closing tag for the "macro" tag defined near line 2). in Twig\Parser->subparse() (line 2 of themes/custom/{theme}/templates/misc/filesize-macro.html.twig).The error message clearly indicates that there's a problem in the Twig template file at line 2. Specifically, there is an "Unexpected 'spaceless' tag" and it's expecting a closing tag for the "macro" tag that was...
Andrew Fletcher
•
Twig error
Twig\Error\SyntaxError: Unknown "filter" tag. in...
Andrew Fletcher
•
This guide has been compiled as a reference tool on how to access field values...
Andrew Fletcher
•
This article works through the steps to update dependencies in package.json...
Andrew Fletcher
•
Do you want to know how to add a node alias in a twig file? Rather than do...
Andrew Fletcher
•
Having access to a site’s URL in your templates can come in handy for many different use cases, such as determining if your on the admin/people page as apposed to admin/reports/dblog or admin/content. These three pages might seem to bear on common relationship, however there is at least one. Users.
I edited the user in the admin/people page so rather than showing just username, know shows:
Firstname
Lastname
Email
Username
However, in making this change I discovered that when on...
Andrew Fletcher
•
I want to create a content type that has a paragraph. Easy enough.
What...
Andrew Fletcher
•
Since upgrading to Drupal 9.3.0 have you come across this error?
Edit...
Andrew Fletcher
•
When you have an entity ID value such as node ID (nid) or taxonomy term ID, how...
Andrew Fletcher
•
Working in Twig, I had to add classes to a pre-existing array. Whilst I've...