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)

1
vote
2answers
20 views

Hide authoring information programmatically in a content type

How do I programmatically hide the Authored by part in a content type using hooks?
1
vote
1answer
24 views

How do I display a taxonomy term, without a link, in a node template?

In learning, I've created a custom content type called story and a custom taxonomy called story_category. In story I have a term reference for story_category. I can render a taxonomy term associated ...
0
votes
0answers
5 views

How to move Date Information on a node [on hold]

I've got a node that has several fields, and I would like to move the date information (without the author) to a specific point in the node's display. Editing node.tpl.php doesn't seem to help, as ...
0
votes
1answer
15 views

Multiple Values in Custom Template Field

I have a custom template for a node, and a field which has the possibility of having multiple pieces of data. In this case: There is an Author node There are Publication nodes Publications are being ...
0
votes
1answer
17 views

How to display message (NDA, warning, etc.) before content can be viewed?

Say a user wishes to view a certain piece of sensitive content. How can we have the site first respond with a notice, before the content can be viewed? Specifically, I'm looking to have the site ...
-1
votes
0answers
11 views

Quiz module results are shown only when quiz was taken more than once

is there a way to display results (all questions with correct answers) in "node/1111/results" ? Now the results can be shown only when test was made atleast once. Through the ...
0
votes
1answer
12 views

How do I show user created node in user profile page with edit mode?

I have a content type 'child'. And I have give the permission to authenticated user to create child node. Its working fine. But I need to show current user created node in user profile page with edit ...
1
vote
0answers
18 views

Import module lose first symbol in some word in CSV file after import

Import module of Drupal 6 lose first symbol in some word in CSV file after import. Example. Before import: After import: In CSV file word is "Refond", but after import - "efond".
0
votes
1answer
9 views

How to let node author to “like” the comment and then display authors of these comments in block

In my project I'd like to let node authors to mark (kinda like) one of the comments and then I want authors of marked comments to be shown in block on frontpage like: "Node author A has recently liked ...
0
votes
1answer
21 views

Products - Add to cart

I need some advice. My client has a website with loads of products. Now the client want the ability to add products to a cart, and instead of buying, they want the products to be mailed. How can I ...
-1
votes
0answers
16 views

Nodes List without VIEWS

i'm currently in need of creating a page wich lists all nodes from a content type. I really don't want to use views. I was going to create another content type, create a single page from it and just ...
0
votes
2answers
23 views

Display fields node in table like views

I have a content type documents and my fields (created by admin) are: Doc1 File Date Doc2 File Date Doc3 ... The reason why I don't do a content type just with: "Doc, file, date" and add the nodes ...
0
votes
0answers
15 views

How can I show just price field in page--node--add--[content type].html.twig

How can I show just the price field (field_price) in page--node--add--[content type].html.twig, something like {{ node.field_price }}?
1
vote
1answer
36 views

How can I conditionally show a field in the node/add page?

When users are in node/add/page, I want to show the body field when the title is not empty. How can I achieve this?
0
votes
0answers
26 views

Commerce stock rule creation

I'm trying to create a rule that will unpublish a product display only if it's a certain type of product once stock reaches zero. I can't seem to find any good recipes to do that. I don't know ...
0
votes
0answers
9 views

Display text in dropdown

My user needs to be able to create a dropdown/select list when creating a new node. So what I did was create a text field with the ability to add unlimited fields. I looked at the text formatter ...
0
votes
0answers
29 views

How to use node grantify system in drupal 7? [on hold]

I have articles; when you click on the article, there are items like "See article content" or "Take a quiz". Quiz is handled within quiz module; article content is in the book module. I found a ...
3
votes
2answers
54 views

How to compare the already saved value of node and updated value?

I want to programmatically compare a field value of a node in hook_node_update(). How can I get the already saved and the updated values?
0
votes
1answer
43 views

Consume nodes from REST export views

I am trying to import nodes from a different domain's REST export view. I am able to get all serialized nodes from the view through Guzzle but once I try to create a node from the hal+json response I ...
0
votes
0answers
33 views

How do I load a specific field of the node whose menu link is the parent menu of another node?

I have a node (foo) with a menu link; that menu link is the child of another node (bar) menu link. When I view foo, I want to show a field of bar. How can I achieve this? The nodes don't have any ...
6
votes
2answers
69 views

Delete a node after X weeks it was created

How can I delete a node after, for example, 2 weeks it has been created?
0
votes
2answers
25 views

How to add element not appearing on the page via node_view_alter?

Given the following code: function mymodule_node_view_alter(&$build) { $node = $build['#node']; if ($node->type != 'podcasts') { return; } $build['new_section'] = array( ...
3
votes
1answer
32 views

Is this correct usage of hook_node_view()?

hook_node_view_alter(&$vars, $hook) { global $base_url; if($vars['#node']->status == 0) { header('Location: '.$base_url.'/?errCode'); } } Simple hook to redirect unpublished nodes ...
1
vote
2answers
29 views

How can I get the language name of the current node?

I'm trying to figure out how to get the name of the language of the current node in display suite. I find a language option under one of the node categories in the dynamic field content selector, but ...
0
votes
0answers
13 views

How to access node variable inside of a region

How can I access node variables inside of a region. I only seem to be able to access them within a page.
0
votes
0answers
12 views

How to assign products to multi lang categories

I can use this module for language translation Multilingual - Internationalization After created taxonomy category, in this list terms like category and sub category generated. I translated list ...
0
votes
0answers
10 views

Create content of certain content type based on outside information/validation

I'm running a game server. This server is updated ever so often and I want my players to be informed about the update. I want this to happen automatically. What I have is some JSON output I can query ...
1
vote
1answer
21 views

How to access a node's menu link title in Views?

I'm surprised to not be able to find anything about this seemingly simple or routine request. Suppose I have nodes that have long titles. They have menu items created the usual way, with short form ...
0
votes
1answer
21 views

Alternative for hook_node_submit()

What is an alternative to hook_node_submit() for Drupal 8?
0
votes
0answers
12 views

Is there a way to detect a page is showing a node in full view mode or not?

Is there a way, in hook_preproces_page(), to detect a page is showing a node in full view mode, or it is a view result, or anything else?
0
votes
1answer
32 views

How to create multiple node at a same time programatically?

I am creating a node via code function mymodule_form_alter(&$form, &$form_state, $form_id) { if($form_id=='article_node_form'){ $form['#submit'][] = 'newApp'; ...
0
votes
1answer
17 views

Set node view count manually

This might be not the smartest way to do but is it possible to set the node view count per node manually? The thing is, I'm manually exporting my nodes to another Drupal with no help of a module. So ...
0
votes
2answers
28 views

Template for custom content type

I created a module which creates a content type called equipment. Which includes multiple fields and a field collection. But now I want to style the template with those fields. As suggested from the ...
3
votes
1answer
28 views

How to assign content to user for manage turns?

I need to create a system to assign turns to a people register in the site, for this need contemplate: The administer assign turn to user in specified place.ex(turn 1, place 1, user 1) There are two ...
1
vote
1answer
14 views

Permanent Views Pages

Something I've been battling for some time: Is there any way to make the results of a views page permanent? For Instance: There is a club racing website that inputs Entrants as nodes, to events, ...
0
votes
1answer
19 views

Revision tab is not listing any revision

I have the Node revision module (diff) installed, and I have many revisions for a node, but the Revision tab is not showing any of them, even though the database table contains the data for those ...
1
vote
1answer
42 views

How do I alter the options in the add menu link checkbox in the node edit form?

I am hooking the node edit form with hook_form_node_page_edit_form_alter(). How can I alter the available options when adding a menu item for that node? I need to only show menu items of given node ...
0
votes
0answers
9 views

How to render the main menu in alphabetical order regardless of menu link weight?

We are using the main menu of Drupal to build out the main navigation of the site. The content creators have access to add a menu link for a node in any level of the main menu and they are also able ...
0
votes
1answer
10 views

Get nodes by content type when type key is not in root of nodes array

I am trying to get all nodes by content type. When the key is in the root of nodes array, like [type] I can easily retrieve it by, for example: $nodes = node_load_multiple(array(), array('type' => ...
1
vote
1answer
32 views

How do I update all nodes?

I have a custom module which creates a new field with a computed value, which I need to update. How do I bulk update my nodes for a specific content type?
0
votes
2answers
32 views

How to make authored on field emtpy

I have a content type with revision enabled, each time when I edit the node I can see authored on field has created date by default. I want this field to be empty so that it uses latest updated time ...
3
votes
2answers
64 views

Is there an option to somehow display all nodes that that doesn't have a menu link?

As almost all users here know, you can set up a menu link to each node from the "Menu settings" tab in the node's edit form. Is there an option to show all nodes that don't have a menu link? I tried ...
0
votes
2answers
36 views

Override theme template from module without implementing a theme

I have a project on D8 where I don't use any custom themes, I use default seven theme for everything because there is no need of any visual theming. So My question: Is it possible to override theme ...
0
votes
1answer
16 views

Content type access permission by user role

I have created 4 different content types and all except only one content type are visible to every user. Here, I am not using any type of access module like content access, field permission or ...
0
votes
2answers
34 views

How do I see *which user* last updated a node?

In admin/content, how might I override this display to list the User who last updated a piece of content. We can see the initial author and that's fine. But I'd like a running trail on who touched a ...
0
votes
1answer
23 views

When a link is clicked, a value is retrieved from the table and displayed on a Webform field

I have created a basic page with two buttons, "Yes" and "No". When the "Yes" button is clicked, it is directed to the webform. Aim: When the webform appears, it displays a value from the table into a ...
0
votes
1answer
35 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
26 views

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 ...
0
votes
1answer
19 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 ...