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 (3)

0
votes
0answers
3 views

Drug&drop nodereference multiselect

How I can create drug&drops nodereference multiselect? Pls help me maybe anyone have some like issue? i want add to node nodereference field with druganddrops multiselect
0
votes
0answers
8 views

Randomizing nodes in a view display

I've tried the solutions here: Display random value from multi-value field in Views And here views... two random nodes to vote on This is what I have: A content type (Inventory) involving a field ...
2
votes
1answer
16 views

Change the way a Content Type is displayed depending on user

I'm currently trying to create an MMO (= Massively Multi Onlineplayergame) in Drupal while learning it. To do this I want to be able to change the way a Content Type is displayed depending on what ...
-2
votes
0answers
14 views

Drupal 7 and flcker on mobiles [on hold]

I have flickr installed on Drupal 7 and can see all pics without problems on desktop, but I ma not able to see pics on mobile devices. Please advise
0
votes
1answer
21 views

How to implement the regional to the Drupal content

I want create some features to help add regional to the Drupal content, exaple: Need show different content according to which the state (region of residence) is selected for a specific content on the ...
0
votes
1answer
8 views

node_object_prepare causes profile page for non-admin users

When I'm calling node_object_prepare in a module to create a user profile type node Drupal 6 kicks the user out unless they have admin permissions. How can I make node_object_prepare run regardless ...
0
votes
0answers
10 views

Node convert - convert file field

I've used Node_convert module version 7.x-1.2 I tried to convert one content types to another. In which i've fields title, body, file with custom location. When i tried to convert nodes, it converts ...
3
votes
1answer
186 views

How to programmally add nodes with next nid?

i want to create multiple nodes (from csv file) the csv is loaded well, and my table node contains many old records (with nid from 1 to 170) what i want is to record the csv's new nodes with nid ...
1
vote
2answers
44 views

How to call limited data items per page?

I am using one custom module, which is getting data from the database, with the following code. function rs_get_doors() { $doors = array(); $doors_nids = db_select('node', 'n') $doors_nids = ...
0
votes
1answer
13 views

Override name of file field link in Drupal field.tpl template

I have a file download field in a node. The field displays as a simple link with the name of the file that will be downloaded, eg: picture.png What I want to do is rename the name on the link, i.e. ...
1
vote
0answers
7 views

Default to “no limit” for maximum number of options in field type select

The number of cities and sectors "small cities" in Moldova is around thousand,so we have already exceeded the arbitrary 100 limit without half-trying. The limit causes problems when we translate the ...
2
votes
2answers
34 views

What to choose Content Type or Drupal Commerce or Ubercart [on hold]

I'm working on a project where we've people managing product in site (including product creation, editing, viewing, reviewing, etc.). These are not going to be techie people so the product management ...
1
vote
0answers
13 views

Views listing of nodes and node title as exposed filter

When I started this view I thought it would be simple… But it's not. I've an "Office" content type and a view (block) where are listed my "Office" nodes as teaser. First of all it could be great if ...
1
vote
1answer
17 views

Assign to node all child terms if parent term selected

I started to develop my first website with drupal. So far so good, I like this system, but I have one problem: When creating new node, I want to assign all child terms if I select parent term. Let's ...
-2
votes
0answers
33 views

Why do the social buttons link to the latest created blog node?

I have ten blog nodes on my front page; each node has 2 social buttons, and I use the Share Buttons by AddToAny module. All my social buttons link to the last blog node I created. How do I solve this ...
0
votes
0answers
21 views

Can't print node content [closed]

I can't get my content display anymore with this code: print render($content['body']) I have to use print $body[0]['value']; I having this code in a .tpl.php file called node--1.tpl.phpto theme a ...
0
votes
1answer
12 views

Article content special characters

This problem is node titles and content text. ' character shows like this mark. Poland characters there is only ? characters. Example: ŁOŚĆ shows ???? But breadcrumbs shows ' character like this: ...
0
votes
1answer
33 views

drupal_render($node_view); is not working

Node page is not loading once I add below code drupal_render($node_view); I was referring https://api.drupal.org/api/drupal/modules%21node%21node.module/function/node_view/7 and added below ...
0
votes
1answer
23 views

Adding Quick Tabs Programmatically to a node is not working

I'm writing below code in my node--type.tpl.php, but only empty page is loading when i load the node page.Can you please help in knowing my mistake. What i need to add to display quicktab and its ...
0
votes
1answer
15 views

How to translate metatag token into text?

I'm trying to get the data from metatag using node_load and for some reason when is using the default field, which is Token it gives me this ugly array. Instead of title and description that ...
0
votes
2answers
23 views

How can I alter the title of a node upon save?

I want to automatically set the title of nodes with content type ABC to the node ID. (I want to hide the title field from the form in the UI, and I don't care about titles for this content type.) ...
0
votes
1answer
17 views

How do I get the content type of a node entity from the $entity object?

I'm using hook_ENTITY_TYPE_presave() to alter the values of nodes upon saving, but I only want to do this for a specific content type. How do I check the content type of the $entity object? I looked ...
1
vote
2answers
39 views

Passing current node ID to the block template

I have a module with a custom block MyCustomBlock.php that get the nid of the current page and pass the value to the block template: $node = \Drupal::routeMatch()->getParameter('node'); $nid = ...
3
votes
1answer
32 views

Post image with raw json?

Using Content Type: application/json I tried like: EDIT: { "type": "article", "title": "Test article with image1", "body": { "und": [{ "value": "test body!" }] }, "field_image":{ ...
4
votes
3answers
125 views

Programmatically create a new node from an existing NID

Essentially I want to take a node and duplicate it. Take a node ID and programmatically create a copy of the node. I want to be able to edit the newly created node, and maintain the data on the old ...
0
votes
2answers
25 views

form in a .tpl.php file

This is the code in my template.php file. function studiga_theme_theme($existing, $type, $theme, $path) { $items['add_property_form'] = array( 'render element' => 'form', ...
0
votes
0answers
18 views

How to programatically create availability calendars for each node [Solved]

I'm working on a booking page on which i need to programatically add an availability calendar for each property element (node). All the data comes from external sources and is imported ...
4
votes
1answer
55 views

Content type or taxonomy term? [closed]

When we want some specification for a content, how should we decide whether to make that specification a separate content type or a taxonomy term? For example, I had to build a music store site. The ...
2
votes
1answer
15 views

The results within the page results do not lead to the nodes

I do not know how to treat this problem with Drupal. I hope you can help me. Suppose this. We have a glossary (Views), which shows the items of the content type called "Glossary". I created a search ...
1
vote
1answer
67 views

How do I alter the node entity?

Maintainer of Custom Publishing Options here... trying to figure out how to port to 8 in a clean way. https://www.drupal.org/node/2647410 I have config entities working, so I can define custom ...
3
votes
3answers
46 views

Count number of nodes to be output

I'm trying to figure out how many articles( nodes? ) will be displayed in a listing on our website, to use it to add classes to the elements that are rendered, so one can easily have different styling ...
1
vote
1answer
22 views

Why can't I programatically create a location field in a node?

I'm trying to programmatically create a node with a location field, but I'm not able to do it. I have done it in a similar project and it works fine. I use the Entity API module to create the nodes, ...
3
votes
1answer
72 views

Is there a way to remove node titles?

When I make a node such as a basic page I have to give it a Title by default. However, the Title also appears on the page when I am viewing it, but I do not want every node I have to come with a title ...
0
votes
2answers
16 views

Can you allow user to add another item without editing the administrator post?

I have a field which allows multiple inputs. What I want to achieve is to allow user to add another item only and not edit the content of the post of the admin. Thank you.
1
vote
2answers
40 views

How can I add extra information for each term reference?

I'm trying to create a content type that matches a product. The product can be made of several thing in different percentages: Eg. material 1: material 1.1: 5% material 1.2: 0% material ...
0
votes
2answers
39 views

How to add a new permission in “node_list_permissions”?

Is there a way to add a new item in node_list_permissions function in node module from a custom module. Let me explain my problem. I have a module say "audit" which will track node history, I have a ...
0
votes
0answers
10 views

Save node from serialized javascript form

In a node with aprox 500 fields, I need to submit just 7-10 fields. I've tried to submit the form with ajax POST with no success: the user is not logged in and permissions are not given to edit ...
1
vote
1answer
32 views

Can I assign a taxonomy to a content type's term_reference field at runtime?

I need to manage a few different types of objects, let's say "car", "pickup", and "van". These are similar enough (for my purposes) that I can define a single content type and associated code for ...
1
vote
1answer
40 views

Why is my Datetime field not saved?

I use the following code to create a node. $datetime = "2016-08-01 12:30:00"; $values = array( 'title' => $data['title'], 'body' => $data['body'], 'field_client' => ...
0
votes
0answers
19 views

how do you restrict user editing in title / node module element drupal

I want to restrict user from editing the title/node module element. How can this be achieved? Thank you.
0
votes
2answers
57 views

Programmatically updating a node

I can create a node using the following code: $node = \Drupal::entityTypeManager()->getStorage('node')->create($array); But if I have the node ID, how can I edit a node?
0
votes
1answer
12 views

Conditional patterns with automatic nodetitles

I`m using automatic nodetitles module to hide and autogenerate the title of one of my content types. My question is: Is it possible to use conditional rules to define which pattern to be used when ...
0
votes
0answers
16 views

Taxonomy saving order on node

Coming from a different CMS, I am diving little by little into the Drupal philosophy and I have already bumped into a problem. (being a beginner sucks :/ ) I have installed the hierarchical select ...
0
votes
0answers
9 views

Creating Nodes Programmatically but cannot edit fields using Drupal once created

I have a collection of nodes that are created programmatically after having created the content type using Drupal. This is the creation code... $node = new stdClass(); $node->title = ...
0
votes
1answer
49 views

How to load a entity or node in form builder class?

I want to load default values in my form. I am fetching the node of the table row from form list and passing it into route. my_form_eform: path: '/edit/{bar}' options: parameters: bar: type: ...
0
votes
0answers
37 views

How do I pass query string parameters on Drupal affiliate links?

I am using the drupal affliate module. I wanted to pass a query string along with the affiliate link the module provided, but every time a user visits the link the string gets ignored and redirects to ...
1
vote
3answers
165 views

Which method has better performance

I want to update some term id on some node (let suppose 1000 node),My changes is convert all news node with category(term_id) = 3040 to category(term_id)=5). I know I can do it with several methods( ...
1
vote
1answer
13 views

Adding like condition to db_select for section of string

What I am trying to do is find all of the basic pages where their titles contain 'Meetings' for example January Meetings Here is what I have tried so far $string = 'Meetings'; $query = ...
1
vote
1answer
28 views

How to handle hook_node_validate?

I am using some contirb module and in which hook_node_validate is used. I am overriding the function passed in hook by running CUSTOM_MODULE_node_validate. But the contrib module validate also keeps ...
1
vote
1answer
41 views

Assign menu programmatically upon saving node

I'm using Superfish module for my menu. I have product parent menu where I need to display the 3 categories as sub-menu. Those 3 categories has been added to the menu with the help of Taxonomy menu ...