Questions tagged [nodes]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

Can't update nodes / node unpublishes itself

This problem has been bugging me for some time now and I haven't been able to find this issue online anywhere else. My Drupal 7 website has a very simple photo gallery, using a custom node type called ...
-2
votes
1answer
27 views

Dynamic node field based on terms in a vocabulary

I'm hoping there is a module for this, but happy to get dirty in code if need be: I have a vocabulary "Currency" which has "USD", "HKD", "GBP" as terms. On my ...
0
votes
1answer
20 views

hook_node_access() doesn't work for anonymous users

I am new to Drupal 7, I am still unable to understand hook_node_access operation I am trying to give view access to the basic content types nodes for anonymous users but it is not working. It is still ...
-1
votes
1answer
22 views

Email verification field for content types

I have a content type with email field. I will like users to verify the email field when they create content. I don't see a Drupal 8 module to do this. Is there an easy programmatic way to achieve ...
0
votes
0answers
13 views

Master view with master node and micro node

I use micro modules to manage a multisite for a french university. I want to create a view for the master site, which contains all master nodes and nodes from micro-sites tagged with "promote in ...
0
votes
0answers
18 views

Content moderation “current revision” not set on nodes migrated from Drupal 7 where there are both a published and draft revisions

I am working on upgrading a Drupal 7 site to Drupal 8. The upgrade uses a content-only custom migration. The Drupal 7 source site and the Drupal 8 destination do not contain any custom modules other ...
0
votes
0answers
16 views

Automate notification to Mailchimp

I am trying to automate a notification integration between Drupal8 and Mailchimp. I currently the Mailchimp module installed and a signup form has been configured so that people can signup for ...
0
votes
2answers
30 views

Map array of node IDs to bundle types without loading all the nodes

For complicated reasons I need to map an array of node IDs to a list of node bundles. That is, for a given list of node IDs, I need to get all the different bundles (node types) of the nodes the IDs ...
0
votes
0answers
13 views

The admin/content page only shows the Delete button for nodes; missing edit and view

I have created a role in D8 with permissions to add/edit/delete any content type, even if its not their own. They also have the blanket "Administer Content" permission. When they view a node,...
0
votes
0answers
13 views

How to update value of single field of same node using node_save?

The problem statement: I have one content type called 'Employee' which has 10 nodes. I have to perform the voting for each node. I am saving the vote count in the field called 'vote count'. But when ...
-2
votes
0answers
22 views

What is the order of execution of node related hooks?

What is the order of execution of node related hooks in Drupal? For example, if I load the node page, preprocess and HTML preprocess hooks are getting executed. What's the sequence of execution?
-2
votes
0answers
17 views

Change taxonomy term of node through comments

I have a node with status. Status is a taxonomy with states - open and closed. I need to change the status of this node to "CLOSED" using the drop-down menu and submit on the comment. How do ...
0
votes
0answers
25 views

Why do I see the node ID on the menu URL instead of the path alias?

I created different menus and need them to be displayed in a node based on the language currently visited for a specific node type. Via my theme.theme, I added the following code to retrieve the menus:...
0
votes
1answer
22 views

Editable table column data

In drupal 8, I am writing a custom module and in one of the function in controller -I am fetching data from an external API, then displaying it in table format using - foreach($rec as $data) { ...
-1
votes
0answers
53 views

How do I get all articles from the database? [duplicate]

i am new on Drupal 8 ,in my case i want to get all articles from database filtered by name i have done dome code but it doesn't work for me can anyone help me please ? public function getArticles(){ ...
0
votes
0answers
17 views

Moving nodes and menus between environments

I've a large menu of basic pages I'm trying to move from my D7 development environment into production. So far I've been trying to use the Node Export module to build a feature. That didn't seem to ...
0
votes
0answers
13 views

How do I show the video preset options when uploading video files in the node edit form?

I am using the Video module with FFmpeg. How do I show the video preset options when uploading video files in the node edit form? Is this possible?
0
votes
0answers
27 views

What’s the right way to create a Webform node when adding a webform?

I am new to Drupal. I want to create a Webform node when adding a webform. I used the code snippet in https://www.drupal.org/docs/8/modules/webform/webform-cookbook/how-to-automatically-create-a-...
0
votes
2answers
48 views

Load the node as EntityInterface not NodeInterface

hook_node_insert(NodeInterface $node) gets a NodeInterface parameter. I need to pass it to mymodule_node_operations(EntityInterface $entity) which accepts an EntityInterface parameter. How do I load ...
0
votes
0answers
12 views

Display video transcode PRESET options in Node Edit form

I need to be able to expose the video transcoding preset options within Node Edit pages. Currently, the Video module allows me to choose/change the Presets site-wide in Video modules settings page ...
0
votes
1answer
25 views

Altering (adding) field value when is unknown

I have three content types (A,B,C). A and B have title, author, and field_version (a custom field), while C doesn't have field_version. Let's assume I have a method that gets the version value from a ...
0
votes
1answer
33 views

How can I hide fields by user role when viewing a node?

I have managed to hide certain fields for certain roles programmatically in Drupal 8 using function module_name_form_node_form_alter(array &$form, FormStateInterface &$form_state, $form_id). ...
0
votes
1answer
36 views

Inline entity form module fails when creating a new node and the reference method is Views

I have a Drupal 8, core version:8.8.x project, i'm using inline entity form module(latest version) for entity reference fields. Also i have tried using entity connect module but it caused various ...
0
votes
2answers
45 views

Get path alias of node on presave

I was trying to get the path alias using for nodes using the following code. \Drupal::service('path.alias_manager')->getAliasByPath('/node/' . $nid); It works for nodes that are already created, ...
0
votes
0answers
15 views

Can a published node have a later unpublished revision?

I haven't used Drupal for a while and I'm wondering whether this has been fixed recently or whether I'm mis-remembering. I believe that if revision X of a node is published, it wasn't possible to ...
0
votes
2answers
37 views

Why does node_access_view_all_nodes() return true for anonymous users?

On a Vanilla Drupal install (tested on D8 and D9), this will print "1": drush eval 'echo node_access_view_all_nodes() . PHP_EOL;' Stepping through the code reveals that it happens because there is a ...
1
vote
1answer
21 views

separate the page title from page content

I am using {{ page.content }} to print all my page content. It is printing my all content but I want to remove title from this content and print it separately in different div structure (without using ...
1
vote
0answers
29 views

How can I merge nodes from two sources into one render array?

So I've got a bit of a unique situation and I'm curious if anyone has any input. Summary:  I'm trying to figure out how to render 3 nodes from two different sources: 1st Source: A field of type ...
0
votes
0answers
22 views

Grouping doesn't work with content type title

I am using Drupal 8. I have a "Unit" content type and "Unit Word" paragraph. I have created the "My Vocabulary" view that shows the "Unit Word" paragraph. Now I need to group records with the "Unit" ...
2
votes
1answer
51 views

How can I track how embedded media is used across my site?

My site uses the core Media module, Entity Embed, and LinkIt to reference media and other entities in various ways. I want to keep track of which media is embedded on which nodes. I tried adding an ...
-2
votes
1answer
48 views

Creating content with a hierarchy

I want to create hierarchical content in Drupal, and I am trying to decide between nodes and terms. What I want to do I want to implement books. Each piece of content may be a book (containing ...
1
vote
3answers
72 views

For content, what are the differences between nodes and terms

I am debating whether to use nodes or terms to store a large amount of content in Drupal. There are a lot of similarities between nodes and terms in Drupal 8/9: Both can add any type of field. Both ...
1
vote
1answer
27 views

Add a “Save” action in local task to a node

I would like to add a new action to local task on node. This new action has to save the current node. I have drupal 8.8.0 I know how to add a new action. But my question is about how to save the ...
0
votes
1answer
18 views

how do I get the parent node of an entity reference node

I have two content types - A and B. For content type A, there are 5 content items - Aa, Ab, Ac, Ad, Ae. For content type B, I have two items Ba, Bb. Content type B has a field that is an entity ...
0
votes
0answers
8 views

Schedule a current state of a content to be publish is not working

I'm having some issues with drupal/core 8.7.7, when i crate a new content or use a content already published , i want to schedule that content to be changed from one state to another. ex: But when i ...
0
votes
0answers
18 views

Disallow of Node Creation with code if Duplicate title found

I am creating nodes programmatically in Drupal8 by my custom module. User upload the CSV file and nodes will be created according to the uploaded file. Node title will be set according to the'title' ...
1
vote
1answer
69 views

Allow comments only for the author of the node

I'm using Drupal 8 for a personal project and I'd like to allow only the node author to post comments. Can you please help? I'm stuck.
1
vote
2answers
39 views

Permission to submit webform only for the author of the node

I'm using webform 8.x for a personal project and I'd like to know if it possible to enable only the author of the node to submit the form. In my project each node is an aquarium, and I am using ...
0
votes
0answers
10 views

Custom content types - forum container field and auto-create forum containers?

I'm creating a custom content type and I want to add a field that references a forum container. Is this possible? Is it also possible to automatically create a forum container when an instance of a ...
0
votes
1answer
23 views

Read time value of node in view

I am using Read time module for calculating the read time for each node. Value is getting inserted in the database table correctly. But I didn't get an idea about how can I get this value in view. ...
1
vote
0answers
25 views

How do I set the path alias for nodes imported via RSS feed?

In Drupal 8, I have created nodes of article type using the Feeds module, using a RSS feed as source. How can I create path aliases for each of the imported nodes? I have tried to map source:'item ...
1
vote
0answers
58 views

Show node form on preview page

Is it possible to show node edit form on preview page without need to click on "back to content editing"? If yes, how? Why? I'm migrating a website from older Drupal version and "my" users are used ...
1
vote
1answer
40 views

How do I create content during site installation?

As part of Drupal 8 site install/deploy, I want to create content so that the site is functional and ready to use. For example, whenever I install the site, there should be a home page node created. ...
0
votes
0answers
26 views

Field permission for content type

I need to manage different fields for different roles in a content type. If users enter a value for that field, administrator users can see it but not edit that field; on the same content type, when ...
0
votes
0answers
42 views

I have large gaps in NIDs on my site. Should I clean it up?

So, since I have a little extra time on my hands I’m doing some delayed maintenance on my personal site. You know, removing modules I don’t need anymore, cleaning up taxonomy, etc, etc. There is ...
1
vote
2answers
34 views

How can I hide nodes from view, but open access to JSON:API at the same time?

I would like to use Drupal as a decoupled system, sourcing its content by using Gatsby. Having set it all up, I would like my Drupal nodes not to be accessed by random unauthenticated users so I ...
0
votes
1answer
18 views

Load node by value of a field and update value for another field

I'm trying to load a node by a value in a custom field (field_one) to change the value of another custom field (field_two) on that node. I am using the following code to load the node: $nodes = \...
0
votes
1answer
39 views

Loop through a multi value entity reference field working only on the first selected item

1) I have an entity reference view articles_per_user listing all nodes of type article authored by the current logged in user. 2) On the Article Entity, there is a taxonomy reference field ...
0
votes
1answer
37 views

How to get current language of node in twig?

I have a tranlatable node, and I need to get its translation language. You know, I must to know is current node is in Polish or English. So... below there are my devel dumps from a node in Polish and ...
0
votes
1answer
47 views

How can I programmatically restrict node access?

I'm using Drupal 8 with the nodeaccess module. I'm able to set the node grants with the form. I also have a custom module which imports new nodes. These new nodes should be shown only to certain ...

1
2 3 4 5
146