We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [nodes]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
9 views

Fill the “Unpublish on” date field of the Scheduler module depending on list field

I have a content type, where I want to give the user only three possibilities to unpublish content: in 1, 3 or 6 months. For the selection of the three options I use a list field. How can I transfer ...
2
votes
2answers
198 views

Where is the node created timestamp stored in the database?

I need to create an SQL query that finds all nodes of a certain type created X days ago, so I can get their IDs. Due to the massive number of nodes in the database, I would prefer to use a direct SQL ...
2
votes
1answer
32 views

How do I programmatically delete a node by internal url alias?

How do I programmatically delete a node with a specific internal url alias? Background: We are trying to delete this node so that it can be replaced during an update hook.
-1
votes
0answers
20 views

HTTPS domain doesn't display PDF's in pdf.js and same with embeded videos. How to fix that? [closed]

When the site is set to HTTP all pdf files and embedded videos are viewed in pdf.js viewer and video.js viewer. When I change the domain to HTTPS these viewer doesn't display any files. When I inspect ...
-4
votes
0answers
26 views

Create a custom view that is passed a node id in the url to print out the node's title [closed]

e.g: http://my-drupal-site/my-custom-view/12 prints out the title of the node with node id 12, e.g. "Delish Fish Dish"
0
votes
0answers
29 views

Node edit not getting published, user fields change & comments not getting saved [closed]

This is on Drupal &, PHP 7.1, mysql Ver 14.14 Distrib 5.7.27; The problem: When I edit any existing content, and click save, the 'Published' status of the content gets converted to 'Unpublished' ...
0
votes
0answers
19 views

Insert data into the database [duplicate]

I try to save some data I get into a form in the database but I don't know how to do it. Currently, here is what I have in the database (I try to add articles). As you can see I already have 2 of ...
0
votes
0answers
19 views

Status on node is not changed during query update

I'm updating a node's status to unpublished and the status in node_field_data is changed from 1 to 0 but in the content view, status is published and when editing the node, the publish checkbox is ...
1
vote
1answer
37 views

If content type with specific field that is not empty has specific taxonomy term attach library [closed]

I would like to attach a specific library using a taxonomy term to a content type with a specific field that is not empty. The following is not working: function lehigh_preprocess_page(&$...
0
votes
0answers
22 views

Services module retrieve node with PHP text format

I have successfully connected to a Drupal instance using JSON and even retrieved a node using the service. Problem is that the node has php content type, and the service returns the raw php content ...
-1
votes
0answers
11 views

Select and embed a webform submission inside a node

I would like to be able to embed specific webform submissions into a node. We have a webform that collects student job openings from each office at our college. I would like to be able to add those ...
3
votes
1answer
37 views

How do I free the memory used from node_load()?

I am using code similar to the following one. for ($i = 0; $i < 1000000; $i++) { $nid = get_node_id($i); $node = node_load($nid); $data = [ $node->field_1, $node->field_3, ...
3
votes
2answers
72 views

How to get node's view mode in hook_page_attachments?

I need to get the node's view mode so that in the mymodule_page_attachments, I can add libraries conditionally if the node's view mode is set to full or default. I tried the following but not able to ...
0
votes
0answers
11 views

How to show the User Picture automatically (By default) in the Node creation and in the published Node?

I need to display "User Profile Picture" as a field (it must be displayed by default, without the user entering it as an image in the field, otherwise it would be too simple, but somehow the field ...
0
votes
1answer
30 views

Select all checkboxes of an entity reference field on creating a node

Drupal 8.7.x For one of my content types I have an entity reference field referencing a taxonomy vocabulary. I have a lot of terms in this vocabulary which makes it tedious to check all the ...
0
votes
1answer
19 views

Show workflow transition bar in all states

I've created a custom workflow using the workflow module with the transitions listed below and I've noticed that when going to the view page of a node the workflow 'bar' that lets you transition a ...
1
vote
1answer
27 views

How to create node twig template suggestions for one content type?

I need to create a node twig template that is just for the basic page content type that based on a custom field on the content type. We have other content type like Article, Blog, Products that do not ...
0
votes
0answers
18 views

How to choose content field shown in View using URL parameter?

I have contentType Screenshot which has 6 Image fields shot1..6. Then I have a view screenshots_1 which shows shot1 in a grid. I need to have 6 paths, e.g. /screenshot_1..6 each pointing to same view ...
0
votes
1answer
23 views

How do I exclude a node from an entity reference field?

I have a homepage content type which has a featured_article field, an entity reference field that allows the editor to choose a single node from the Article nodes. That node is displayed as Featured ...
0
votes
2answers
38 views

How to reuse existing images in field type “Image”

I have custom ContentType with one field of type Image. Currently, when I edit a node I can only upload new images from local to server. I want to have the option to select images already existing on ...
0
votes
0answers
19 views

View with Taxonomy Path

We have a taxonomy vocab called Phones that goes like this. Taxonomy: Phones -Nokia --3310 --Jitterbug --7.1 -Samsung --Galaxy S6 --Galaxy Edge --S7 -HTC -- one --S7 list goes on, but you get the ...
2
votes
1answer
29 views

How to update a field on menu_link_content (added using menu_item_extras module) entity from node form

I have a checkbox field added to one of the menus using Menu Item Extras module. By default, the checkbox is checked and works as expected when I create a menu item via menu admin UI. however, when I ...
0
votes
0answers
40 views

Filter a view displaying nodes of one type using a user entity reference field on that node

I have a vocabulary (Countries) listing all countries. I added an entity reference field to the User entity (Nationality) referencing the Countries vocabulary. To the Article content type, I added: ...
0
votes
1answer
42 views

How can I loop through all article content types and get the content of each

I created a new article content and am overriding that by creating a template for it (ie: node--4.html.twig). Then inside this template, I want to loop through all nodes that belong to article ...
0
votes
1answer
38 views

Create nodes unlimited times

I've been trying to ajaxify the node creation form, the purpose? Save the node and remains in the node creation page (Done) If the user clicks the save button again save a new node The second point ...
0
votes
0answers
22 views

Programmatically add field collection items to a node [duplicate]

I have a node with a Field Collection [field_videos]. I would like to be able to progrmatically load a node and add field collection items. The field collection contains the following fields: ...
0
votes
0answers
8 views

How to fix malformed geometries in geofield

I have a form that allows to add geometries to a node. It features a geofield map widget where you can also add geometries using a WKT field. Plenty of users have used this field. However, some of the ...
1
vote
0answers
21 views

How can I alter the node title in every display?

I have a content type "Campus", I would like to concat to the title "Campus name campus". So, there is a hook or something to alter the node getTitle() method in every display? I've tested: ...
0
votes
1answer
29 views

How to remove Home title from the home page?

There are several posts on a similar question. Despite that, I couldn't find the best way to resolve it. Display Suite is installed but don't see option to turn off page title. Our home page content ...
1
vote
1answer
41 views

For each image uploaded in a node: get the url

I'm begining with Drupal 8 and I want to get the url of the photos in the content I create to display them. The context is : a photograph upload pictures for a customer. This customer can see it on a ...
0
votes
0answers
18 views

Node as field in content-type

I have one type of custom node called "Concerts", and another type called "Conductors". I would like to add a field to Concerts indicating which conductor led the concert. However, the field types I ...
0
votes
0answers
31 views

Getting white screen in Login /user and the page content

I was recently editing a website with Drupal 7 installed, and was integrating twitter feed. I created a block twitter_feed_block and assigned the block to the content section of the front page. It ...
0
votes
1answer
11 views

Anonymous permissions with Nodeaccess

Content type: Webform Allowed grants: View, Edit Allowed roles: Anon, authorized, admin Go to the webform node eg. node/20 Click Grants tab Tick authenticated and admin users can View, anonymous is ...
0
votes
0answers
19 views

How can we set entity refrence view in #selection_settings programtically?

I want to attach "game_name_entity_reference" view to autocomplete field in programmatically. Can we do this by #selection_settings attribute? or any other way?
0
votes
0answers
10 views

How to implement autoincrement field using inline_entity_form module in field collection?

I have 1 field collection in that added the entity reference field and set widget "Inline entity form-complex". Now i want to show auto increment number in "Game Code" text field. I have tried with ...
0
votes
0answers
41 views

Error “The value you selected is not a valid choice.” in drop down list

I want to list node titles in drop-down list programmatically. I have done below code in form_alter hook. function product_custom_form_alter(&$form, FormStateInterface $form_state, $form_id) { ...
0
votes
1answer
45 views

In Views, display additional fields from an entity reference

I have a content type with a field that is an entity reference to another content type called "URLs", and the "Allowed number of values" is set to "Unlimited", meaning that one record can have ...
0
votes
1answer
13 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 ...
0
votes
0answers
23 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
70 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 &quot;cool&quot; &amp; &quot;neat&quot; article&#39;s ...
0
votes
1answer
31 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
29 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
52 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
22 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
50 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
26 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
45 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
53 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 ...