Questions tagged [nodes]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
18 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
19 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 ...
-2
votes
0answers
31 views

When I deleted content type fields

When I tried to delete a field in a content type, I got this error. Now I am confused that whether my content type's field is deleted or not. I have to delete a few more fields. If anyone can make me ...
1
vote
1answer
23 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['...
-2
votes
0answers
17 views

Body of text disappears in "edit" mode

Suddenly stopped being able to see the body of text in "edit" mode. Still visible in "view" mode. Please help, this is for a federal client and must be resolved as soon as possible
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
26 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
43 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
29 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
27 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
40 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
34 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
39 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
33 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
30 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 ...
3
votes
1answer
60 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
30 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
30 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
36 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
45 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....
0
votes
0answers
32 views

How to inject/append child element to a radios element and give it an AJAX callback?

How can I add independent child element to a radios element in a form? The radio elements are created by the following code. $form['orderinfo']['billshipaddresses']['billingaddresses'] = [ '#type' =&...
-4
votes
1answer
46 views

The website encountered an unexpected error. Please try again later. as shown in body [closed]

I tried to set up my drupal 8 full project on localhost but after set up when I run project getting error as shown below:- The website encountered an unexpected error. Please try again later. Drupal\...
1
vote
1answer
36 views

How to differentiate two different node creation/edit pages

I have 2 views, each one with a type of node (Products and Users). I want to add a unique class in each node create/edit pages, but i can't find any difference between the two, the only way i found is ...
-1
votes
1answer
54 views

Show two content types in same view

Drupal 8 newb here, I have two basic types I need to show in my front page: There’s a “Restaurants” content type and a “Chefs” content type. These are shown in my site like this: The types are ...
0
votes
0answers
21 views

How can I use the time.html.twig template for the node "created" field?

When a view shows a date from a newly created field, it uses the time.html.twig template. When it shows the node created field, it just prints a string surrounded by <span> tags. I'm guessing I ...
0
votes
0answers
21 views

Getting the version history of a node

Is there a way to get the versions history of a node using REST or JSON API? I would like to be able to view all version IDs of a node in JSON format.
0
votes
1answer
57 views

Within a node template how can I tell what regions are in use/ occupied?

I am trying to create a preprocess function in my .theme file in order to make a variable available to node templates. I want the variable to contain just the names of all regions that are currently ...
1
vote
0answers
13 views

Custom display in saved Entity reference in Widget field

We have an entity reference field widget. Based on a view where you can enter the code of a product to get to the product reference. The widget shows the 2 fields (code) - (Title) when we type in the ...
1
vote
0answers
25 views

Creating default content on site install with related entities

We use the Default Content module to install default content on each new site of our multi-site Drupal platform. Version 2 changed to only use UUID of the content you are exporting (done from the ...
2
votes
0answers
156 views

Missing bundle for entity type node after upgrading

I recently upgraded a local sandbox to Drupal core 9.2.4. While testing things out, I got an error when trying to add a new article content from /node/add/article. The log shows the following message. ...
0
votes
1answer
30 views

Custom Migration Plugin MySQL Error

I've run into the following error when running the command drush migrate-import custom_spotlight where custom_spotlight is the name of the plugin. I've been following along with this guide: https://...
-1
votes
1answer
31 views

drupal custom callback in node edit form is not firing

i am fairly new to drupal , i have custom button added to one the content type edit page , when i click on that button i want to call a function but it seems like it is not calling function when i ...
0
votes
0answers
27 views

How to get the field data

Hi i'm using entityreference, i hava an content type"test" that contain a field that refer to categorie and this categorie contain a field_theme also referenced to another content type ...
0
votes
1answer
17 views

How do I display a tour on a node?

On a Drupal 9 site, I installed the Tour and the Tour UI modules, and created a node. How can I configure the Tour UI to show a tour on that node? I don't know what to put in Module name and Routes.
1
vote
1answer
25 views

How can I make 3 different menus?

I need to do an Agenda in Drupal 7. The table for the events is more or less already done, but I would need to add 3 days on the top like: Day 1 - Day 2 - Day 3 Depending on which day is ...
0
votes
2answers
30 views

How can I use contextual filters to display a block with field values from a single related entity?

I've found various recipes/threads with the scenario where have a content type A node and want to display in a sidebar block, all the related content type B nodes, with the relationship based on an ...
0
votes
0answers
11 views

Display in f2 only terms related to selected term in f1

I have a site that consists of a few parts like: Cosmos, Hi-tech, Travel, Music. Each part has its own Categories. And I have made two Taxonomy vocabularies: Part of a site Categories (this has field ...
1
vote
1answer
50 views

Programmatically verify a taxonomy term has been added to a node

I'm currently checking the node type and status, using the following code. $query = \Drupal::entityQuery('node') ->condition('status', 1) ->condition('type', 'content_page') ->execute();...
1
vote
0answers
37 views

Edit a node in the settings tray?

I am looking at this page in the Drupal docs for the Settings Tray and wondering if this can be used to edit the current node you are looking at, similar to this image: Is there a way to edit all of ...
0
votes
1answer
19 views

Display Node Local Tasks Menu on View

I have a view that shows registrations for an Event (Content Type). This tab is shown in the /node/{node}/edit: This registrations tab refers to the view, which I have inserted in the routing.yml: ...
1
vote
1answer
81 views

Add a hero image and text when a node goes from unpublished to published

I'm trying to add a hero image and text when a node goes from unpublished to published. The things include: Add an image from my media library to a media field on the node Add a page title to the ...
0
votes
1answer
56 views

How to add a secondary Ajax submit to a regular node form?

I'm trying to add an Ajax submit to a regular node edit form (Drupal 9). I'm using Field Groups so that there's a series of tabs, and I've added a pair of "buttons" (Right now they're just ...
0
votes
0answers
22 views

Get the breadcrumb inside my node template [duplicate]

How can I move my breadcrumb from my page.html.twig into my node--content-type.html.twig ? In my page template, I display the breadcrumb like this : <div id="main-wrapper" class="...
0
votes
1answer
62 views

Get path (alias) from SQL query

I have a SQL query to get all nodes with their ID, title, publish date, change date, etc. Additionally I need to get path to each of them (probably from path_alias.alias). Now I have following (...
1
vote
1answer
142 views

Programmatically publish unpublished nodes

I want to publish unpublished nodes in a custom action. To do this, I query the database on a specific condition and want to use 'exists' condition to find the node IDs to publish. This is the code I ...
-1
votes
1answer
29 views

Set "select" field on a node programatically

I am creating nodes programmatically on a specific content type. The content type has a "select field" that I am trying to set value with and cannot do it. Below is my code: $node = \Drupal:...
-3
votes
2answers
47 views

Display all the nodes from a specific content type on the front page

I have a custom content type (news). I want to show all those nodes on the front page. How can I achieve this?
0
votes
1answer
39 views

Can't add an image extension to the field_image of the Article content type

I need to upload an image with the webp extension and add it as the main image of a content item with the "Article" content type. Since its field_image doesn't have the webp extension by ...

1
2 3 4 5
149