This tag is for questions regarding the use, reuse and manipulation of nodes, the most basic form of content on a Drupal site, and the API used to manipulate them. While nodes are implemented as entities in Drupal 7, this tag should be used instead, unless specifically referring to Entity API ...

learn more… | top users | synonyms (4)

0
votes
1answer
10 views

How to get all node ids from same content type

I am using Drupal 8 and I want to create related content, but the problem is that I can't figure it out, how I can get all node IDs(except current one) for a specific content type.
0
votes
0answers
6 views

D8 Contact form: recipient from node's Email field

Use case: Business Directory. Description: I need to create a dynamic contact form that will use each node's (business listing content type) individual Email field as the contact form's main ...
-1
votes
1answer
12 views

How to pull json data from external url and save it to a node [on hold]

I want to pull content of json data from an external url and save those content in node.
0
votes
1answer
16 views

Programatically save node fields if fields is autocomplete?

I have created a content type with 3 fields and my one field is node_refrence in this filed I am filling title of other node using node_refrence. I am using this code. > $node = new stdClass(); ...
0
votes
0answers
9 views

How to allow view mode selection during content creation?

We a content type, basic page, that can be of three types Publication Webcast Audio/Video There is a field that based on the Basic Page type, we switch the fields that are displayed. So for when ...
3
votes
2answers
112 views

Get all node types in Drupal 8

How to get all node types in Drupal 8 ? In Drupal 7 it used to be node_type_get_types(), but it's been deprecated. I tried Entity::loadMultiple() but it doesn't seem to work. I was thinking about ...
0
votes
0answers
7 views

While trying to edit the node its consuming lot of time [on hold]

While trying to edit the node its consuming lot of time and just to load content page its take more time and its not user friendly can anyone tell the solution for it it will be real good help i have ...
3
votes
1answer
108 views

How to create a node from a Webform using rules?

I want to create a node based on a webform data using the Rules module. This is because of a complication surrounding relationships within the associated CRM system. I am already at the point where ...
0
votes
0answers
10 views

Parameters and key value pairs for VotingAPI

My services definitions list notes that to 'select votes' using VotingAPI I have to POST the parameters 'type' (mandatory), and to 'set votes' I have to post a 'votes' array (mandatory) and 'criteria' ...
0
votes
0answers
45 views

Changing a node's content type

In Drupal 7, I can easily switch a node's content type by using Node convert. Node Convert, however, has not been ported to Drupal 8, nor does there appear to be much enthusiasm for the port. If I ...
0
votes
0answers
30 views

How to reindex a particular node in Drupal 8?

I want to index particular node on update, insert how to do it in Drupal 8? In drupal 7, we use the function function _node_index_node() I want to use the same function in drupal8 for my Drupal 8 ...
0
votes
0answers
12 views

How do I migrate the file attachments field from Drupal 6 content type?

My Drupal 6 site has different content types, and there is a File Attachments field added to the content types. While migrating to Drupal 8.1, this field is not getting migrated, but the attached file ...
2
votes
0answers
23 views

Hiding /node page in Drupal 8 [duplicate]

How can I hide the /node page in Drupal 8? This site: https://www.drupalaid.com/blog/3-things-you-should-hide describes the reasons for hiding it and the process for Drupal 6 and 7, though no ...
0
votes
2answers
147 views

How to print Taxonomy Terms in Templates?

How can I display Node Taxonomy Terms in drupal 8 Templates. We do this in Drupal 7 by add this code to node.tpl.php file: print render($content['field_tags']); I tried adding the below code in ...
2
votes
2answers
54 views

Redirect legacy URL

I migrated a site not using Drupal to Drupal. Now I need to make sure that some legacy URLs are redirecting to the right node URL. The node has the node ID (nid), the legacy ID (field_leg_id), the ...
3
votes
1answer
170 views

How can I embed a View inside a content of a node?

How can I embed a view inside a content of a node in Drupal 8? I found something similar, for example in the question about "How do I embed a view inside a node?" or the Viewfield module, but it is ...
1
vote
1answer
33 views

How do I append a view to the node body in custom module?

In Drupal 7, we could do the following within a hook_node_view: $node->content['nodehierarchy_children'] = array( '#theme' => 'nodehierarchy_children_embed', '#nodehierarchy_view' => ...
1
vote
2answers
37 views

hook_load vs. hook_node_load?

Can someone explain clearly the difference between hook_load and hook_node_load? hook_load says it is a "node-type-specific hook". What does that mean? hook_node_load actually has a types parameter.
0
votes
1answer
22 views

Remove the image style from node--type.tpl.php [duplicate]

Is there a way from a node--'type'.tpl.php template to remove the image style of an image field?
0
votes
1answer
20 views

Seemingly random <h3> being added into views node header for content type

I've got what seem to be random empty <h3>s appearing whilst displaying a custom content type as a teaser in a pretty standard blocks display through Views. Now this is only a problem because ...
0
votes
1answer
13 views

Can we configure Devel module to pick up images for the image field of a content type only from a specific directory containing images?

A Yes or No question. Using Drupal 7.43. Devel module generates polycolor image content of a content-type which has an image field. But I need only a few specific images on my contents of that content ...
0
votes
1answer
13 views

Passing computed data from Theme preprocess functions to Twig templates

I'm using Drupal 8. My general problem is this: I need to compute some data from PHP code, usually using Drupal APIs, then pass computed values to a Twig template in order to showing it. For ...
0
votes
1answer
24 views

Retriving nodes by content type using Drupal::entityQuery

I created a content type named product. How can I retrive all node of such content type using the entityQuery method? I tried with this, but it doesn't works: $ids = \Drupal::entityQuery('product') ...
3
votes
2answers
69 views

Make node a revision of another node

I have migrated content from a non-Drupal system to a fresh Drupal site. Some of the content nodes however should in fact be revisions of another node, not a unique node of themselves. Is there any ...
0
votes
0answers
17 views

Creating node flag type causes site to crash

I use Flag module and whenever I try to create a Node flag type I get this error: PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT r.rid AS rid, r.name AS name ...
0
votes
0answers
5 views

How to check if an image field in core profile has data using computed field

I created a new image field in Core profile named 'field_userimage'; then, I created also a image field in Node content type named 'field_nodeimage' ; at the end, I created a Computed Field to show ...
0
votes
1answer
25 views

Getting fields' Attributes in node template

I'm trying to rendering node's fields directly inside a node template. This is my node template file node--homepage.twig.html: <div{{ attributes }}> {{ title_prefix }} {{ title_suffix }} ...
0
votes
0answers
14 views

How to programmatically update node in Drupal 8 and add multiple images

I'm migrating content type gallery and each gallery has multiple images. How to programmatically create (or update) node in Drupal 8 and add (insert) multiple images.
0
votes
0answers
19 views

how to create new drupal-wall node through custom module?

I have using drupal wall contributed module to posting purpose,and these posts create through custom module, i have used node_save() to create a new nodes. but problem is instead of user/author name ...
0
votes
1answer
22 views

Internal server error when programmatically updating about 100 nodes

I'm writing a function that unpublishes a bunch of event-type nodes within a date range. My query pulls about 100 nodes, but I'm apparently maxing out the available memory. Here is the code in ...
1
vote
2answers
33 views

How to display the TID of a term reference field in a content type?

In Drupal 8, I have a blog content type with a taxonomy term reference field called category. How can I print out the Term ID of the taxonomy term of the category field in my node.html.twig file. I ...
0
votes
0answers
12 views

Drupal 7 CCK add form theme customization

I would like to customize the node add form of the CCK theme for these reasons: It is a very large customization job. I'd like to place my fields in my own way instead of trying to do this with css. ...
0
votes
0answers
11 views

How can I print taxonomy id of a blog category field in a node

Please, how can I print the taxonomy id of a blog category field in the node template? Using {{ content.field_category }} prints the term name but how can I get the unique term id instead?
1
vote
1answer
30 views

How do I completely overwrite an array in JSON serialized data field

I am storing an array as a JSON encoded serialized data field in Drupal 7 using the Serialized Field module. If I have an array of 20 elements and try to overwrite it with an array of 10 elements, I ...
1
vote
1answer
27 views

How can I save form data on a node in Drupal?

I want submit form data and save on specific node but I don't know that how to do? function test1_menu() { $items['mytest'] = array( 'title' => 'My Tes', 'page callback' => ...
0
votes
1answer
8 views

menu item required to edit content

I need to add a menu item in my User menu which provides the facility for users to amend the content of a Content Type ( Sectors) i.e. so they can amend a sector. The User Menu only appears of course ...
0
votes
0answers
7 views

How show core user mail if node author not anonymous using Computed field

I'am trying to set a computed field that: 1) show the core user email address if node author uid !=0; 2) and when the node author uid=0, no core user mail address can be find, so I show instead a ...
-2
votes
0answers
13 views

get slogan site for contents

i have created this module : display nodes with her : title , type, and site name, but i want that display site_name for each node Example : Node 1 : Type1, Site name 1 Node 2 : Type2, Site name ...
0
votes
0answers
19 views

No class=“active” on just some Pages

I'm on Drupal 7.43 and are using Nice Menus 7.x-2.5. I just noticed a problem but can't say it is connected to Nice Menu. When I under admin/structure/menus manually creates menu links, not all links ...
0
votes
0answers
7 views

hook_install and node_add_body_field do not work

I am making a custom module for a website. Part of what my module does is create fields and around seven different content types. I have pasted the code from my module files bellow. The module name ...
0
votes
0answers
5 views

What is the best context for rendering embeddable view displays?

A view display can be rendered using views_embed_view. My question, does it make any difference in terms of performance / caching to call this function inside a node's body field or inside a ...
0
votes
0answers
9 views

Adding url dynamically in jwplayer javascript using drupal 7

I am using file_create_url function in my custom menu for particular node video field. i want to load this url in jquery jwvideo player file path dynamically under below this code ...
0
votes
1answer
33 views

Saving a data to two different nodes with same node id?

I am having this problem , i want to save the same data into two tables with the same node id. I want to use both the tables on two different places because data is changing in the first table and i ...
-1
votes
0answers
11 views

field_attach_update does not respect node edit permission

In Drupal 7, I have a particular node type for which users are allowed to edit their own nodes only. In some ajax callback function for a custom form, I give the users ability to modify a particular ...
-1
votes
0answers
12 views

Different node title per date

I have content type with mutiple date field. Is there a module that can allow me to set different titles for different dates? So my Views can display different title depending on the current date. ...
0
votes
0answers
48 views

Create and update nodes via a module in Drupal 8

I have a module that is creating two new content types, one will have a title, a term reference, and a node entity reference to the 2nd content type. The second one will be composed of 2 integer value ...
0
votes
1answer
19 views

custom function to delete determined content type's nodes never finish

I am trying to make a custom module which delete all nodes of a content type and then import new nodes of this type from a .txt (maybe I will use feeds import for this). In the first step of my ...
3
votes
1answer
39 views

How to hand over value of field 1 to class array of field 2 programmatically in .theme

Motivation Context between template variable arrays is an old problem already known in D6 and 7 on theming level. What about D8 now? Any light on the horizon? Any chance to make this avaible without ...
0
votes
0answers
13 views

Disappearing content and broken links

Content on my Drupal 6 website has started to disappear and I'm trying to find the cause. News teasers that link to the full article are displayed fine with title and summary, however the link to the ...
1
vote
1answer
38 views

How to display node number in content items that only show up to administrators on ALL content items?

Evertime I need to node number I need to go to content items and hover over it, memorize and use it after... Is there a way to have the node number displayed on the content item, but only to ...