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.

-1
votes
0answers
15 views

How to create a block “Search: More like this” with my articles?

I noticed that in the context filter of the view, there was a filter "Search: More like this". How to make it work? Is this the right solution ? I have a tags field on my articles with taxanomy terms....
-2
votes
0answers
30 views

How to add new field to Node entity itself

I have site with a several views which displays multiple different content types. The results display a different (SVG) icon on them based on the content type. Which icon to display is done with a ...
-4
votes
1answer
30 views

Find different node in hook_node_form_alter [on hold]

In the function hook_node_form_alter(), i still want to get an other node, because i want to set a field value programmatically in dependencies on the value of an other node (the parent node). But i ...
0
votes
1answer
18 views

Migrate content from drupal8 to drupal8 programmatically with Node::load and Node::create

Basicly I want to migrate content from one drupal8 instance to another. they are mostly identical with some small changes. first step is to migrate the content type via drush gen module module and ...
1
vote
1answer
12 views

Navigation for book collections

I'm working in a projet where I have to show a collection of books. In this website I managed using the books navigation block, for one collection with many books, with css I managed to set a tree ...
0
votes
1answer
17 views

How to append options and classes into a custom attribute in Twig?

In our twig template we have a need to wrap certain fields with a Link field. In the existing twig template there already exist an attributes variable (accessed by adding attributes), but we have a ...
1
vote
1answer
23 views

Add another button removes the default values from my fields on node form

I have a node form on which two fields are displaying. One is a list of radio buttons which is required field. I am getting a value from url using arg(3) and setting the default value of that field $...
0
votes
1answer
23 views

How to access/arrange the {{ content }} field within a Drupal 8 template?

I am relatively new to Drupal and have just successfully (thanks to help from this community) pulled out a field value and used it to display a custom icon on the page. Coming from a HTML/CSS only ...
0
votes
1answer
21 views

How to migrate one type of contents to other type having same fields?

I have 2 content types having same fields and I have many contents added by cleint in both the types,now I want to change some of the node's type A other type.. How can i achieve this?
0
votes
0answers
10 views

How to get the group entity for automatic entity label when creating nodes?

When creating a new node, you can assign it a group (group project). I need the group field's value to put into my node title. The problem is, there is no token to use within AEL for the group and ...
-1
votes
1answer
28 views

Prevent delete content before it is removed in external index

This is my use case. We have a Drupal 8 installation that we used as decoupled, so one external API retrieve all content and them indexed. So, this external API update indexed content when Changed ...
0
votes
1answer
28 views

How can I change the value of a field in node / [id] / edit?

I should change the value of a field before it is rendered. I tried with [NAME_MODULE]_node_view but it is not invoked when I edit the node. Thank you so much.
0
votes
1answer
22 views

Show child pages in parent node view details in a book

I'm using the Book module to maintain the parent-child relationship between content. I want to see all child pages expanded when I see a parent node details page. How can I achieve it? I tried with ...
0
votes
0answers
24 views

Display tooltip help text on the node display page

I search all over the internet with no success answer for my requirement... I want to display help text for each field on the node display page (ex: /node/16) and not on the node edit page (ex: /node/...
-1
votes
0answers
17 views

Browse all the server directories to link files

I have installed CKEditor in Drupal 7. Whenever I add nodes in the body field, I select a text and click on link icon on the top of body field text area. A dialog box appears, and then I click browse ...
-3
votes
0answers
25 views

Creating a content of a content type using block [duplicate]

I have a content type of job posting in which users can post jobs. The page is having anonymous access also. (/node/add/job_posting with url alias /job-posting). Now I need this page as a block ...
0
votes
0answers
21 views

reset existing content type settings to default settings

In my Drupal 7 Site, I have a couple of Nodes of the same content type. On some of them, the settings( Menu, Sitemap) have been changed. How can I reset all of them to the default settings for that ...
0
votes
1answer
93 views

How to create custom view/display for few content_types?

EDIT: see two paragraphs below to what I managed to get I can't find a way to use single template for few but not all content_types. Let's say I have content_types A, B, C and D. I want to use ...
0
votes
1answer
46 views

Call to a member function label() on null after saving a node with a taxonomy term

I create nodes, which have a taxonomy field, like this: $node = Node::create([ 'type' => 'article', 'status' => 1, 'title' => 'Some title', ... 'field_taxonomy' => [1, 2, 3], ]);...
0
votes
1answer
24 views

How display node author roles at node.html.twig

My user case is: Extlink module can add exception classes to avoid processing some links. I want some external url links on nodes whom author belongs to a special role (premium) can be mark with a ...
0
votes
0answers
16 views

How to delete file entries on click of Remove button in file upload?

The orphaned entries of a file which is associated to the node should be removed when a file which is attached to a node is removed from it. Like associated entries from file_managed table. How to ...
0
votes
2answers
34 views

How do you set a node reference field's default value when creating a node programatically?

I use this: $values = array( 'type' => 'competition', 'title‎' => 'my title goes here', ); $node = \Drupal::entityTypeManager() ->getStorage('node') ->create($values); This works ...
0
votes
2answers
15 views

Get taxonomy terms added to nodes

I am trying to get all the taxonomy terms added to a node. How would I get only the taxonomy term values that are added to a code in a mymodule_preprocess_node hook? Current term list: value1 (tid=1)...
0
votes
1answer
38 views

Not able to export nodes from one drupal site to other drupal site?

I have 2 instances of same drupal project, where contents are different. I want to export contents from one drupal site to other drupal site. I tried content syn module: I Was not able import ...
0
votes
0answers
21 views

Implement a Tour functionality for specific Content type by using Tour UI module?

I am trying to implement tour functionality for adding content to a specific content type. I used Tour UI module and I gave inputs as below: The route I have given is node.add. Because of that, its ...
-1
votes
0answers
20 views

Restrict access on system path for nodes, but keep URL alias

I use path aliases on my Drupal 8 site. How can I restrict the access of the system path for normal users and bots to resolve the issue of duplicate content issue for SEO reasons? I only want the ...
-1
votes
1answer
44 views

How do I add an existing paragraph field to another content type programmatically

I have a paragraph field that is already used in a content type. I need to add that paragraph field to another content type using the same field that I was using in the previous content type. How do I ...
0
votes
1answer
43 views

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

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
vote
1answer
42 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
16 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
25 views

Memory exhausted during csv upload? [closed]

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 ...
1
vote
1answer
39 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
35 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
18 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
26 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
59 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 ...
2
votes
0answers
26 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 ...
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
15 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
30 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
23 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
24 views

How to pre-populate paragraphs when creating a page [duplicate]

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
17 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. $...
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 ...
0
votes
2answers
60 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
28 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
10 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
18 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() ->...