Questions tagged [drupal-nodes]

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

In Drupal, almost every bit of content is a node. Nodes can be pages, videos, blog posts or polls. While comments are not nodes, they are tied to, and reference a node.

Treating all content as nodes allows the flexibility of creating new types of content. It also allows you to painlessly apply new features or changes to all content.

While nodes are implemented as entities in Drupal 7, should be used instead, unless specifically referring to Entity API functionality.

89 questions
2
votes
2 answers

how to avoid 'out of memory' errors when programmatically generating a lot of nodes in drupal?

I'm creating about 150 nodes programmatically and running into 'out of memory' errors when doing it all in a single request. (I have a menu callback that generates the nodes and calls node_save() on them.) Example: for($i=0; $i<150; $i++) { …
sprugman
  • 19,351
  • 35
  • 110
  • 163
2
votes
1 answer

How to show / validate error of a node listing page

i am trying to save form state in database and want to view in a listing page with its error validation. i.e, i want to validate a previously saved form state from my database. this is a node type form . i had already tried node_validate its not…
Lucifer
  • 516
  • 1
  • 6
  • 25
2
votes
1 answer

Drupal node reference

I am using two content types - test_parent & test_child In test_child there are two fields, both of type datetime And in test_parent there are two fields, week_no & 7 node references I am using node_save to save a new node. After saving a node of…
nikunj
  • 402
  • 5
  • 9
2
votes
1 answer

take the fields or the entire contents of a "node reference"

I created a content type: "battle" in which a field is a "node reference" that refers to an existing content from another content type("facts"). Now, when I go to thematize the node: "node--battaglia.tpl.php", how do I get some of the fields of the…
Antilope
  • 443
  • 2
  • 6
  • 17
2
votes
1 answer

When using Node Reference module, how do I populate the user field as well?

I have a node type A (equipment) that references node type B (service ticket). When creating a new service ticket, I have a CCK field from which I choose a user (customer) to whom this service ticket belongs. Then, I click the reverse link to create…
1
vote
1 answer

drupal node type hook_insert()

Im having some trouble with constructing a drupal custom node type. I created a module, sj_highcharts that will eventually use the highcharts api to deliver a chart of data. The point of this module is to create a node type that will display a form…
BDUB
  • 387
  • 6
  • 18
1
vote
1 answer

Drupal: Custom "Action" Button for nodes On a View

I have a view listing different "task" nodes called "available tasks" I wish to have a button for every listing that will enable the user to assign the "task" to themselves. My "task" node has a user reference field called "assigned to". So all i…
letscode
  • 11
  • 2
1
vote
1 answer

D8 PHP: Updating "Text (plain)" field value on node entity via set() and save() ignored when value changes from "1" to "01"

Goal: Programmatically change value of string field from "1" to "01" using entity ->set() and ->save() When attempting to update a field on a node programmatically (via a custom module's cron hook), the initial value of the "Text (plain)" field is…
1
vote
1 answer

Preprocess Node: Function that calls on all node types

In preprocess.node.inc file, each node type calls its corresponding preprocess function. mytheme_preprocess_node__article for article, mytheme_preprocess_node__bio for bio, etc. Is there a function that runs on all these node types? I am trying to…
qtgye
  • 3,580
  • 2
  • 15
  • 30
1
vote
1 answer

Drupal 8 - Clone nodes to node translation

I have a website in English. I need to put all the nodes of all contentypes into another language so that the client is only responsible for entering and modifying data. I know how to go through the nodes, I know how to create a translation of a…
Javier
  • 395
  • 3
  • 18
1
vote
1 answer

Node getting created but not inserting into db in Drupal 7

I have Drupal 7 site. I am creating node in my module as follows:- $newNode = new stdClass(); $newNode->title = "Hello Node"; $newNode->type = "product"; node_object_prepare($newNode); // Sets some defaults. …
Kgn-web
  • 7,047
  • 24
  • 95
  • 161
1
vote
1 answer

how to organize drupal content in next case

i need help how to organize nodes of drupal cms. i have three kind of users (three additional user groups). nodes are accessible only if users are logged in. users from first group can access to all nodes, that are created by all users (all users…
user198003
  • 11,029
  • 28
  • 94
  • 152
1
vote
2 answers

Drupal 8 Preview button not working

When using a custom front-end theme, the preview button for my content stops working. It just redirects to the content overview page. Am I missing something in my theme that allows me to use the 'preview' function?
1
vote
2 answers

Add custom field to content type

I create content type tv-rate-plus-ethernet via admin panel, now I neeed add to this content type custom field channel_reference, where channel_reference field return checkboxes list with channel data from custom table ks_channel. Example we have…
1
vote
2 answers

Drupal redirect user (also uid 1) to "page not found" for unpublished nodes. Cannot view, cannot edit

I'm having some strange behaviour on one of my Drupal sites. Usually when I'm logged in as admin (uid 1) I can always see and edit nodes even if they are unpublished (makes sense). However on one of my sites I always get redirected to the "page not…
kulvik
  • 11
  • 3