Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 5147

Nodes, comments, taxonomy terms, and users, in the terminology used since Drupal 7, are generally called "entities."

2 votes
0 answers
24 views

Do fields that are not displayed affect rendering performance?

This is a general question about how Drupal renders content. Say I have a content type with 20 fields, including some entity references, text fields, integers, and so on. When I have a lot of fields …
Patrick Kenny's user avatar
6 votes
Accepted

How to run PHP code only once on node creation?

If you want to run code just once when a node is created, the Rules module may be a better choice. Using Rules, you can do the following: Create a new rule that acts on the event "After saving new …
Patrick Kenny's user avatar
2 votes

How can I display the value of an addressfield in a single line?

This can also be done with the Location Taxonomize module. Enable Location Taxonomize and create a taxonomy term reference as described in the module's README. Then, in Views, display this term refe …
Patrick Kenny's user avatar
1 vote

Encapsulate fields in div

Another way to do this is to use the Field Group module. This allows you to add a "group" of fields from the Manage fields screen in the same way that you add fields. By choosing "Fieldset" as the t …
Patrick Kenny's user avatar
7 votes

Need to add a condition between two fields in a view

This can be accomplished through the Form API. However, if you are a PHP novice, you would probably be better off using the Conditional Fields module. Although this is still in dev (no official rele …
Patrick Kenny's user avatar
1 vote

Use math in the fields

You could use the Computed Field module, which allows you to write custom PHP functions to determine field values. You will of course need to be familiar with PHP.
Patrick Kenny's user avatar
2 votes

How to Sum up 2 fields of integer, and present as "Time period"?

One way to do this is the Computed Field module, which will allow you to use PHP to perform calculations. To use this, you could add a field, Total time, of type Computed Field. Then you could write …
Patrick Kenny's user avatar
0 votes
1 answer
49 views

How do I delete all the relations on my site?

I want to remove all the relations (created with the Relation module) on my site because I have replaced them with an entityreference field. At /admin/structure/relation, I can delete the Relation Ty …
Patrick Kenny's user avatar
0 votes
1 answer
276 views

How do I unset an entity reference using JSON:API?

I can't figure out how to unset an entity reference (remove a reference to a term from a node) when editing content via JSON:API. JSON to create a new node: const myNodeToPost = { data: { …
Patrick Kenny's user avatar
1 vote
Accepted

How do I unset an entity reference using JSON:API?

Thanks to franck_lorancy on drupal.org, I managed to fix this and it is now part of the documentation for PATCH: { "data": { "type": "node--article", "id": "{{article_uuid}}", "attribute …
Patrick Kenny's user avatar
0 votes

How to achieve this? (because I think it's not possible to reference a vocabulary)

To track inventory, take a look at how Drupal Commerce does it. The Commerce setup may be a little more complex than you need, but it is quite flexible and well supported. If you choose this approach …
Patrick Kenny's user avatar
2 votes

What problem does the entity reference module solve?

What is important here is that entity reference allows you to separate concerns-- for example, you can make articles as node entities, and tags as taxonomy term entities-- instead of trying to smash everything … You can create specialized entities to accurately model each kind of data you have, and then link those together logically with entity references. …
Patrick Kenny's user avatar
1 vote

What problem does the entity reference module solve?

In Drupal Commerce, you have entities for lots of things, like Stores (you can have multiple stores or a single store) Products Orders Payment methods All of these are separate entity types because a …
Patrick Kenny's user avatar
2 votes

Custom entityquery sorting

Entity query only has pretty basic sort available. You could write a more complicated query such as a SELECT query. However, given that you want to reuse this in Views, and given that you probably hav …
Patrick Kenny's user avatar
2 votes
1 answer
394 views

How can I force a field to be required if another field has a certain value?

I have two fields, a select list of checkboxes and a taxonomy term reference. I would like the taxonomy term reference to be optional unless one of the checkboxes has a certain value, in which case a …
Patrick Kenny's user avatar

1
2 3 4 5
9
15 30 50 per page