Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [nodes]

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

0
votes
1answer
40 views

What is the basic concept behind revisons in term of performance? [on hold]

On a Drupal 8 project, I am planning to allow revisions to be created for one "content type" which consist of around 40 different fields ! Can someone explain the concept behind on how Drupal save ...
-1
votes
0answers
25 views

disable node url access [duplicate]

I have setup my pages in Drupal 8 and setup URL alias for all of my pages. I would like my users to only be able to access the page using the url alias and not the node/3 url. I have seen several ...
0
votes
0answers
22 views

Why is node content is not showing edited value?

In Drupal 7, I changed the value of body field with a new value but after saving the node when the field content is showing in a page, the value was the old one. I have tried cache_clear_all('field:...
1
vote
1answer
34 views

Get form values into hook_node_insert / hook_node_update

I need to get in hook_node_insert and hook_node_update the value of a field I manually added to a form. function hook_form_FORMID_alter(&$form, FormStateInterface $formState, $form_id) { $...
0
votes
0answers
15 views

How do I add moderation state in a computed field?

I have a D8 content type with content moderation (draft,published, in-progress). I created a computed text field (my_computed_field) and want to add the current moderation state in the field.
-2
votes
1answer
24 views

Memory exhausted during csv upload?

I am uploading a csv and creating custom nodes. I have set the drupal memory limit to 512M and I can see this in the drupal status report. But when I am uploading a csv file, I am getting the error ...
0
votes
0answers
55 views

How to export images [closed]

What I try to do is to transfer some nodes from a d8 site to another d8 site. I tried the node export module though is still in development. My problem is that I can't pass the images from image ...
1
vote
1answer
29 views

Set entity reference revision field value?

How do I set entity reference revision value for a field? I have two fields, field_test_entity_reference and field_test_entity_revision. field_test_entity_reference is of field type entity reference ...
-2
votes
2answers
34 views

Are all my nodes publicly available at their respective links (ie example.com/node/25)?

I'm new to Drupal and working on a pre-built Drupal site. There seems to be a large number of pages that are public with the /node domain path. For example, something like the link example.com/node/10,...
0
votes
0answers
16 views

If field name is end with underscore example field_data_my_field____ in Drupal 8 than what issue or failure can come

Suppose if I have created some field in content type example: node field . machine name (field_node_filed__) So what is the draw back of fields machine name is ending with (_) underscore. Is it ...
0
votes
0answers
9 views

Issue inserting characters which are non-utf8

I am inserting values problematically into Drupal 8 and is unable to insert values such as 'é' and 'è'. How can I insert this without changing the database collation?
0
votes
0answers
24 views

Redirect after saving referenced nodes

[Note, this question is almost identical to this one for Drupal 7, but since I never used it I cannot understand how the proposed solution can be ported to Drupal 8] I have a parent node type, let's ...
1
vote
1answer
56 views

Date/Time +1h in Node

I have a module to import nodes with a date/time field. All times are correctly written into the database. But when I view a node or in node/edit I get the time +1 h. In Drupal I have set the timezone ...
-1
votes
0answers
27 views

How to programmatically create a top-level book page when creating a node?

In Drupal 8 with the Book module enabled, when I programmatically create a node of a certain type, I want to make it the top-level page of a new book. To do this when creating a node in the user ...
2
votes
0answers
25 views

Working with hook_node_access_grants

I am currently working with Permission by Term to set simple access control on two node types with terms. As noted here, I believe I found a bug where the access record isn't written the first time ...
-1
votes
0answers
7 views

How it's possible to include node_load and node_view to ajax_command_html

I have something like this function blogy_html_callback($form, $form_state) { $string = $form_state['values']['search_block_form']; $query = db_select('node', 'n'); $query->join('...
0
votes
1answer
18 views

How to add title of the image in manage display section or display it in node view page

I want to display title property of an image in node view page. How can I display title of an image along with image in node page?
0
votes
1answer
12 views

How to get field value after getting a node?

I have a content type which contains school information. School name and school id are two fields in the content type. I have the school ID and I am able to retrieve the node. How do I get the school ...
0
votes
2answers
29 views

how it's possible to load nodes by taxonomy terms

Here im loading nodes by "type" article, i want to call nodes by another id , but this id is in another table, should i join tables , or it is some other way to do this $type = "article"; $...
0
votes
0answers
18 views

How to get a single node field into custom form

I have a custom form in which referenced field needs to be displayed. Here is the structure: Content-Type: Project Reference Field in Project Content-Type: POD Details(Fields- MemberName: User ...
0
votes
1answer
20 views

How to pre-populate paragraphs when creating a page

I have tried for some time to find out a way to populate a new page with a few paragraphs to save time on most of the pages (but which might change position or even get dropped for some pages) but so ...
1
vote
0answers
13 views

How to get first & last revisions?

I have Article content type. Moderation is enabled. So user will move article from Draft -> Published -> Draft -> Draft -> Published . So all revisions is going to create for each state. $...
-2
votes
0answers
29 views

Drupal node_save with user created node id

I am creating a node_save_hook to get id which need to be in a yearly order example $n->title = ''; $n->language = LANGUAGE_NONE; $n->status = 1; $n->promote = 0; $n->uid = ...
0
votes
1answer
34 views

How to customize a link with a custom module?

I installed the "Private Message" module on Drupal 8. There is a link to send a message that I want to transform into a Bootstrap button. How to customize a link on Drupal 8 ? Here is the HTML code ...
-2
votes
0answers
31 views

How to prevent access to node based on user role

I have created a new role in my drupal 7 gives view publish content permission on node. I have created new module implemented hook_menu when i am trying to access node it gives "access denied error" I ...
0
votes
2answers
53 views

Increase weight range for child pages in book outlines (Book module)

When a child page is added to a book via "Add child page" (node/add/{content-type}), the Weight drop-down field in the Book Outline tab has a range of -/+ 15. This is due to line 191 in web/core/...
1
vote
2answers
19 views

How to increase book weight range for a same-level chapters

I have a book of 33 chapters. These chapters are numbered with roman numbers: Chapter I, chapter II and so on.I'm a blind user, so I can't use drag & drop reorder. In Drupal 7, weight range is -15 ...
0
votes
0answers
8 views

print field value of content type

I have created a custom content type and created a page--home-services.html.twig template. How do I individually display the values of the fields I have specified when creating the content type?
0
votes
1answer
17 views

How to force child page added to book outline to top or bottom; update outline without clearing cache

Drupal 8. When you click the "Add child page" link at a book page, you go to "/node/add/content type" where you can create and save the child page. Upon return to the book page (assuming the book ...
1
vote
1answer
25 views

How to update a node after loadByProperties? [closed]

I search for a node with field value client id and I need to update values. How do I do that in drupal 8? I search with the following code $profileNode = \Drupal::entityTypeManager() ->...
-2
votes
1answer
34 views

How tu setup magazine-like content type?

I working on my first Drupal 8 site, and I heard 3 rules about Content Types: More than 5 content types is too much When content are similar (news, articles) is better to do one content type Do not ...
0
votes
1answer
23 views

selecting all field_data_body for all content types

We are trying to search all text_long or text_with_summary fields for all content type nodes. I can do it for the field_data_body. I need to expand this for all content types using text_long and ...
0
votes
0answers
35 views

How to conditionally bypass login restriction to access node

I have installed "redirect 403 user login" module to restrict nodes access anonymously. Now this condition working fine but my client gave another condition. He wants to display these node url's with ...
0
votes
2answers
37 views

Add content type machine name as body class

Is there a way to insert a class to the body of the node page? It should be named like the current node type's machine name. Maybe someone could extend this code below with a content type class: ...
1
vote
1answer
22 views

Rendered entity reference field (list-group) disappears, when user can't access the referenced items. Why?

I have been trying to find the reason for this problem for a few days now... without any luck. Which is why I would like to ask for help here... In a nutshell: I'm working on a simple LMS and have ...
1
vote
1answer
33 views

Pass book node id as second parameter to drupal_block(“book_navigation”)?

I'm trying to use drupal_block("book_navigation") in a twig template (with the twig_tweak module installed) to display a list of chapters for a book page. But I'm getting a list of all books and their ...
0
votes
1answer
36 views

Constructing array of term reference labels in php template?

I'm currently trying to set up a simple LMS and have already defined a content type course that contains a term reference field accesstags, which I would like to use for defining view permissions. I.e....
0
votes
2answers
52 views

Pass additional variable into existing twig template (Book module)

I use the Drupal 8 Book module for books where each chapter has a different author. The Book Navigation block uses book-tree.html.twig (core/modules/book/templates) to generate a book tree showing ...
0
votes
1answer
36 views

How to define template suggestions for node add and edit form by content type?

I have a content type Project and it has a more than 100 fields in the node form. The form fields are grouped in different section and category. I tried to use a field_group module to group and ...
0
votes
1answer
37 views

Content type Text field as Geolocation source field in View

I have a text field(named as address) in my content type and I will store the address in that text field. Here I don't want to store the address in geolocation field so I have to use text field to ...
0
votes
3answers
170 views

How to get nid and title from a node array

use Drupal\node\Entity\Node; function abc($v) { $node = \Drupal\node\Entity\Node::load($v); print_r($node); } The array structure of $node is as given below Drupal\node\Entity\Node Object ( [...
0
votes
2answers
35 views

Insert date programatically in custom module

I am programatically saving values from an array $customer into a content type. The below code works fine and populates the content type customer_profile except for the field date of birth. This field ...
0
votes
0answers
16 views

How do I set values for a Boolean field? [duplicate]

I have a content type, I'm trying to add a field that's a boolean. I want the options to be yes or no. This is something I thought would be relatively simple however, I keep getting an error message. ...
0
votes
1answer
31 views

How do I set a Boolean field with “yes” and “no” values?

I have a content type, I'm trying to add a field that's a boolean. I want the options to be yes or no. This is something I thought would be relatively simple however, I keep getting an error message. ...
0
votes
1answer
53 views

How to render field of one type of node to another type node

I have two types of nodes: metals and prices. Metals has two fields: field_gold and field_silver How to render this fields on node--prices.html.twig (not node--metals.html.twig) Please, help me!
0
votes
1answer
42 views

How to render the field from custom block in node.twig

I want to render the custom field from my block in node.twig. As I understand I have to expose the fields from Block to Node variables. How to realize that?
0
votes
1answer
42 views

How do I set the default values for creating a new content type?

This is a follow up to my question in Can I change the Display Settings by modifying the database? which was answered. Basically, I could not get to the 'display authoring and date information' ...
1
vote
1answer
34 views

How to have a field with a select list widget and custom list entries?

In my content type there is a text field that is set using a list (combobox). When adding new content, the list is displayed with static elements. I would like to query an external site when the ...
0
votes
0answers
16 views

How do I enable translation tab for unpublished contents for users except administrators

In the node edit form the translation tab is hidden in unpublished contents for users except administrators and the author of the node? How do I give permission to translate those nodes for other ...
0
votes
2answers
61 views

Is there a hook for node after save?

How do I unpublish translations when the english content is unpublished? I tried to unpublish the language content programmatically when I am unpublishing the english content in the hook_node_update() ...