Questions tagged [nodes]

The most basic form of content on a Drupal site is a node.

Filter by
Sorted by
Tagged with
2
votes
1answer
16 views

$group->addContent() in hook_node_insert() doesn't update the access permissions for the node

I have a content type with a field that lets the users decide which group to add the content to. The content is added to the group via hook_node_insert(). function tm_wiki_node_insert(NodeInterface $...
0
votes
1answer
23 views

The values returned from hook_node_access_records() aren't considered to allow access

I am implementing a solution in Drupal 9 where users are allowed to see only the nodes that belongs to their same group. If a node doesn't belong to any group, t hey should be able to see it. I've ...
0
votes
0answers
7 views

How to publish latest revision langcode programmatically in each translation

My workflow is draft, publish and archived. My translations are 'en(default)', 'fr', and 'de'. My clients create a lot of nodes in draft status for their release. We must release these latest ...
-1
votes
0answers
46 views

How to put MediaWiki inside Drupal? [closed]

I seek to integrate MediaWiki with Drupal. Data about this is lacking or probably outdated: https://www.drupal.org/project/mediawiki Integration with Mediawiki sites How to integrate MediaWiki to ...
1
vote
1answer
20 views

Existing pages not editable for admin with all permissions

You know the drill. User of various CMSs but new to Drupal and inherited a site running version 8.6.10. New pages (nodes?) can be created but once something is created, nothing on/under the Edit tab ...
1
vote
0answers
19 views

JSONAPI : Patch node path alias [closed]

I have content on a Drupal site and I want to patch to change their path alias. Here is how I do. It is giving me a 400 error: Syntax Error. I don't see where the syntax is bad. I am using Python 3 ...
0
votes
0answers
17 views

I'm writing a node migration (D7 to D9) module but only the title gets migrated

How can I get the body migrated as well? When I compared this with other working migrations, there didn't seem to be any differences in the code/anything wrong with mine. I also looked for alternative ...
0
votes
0answers
30 views

Node coloring by taxonomy

My site has a node and a "tags" taxonomy that contain the color field. One node can have multiple tags, but I need to select one main tag. The color from the main tag must be passed to the ...
-2
votes
0answers
28 views

How to get node with all its fields and join references and Serialize it

System: Drupal 8 Can you point me how to fetch all fields of a node? It is better to use \Drupal::entityQuery('node') or \Drupal::service('entity_type.manager')->getStorage('node')? I tried like ...
2
votes
1answer
129 views

Why does Programmatic Node Unpublish not Work?

We recently upgraded to Drupal 9.3.0 using a Composer file layout. The resulting website is working correctly and is now running in the publish domain. We have a set of utilities that we run as ...
0
votes
0answers
4 views

Non-translatable fields can only be changed when updating the current revision

I can't save the translation content and this error message is displayed after hitting the save as draft: Non-translatable fields can only be changed when updating the current revision. Here's the ...
1
vote
1answer
21 views

Error when trying to view revisions

Using Drupal 8/9. When trying to view previous revisions I am getting the following error: Error: Call to a member function getType() on string in clc_d8_theme_theme_suggestions_page_alter() (line 13 ...
1
vote
2answers
31 views

How to apply nofollow and target_blank on external links in text created with CKEditor?

When I create a node, I often need to add links to external websites in the text. I want all the external links to open in a new tab and I want them to have a nofollow. The body field uses CKEditor. ...
0
votes
2answers
35 views

How do I move a node's tags to be near its author information in my Bartik subtheme

I want to style a node's author data and tags slightly differently to the Bartik theme in Drupal 9.3. That is, rather than: Submitted by user1 on Mon, 1/1/70 Tags foo bar I'd like to have: ...
-2
votes
0answers
28 views

Condition in views

My task is to make a drupal 9 website for accounting books in the library of an educational institution. I have created three types of materials: book card (book) reader issue. When issuing a book ...
0
votes
0answers
24 views

grant access to reorder in admin

I have a Drupal with some kind of users (admin, gestion etc.) only admin can reorder field with multiple values when I editing nodes. Other user can't, the draggable picture not showed. Have you any ...
0
votes
0answers
43 views

Image fields that vary by theme

We are building a website that has multiple themes that can be applied to it, based on user selection. The page content type is made up of Paragraphs (from the paragraph module), each of which can ...
0
votes
1answer
24 views

Page Manager fails when accessing structure pages

When I go to Admin/Structure/Pages, the following error occurs: InvalidArgumentException: The internal path component 'https://dssm.vegas/civicrm/contribute/transact' is external. You are not allowed ...
3
votes
0answers
32 views

How to filter book pages by book with Views?

At the moment on Drupal 9.3 there is very poor integration between views and Book Module. how to create a view to show all the book pages with functionality to filter ( an exposed filter) them by ...
0
votes
0answers
97 views

How to display the nodes with the reference entity "Group type" of the same type as the current group?

I have a website built with Drupal 9 and I installed the Group module. I created a "Help" content type with an "Entity reference" field that refers to the group type. I have ...
0
votes
1answer
26 views

Content type field to include both media entities and links

I'm new to Drupal and I'm creating a new content type. I know there's two separate fields for media and links, but is there a field that include both? For example, the field is called "News ...
2
votes
0answers
34 views

What methods are available to resolve "The node.field_name field needs to be updated."?

When Drupal status report says field “field_name” needs to be updated I found out that it sometime hard to resolve. In the past we used to have entup but that was removed. The following works in many ...
5
votes
0answers
83 views

How does the Geolocation content of a page filter is a Views block?

I have a website with Drupal 9 and the Geolocation module : https://www.drupal.org/project/geolocation I created a content type with a Geolocation field that contains coordinates. My website uses the ...
0
votes
1answer
16 views

Node form ajax dependent dropdown fields issue

I am using Drupal 9. I know how to change single dropdown list using another one. Here is my scenario: I have three dropdowns, in node form - company, protocol and investigator. What I like to do, ...
0
votes
0answers
38 views

How to check the external links in the nodes?

I use on my Drupal 9 site, affiliate links for different products and services. These links will appear in my nodes. The problem is that sometimes the provider changes its content, so sometimes the ...
1
vote
1answer
34 views

Programmatically loading and saving nodes is not updating my field but editing and saving manually does. Why the difference?

I have migrated D7 date fields to D9 Smart Date (with recurring). During the migration, I've parsed the legacy repeat rules and populated them into the new D9 Smart Date field. However, the repeating ...
0
votes
1answer
29 views

How do I pass a node field value as view argument to another entity reference field?

The issue seems simple, but I can't get any documentation for it. I have a content type with two drop-down fields: field_company which lists taxonomy terms and field_protocol which is referencing a ...
3
votes
1answer
25 views

Derive all image styles when user uploading

I have several image styles defined but only thumbnail and medium styles(images) can be derived from the original image. I know those two styles are set in the "manage field" of image and my ...
0
votes
0answers
25 views

How to correctly add a slideshow to Content type using a module paragraphs?

I created a Content type - News. Then using modules View, Slick Carousel, Slick View I displayed my news in a block as a slideshow But now I need to add a slideshow to a paragraph and display it on ...
0
votes
1answer
91 views

How do I display nodes in a map block and in the page content, with shared filters?

I am using the Olivero theme on my Drupal 9 site and building a map with the Geolocation module. I want to create a Views to display these two displays of the same nodes : one display which is a map (...
1
vote
0answers
38 views

Setting latest revision has been delayed

We are (still) using Drupal 8, the latest version, as a CMS for content editing. Our platform is huge and it has 100+ editors who are constantly adding/editing content, and also 20 importers which are ...
0
votes
0answers
31 views

How to limit the addition of a single node in a Group?

On my Drupal 9 site and Group module. I created a type of group "Blog". I want that in a group, only one node of type "Article" can be added. How to limit the addition of a single ...
1
vote
1answer
35 views

Make Title field "not required" or workaround how to prefill and hide it (drupal 9.2.8)

On my site (drupal 9.2.8) users add content and there is no need to put any information to 'Title' field. I was trying to make this field not required via form_alter in custom module but it did not ...
0
votes
0answers
22 views

Provide menu link when creating node programmatically and append it to parent menu link

I am creating a Node programatically: Node::create([ 'title' => "Some name", 'type' => "people", 'body' => $params['body'], 'field_people_degree' => $params['...
0
votes
0answers
11 views

create views filter from sql

I've been trying to create a view that gets all nodes that are in moderated "draft" state as created by the group content moderation module. The current views content state filter will not ...
0
votes
0answers
28 views

Modify the allowed options for a list field programmatically

I want to add the titles of another existing type of nodes to a select list field from another content type. I tried to do it altering the form but it gives me an error because the values added are ...
0
votes
0answers
127 views

The "node" parameter was not converted for the path "/node/{node}"

I have the following error in the filters with parameters in view type pages. will there be any solution to this problem? Drupal\Core\ParamConverter\ParamNotConvertedException: The "node" ...
0
votes
1answer
31 views

SQL Error when trying to remove content type field

I was trying to create a new Content Type for my site and I chose a field name ("description") that already used for other content types. The problem occurred when saving changes as the ...
0
votes
0answers
33 views

Adding custom field generated by drush to available fields on node

I have an existing custom module on my D9 website and I need to make some changes inside it. I want to add a field (boolean) into any content type page edit without doing it manually. So I need my ...
-1
votes
1answer
48 views

How do I access the protected value of node entity?

I have a view node and I use the below code to Kint out the node objects: $node = \Drupal::entityTypeManager() ->getStorage('node') ->loadMultiple(); dpm($node); returns the below ...
0
votes
0answers
36 views

Is there a way to customize a ListBuilder for a specific node content type?

I'm having trouble with listing nodes and content types. There are many different content types in my drupal site, and all of them are listed inside "contents" page (/admin/content). I can ...
0
votes
0answers
41 views

Restrict access to specific node by role

I am working on a Drupal 9 project. I need to restrict access to the node with id 1083 for "delegate" user role. For this I have used hook_node_access_records() and hook_node_grants(): /** *...
0
votes
1answer
17 views

Is there a way to synchronize a webpage from another website into Drupal?

A restaurant has its menu database in Foodpanda. The owner wants that menu to appear in the website. We can manually duplicate all menu courses from FoodPanda to Drupal, upload the same images, etc. ...
0
votes
1answer
35 views

How do I programmatically set a content reference by name for a node?

Hi team i have some isssues. I'm creating a node and i would like to set a content reference by name not by id, i'm doing this but this is not working: 'field_content_type_items' is referenced to ...
1
vote
1answer
50 views

How to import a custom content type in phpunit

I'm trying to write some PHPUnit Kernel tests that use a custom content type which seem to work until I try to reference fields on the content type. I'm guessing the content type isn't being imported ...
4
votes
1answer
63 views

How to prevent a node from being deleted while performing a delete operation?

I want to prevent a node from being deleted while a delete operation is performed on it. For example in administration panel if user clicks "Delete" on the node, the node shouldn't be ...
0
votes
1answer
32 views

Auto create a feed when a node is added

I am looking for a way to automatically add a feed (of a specific feed type), whenever a node is added (for a specific content type) using the node fields to auto-create the feed. I have searched this ...
0
votes
0answers
32 views

Using Tac Lite in combination with Paragraphs

For our new Drupal 9 (or 8 if necc.) website we require a very fine controllable access structure where we can give and restrict access on a user by user basis. Not only for a content type but also ...
0
votes
1answer
43 views

Is there a way to render the title of every node from a single content type?

I have a page on a Drupal 9 site that will have a filter and a search bar. The filter needs to have each product and each region the product is sold in. So I created 2 content types - Product and ...
-1
votes
1answer
50 views

How do I suggest to use a template name like "node--[content-type-name]"?

I would like to name my node template after the content type title, but my suggestions only show the node number. FILE NAME SUGGESTIONS: html--node--1.html.twig html--node--%.html.twig html--node....

1
2 3 4 5
149