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
9 views

Published checkbox only available for administrator

Only the administrator can publish a node of content type Report. It is not using content moderation or groups though other content types are. All permissions are set for the "site admin" to create/...
0
votes
0answers
11 views

How to safely delete a node reference value

I have a field in a content type, content_type_A, whose field type is Node reference. It references another content type, content_type_B, which has a field which i cannot edit of type Node module ...
-3
votes
0answers
13 views

How to display external api data in drupal 8? [on hold]

I want use external api in drupal 8. I want to post parameter to external API and recieve the response and show the response on node.
0
votes
0answers
22 views

Wrong path of Image for property = “og:image” of meta tag in content view source

I have uploaded an image in my content. When I checked view source of the page, it shows the wrong image path for og:image property of meta tag. After uploading the image in my content, image path ...
0
votes
0answers
14 views

“Promoted to Front Page” option only showing for administrator

I am using the "Promoted to Front Page" option for a view that is displayed on a landing page. The option shows in the create/edit form for an administrator, but no other user for the article content ...
2
votes
1answer
38 views

Migrate nodes with special characters in title

Given a source's title like This "cool" & "neat" article's title has HTML entities , is creating a title of This "cool" & "neat" article's ...
0
votes
1answer
28 views

Make my view the default for content type

I am probably doing this the wrong way, so please correct me if I am wrong! I have created a new content type, called "Entities". My content type has many fields, and the default view when you visit "...
0
votes
1answer
28 views

Add content screens from the front end

I am building a web application (for trusted users), so the logged in user will have the ability to add content. However currently, when the user wants to add a record, they move from the frontend ...
0
votes
0answers
36 views

How can I display a webform on a node?

I am trying to display my webform using MYTHEME.theme file but I did not get any result. I am using code below: function THEMENAME_preprocess_webform(&$vars) { $wfid = $vars["element"]["#...
0
votes
1answer
21 views

Referencing “type” in nodes returned by loadMultiple();

I know there are easier ways to sort nodes by type, using views, or using: $query->loadByProperties(['type' => 'my_content_type']); ... but what I really want to do is return ALL nodes and ...
0
votes
2answers
42 views

Display the day of the week

I have a content type with various fields. One of these is a date field. After typing in the date I would like to display the day of the week to the right of the date.
0
votes
0answers
25 views

How can I append the node ID to the node title while saving a node? [duplicate]

When a node is saved, I want to append the NID to the title of the node. $node->title = "XYZ_" . $node->nid; If I put this code inside hook_node_presave(), it won't work because NID($node->...
2
votes
1answer
33 views

How can I get the parent node of a referenced node?

I have a node called project which contains field building as a referenced item, I used the the hook on building node insert and, having this building id I need to get project id which this building ...
0
votes
0answers
51 views

How to delete node of a content type if having millions of node

I have a content type in my Drupal 8 instance and having more than 2 millions (20 lakhs) node and want to delete those node, tried many things but nothing helps, either HTTP 500 error occur or Website ...
-2
votes
0answers
25 views

Documentation View

I am looking to create a document/node library on my Drupal 8 site that looks a bit like this: https://docs.devexpress.com/WindowsForms/114561/controls-and-libraries/forms-and-user-controls It is for ...
0
votes
0answers
32 views

How can I get the metatag_config site name by consulting my db with php?

I want to obtain the metatag_config data through a mysql query with php from my db drupal, in order to obtain the site name, description, keywords and abtract. How can I do it? Or where they are ...
1
vote
1answer
28 views

Fetching node field values programmatically

I have figured out how to query the node table programmatically without using the deprecated db_query() function. However, I soon discovered that the actual content fields are not held in the node ...
2
votes
0answers
30 views

Add an existing node as a translation to another node [duplicate]

I am migrating contents from a multilingual website. I'm using Feed modules to import all the nodes so, in the end, I have multiple nodes that are in English and multiple nodes that are in French. ...
-2
votes
2answers
39 views

Where might I place code to programmatically update nodes?

I want to update or set value of specific node/entity with one button that have function to update specific field on that node / entity? And put in on view tab on that specific node on a button? How ...
1
vote
1answer
24 views

Translatable image field gets replaced when adding content

I have added an image field with Translatable Content enabled. My content type has enabled translations too. But when I add an image in the translation, the english contents field get replaced with ...
0
votes
0answers
11 views

Print translated Image field in node template

$nodeObj = Drupal::service('entity_type.manager')->getStorage('node')->loadByProperties(['type' => 'books' ]); $nodeObj has field 'field_book_image' and 'target_id' => string(2) "65" in node ...
0
votes
1answer
20 views

How do I reference a file field and node title from another content type & node?

I need to add a link to a file, added through a file field on its own content type called "Document" from another content type and node call "plan information". The idea is that the "document" nodes ...
-1
votes
0answers
28 views

How to display content node in popup?

I have created 1 content type called product having below fields. Product name Product code. Category Now, I want to display product new node in popup after clicking on "Add new product link" how ...
0
votes
0answers
13 views

Migrating into Double field

I am migrating a CSV into D8 node type which has a double field. The CSV has the following structure: I am trying to migrate the year, from the header, into the first double-field subfield (as a ...
-2
votes
0answers
32 views

Get all the content of a particular content type

I want to list all nodes of particular content type in twig file. I got all data in MYTHEME.theme file but I got null value in twig file I used the following code. /** * Implements ...
2
votes
0answers
60 views

Webform module loosing language for referenced options

First I have content type "Quiz option" which is translatable. Then I have a view that returns Entity references of that type. For language option I selected "Content language of view row" and also ...
0
votes
2answers
44 views

Cloning nodes between multisite instances with separate databases

I'm working on a Drupal 8.6 multisite and my client wants to be able to duplicate content between many of these sites. The codebase of the websites is the same, but each of them uses a different ...
0
votes
1answer
35 views

import address data from CSV

I migrate my content from an old D7 site to D8 site. All went well, except the addresses from field address where not migrated to the new address field. Then I use feeds, feeds_migrate, content-...
1
vote
0answers
35 views

Can I alter the behaviour of a core function?

To make content management easier, for a large website we have allowed the content administrators to put a pipe in the title of a piece of content. Anything before the pipe is ignored. Is there a way ...
0
votes
0answers
13 views

Updating Solr search_api filters on node deletion

With Drupal 7 I am using a SOLR search index. The index covers a particular content type. I have a view which uses the search facets and displays a paged list of items in the index. My problem comes ...
1
vote
1answer
22 views

How to render translated node body in two languages?

I use entity_translation to translate node body field, so in a fully loaded node object body is an array of 2 languages ('en' and 'ru'). For specific node type I would like to render body in both ...
0
votes
1answer
38 views

Add Button to Node View

I want to add custom button on node page. I tried with hook_node_view but it didn't show up. like this: function mymodule_node_view(array &$build, EntityInterface $entity, ...
1
vote
1answer
36 views

Drupal::entityQuery

This is the official Drupal::entityQuery function definition I found public static function entityQuery($entity_type, $conjunction = 'AND') { return static::getContainer() ->get('entity....
0
votes
0answers
24 views

Export blocks added via layout builder as default content

I am using Layout Builder to add blocks into my nodes. I am adding several instances of different custom block types to specific content individually. I wander if it is it possible to export those ...
0
votes
1answer
46 views

Can I get the relationships of a node using node_load()?

I want to load relationships from the node_load(). So for example getting the article content type and loading the author information with the same query. How would I go about doing this? The end ...
0
votes
0answers
24 views

Link Field removing parameters for external links

I have a content type which uses the link field which I have set to external URLs only. When I put a website URL with more than 1 query in it, it won't render the second portion of the query at all. ...
-1
votes
1answer
31 views

List files in a directory as a table

I created a folder inside of my Drupal directory where my client can directly FTP into and upload or remove PDFs. What I'm trying to do is create a page called "Documents" which then displays all ...
0
votes
1answer
26 views

Output referenced entity in correct language

The following code outputs referenced entities in the original language they were created. {% for story in node.field_stories %} {{ story.entity.label }} {% endfor %} I want it to render in the ...
0
votes
0answers
15 views

Conditinal Field for Group Fields

I have a List Field on a Content Type. Just after that I have a Group Field. I'd like make it visible in relation to the value on the previous List Field. To sum up, to use Conditional Field Module ...
-1
votes
1answer
30 views

How to add multiple values to file/image fields while creating node programmatically?

I have multiple images coming dynamically in array. But while adding those images to node only last file get attached in field and other images only saved in file directory. I have tried everything ...
0
votes
0answers
32 views

Timestamp error when trying to view page revisions

When trying to view a node revision at <base_url>/node/<node_number>/revisions/<revision_number>/view/, I get The website encountered an unexpected error. Please try again later.&...
0
votes
2answers
30 views

How do you hide a page? [closed]

I'm using Drupal 7, can you tell me how to hide a page if the page does not have a menu settings at the bottom?
0
votes
1answer
29 views

Select all nodes, where date is greater then current date and repeat event option is empty

I have content type "event". In this content type I have a date field, provided by the Date Recur module. At the result I have range of the dates: Event start and end date. Also Date Recur provides an ...
0
votes
0answers
17 views

Show who published a revision/page - publish history [duplicate]

I would like to know which user published a page or revision of the page and when was it published. Is there something like publish history? In the image we can see only the revision (date and author ...
-3
votes
1answer
45 views

Create module that create Content Type [closed]

I'm developing module that creates a content type. I saw the same question and there was a solution. I had tried it but it didn't work. job_post.info.yml name: Job Post description: A job posting ...
0
votes
1answer
32 views

How to un-cache a specific node field (also for anonymous)

My goal is to replace (by a custom markup) the render array of field_product when some conditions are met. (in a ecommerce site) Ex: If this is the weekend or if it is after 12pm the field_product ...
0
votes
1answer
42 views

Scoping an admin link to only show for certain node bundles

I have 2 node content types / bundles, A and B. each A has a relationship with multiple Bs. When on the edit page, node/%/edit, for A, I want to show a link to the list of related B so that an editor ...
1
vote
1answer
57 views

Programmatically remove content from a group

In order to add a node to any group in Drupal 8, I use the following code. $group->addContent($node, 'group_node:article'); Now, for removing content from a group, I have tried $group->...
0
votes
0answers
16 views

How to refer to the node created date in Computed Field PHP

I am using the Computed Field module in D8. I am trying to compute some dates using the node created date as the start point. As my first try, this code works: $valuein = $entity->field_datefield-...
0
votes
1answer
28 views

Field contains list and values of it are shown in one symbol

I'm developing a drupal module and there's a problem. I need to make a content type with some fields and one of them should have list with string values. But when I try to create content and choose ...