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.

90 questions
13
votes
3 answers

Render a Drupal node

I would like to show a node inside another node. So I retrieve the node id of the second node and I would like to render/print/... it inside another node. But I'm not sure how to do this. I've tried drupal_render, node_view, print,... but with no…
Michiel
  • 7,213
  • 16
  • 57
  • 110
10
votes
2 answers

How do I make a node link directly to its file contents in DRUPAL 6?

I have a menu item called "Products" which when clicked displays all nodes created by the "product" content type. Every "product" node has a file attachment field with a file attached. If I click on a "product" node, it takes me to the node as…
Granwille
  • 149
  • 6
8
votes
4 answers

Drupal 8, get programmatically the list of fields of a custom content

I want create programmatically a custom content (custom content created via the admin UI). But, before the creation, I want check programmatically the types of fields of my custom content My custom content contains a field "body" (type text), a…
matthieu lopez
  • 1,558
  • 4
  • 24
  • 61
7
votes
3 answers

Drupal - displaying the title of the node within a block

I'm needing to dynamically display the title of a node within a block. I would have thought this would be simple, but all the code snippets I've tried don't seem to work (e.g. title; ?> ) I've checked and tested that the PHP…
james6848
  • 1,597
  • 2
  • 21
  • 37
4
votes
2 answers

Sorting nodes visually in Drupal

I have created a photo gallery for several web sites using CCK. I created a new content type and added a numeric select list field that allows the client to change the order of the photos in the gallery (views with a jquery lightbox). The problem…
Mark
  • 1,107
  • 2
  • 12
  • 24
4
votes
3 answers

Recipe for adding Drupal node records

I am looking for a recipe for adding Drupal node records. I have identified three tables. node_revisions nid=249 - vid + 1? vid=248 - auto-increment node: nid=250 - vid + 1? vid=249 - auto-increment content_type_my_content vid=248 - from…
bert
  • 287
  • 6
  • 14
4
votes
1 answer

drupal 7 file_save_upload returning false

I have a custom form, with a field for the user to upload an image file (their logo). In the form validate hook, I've implemented file_save_upload, which is continually returning false. I can see that the file is in fact being saved in the correct…
valen
  • 777
  • 1
  • 13
  • 38
4
votes
4 answers

Drupal 7 How to trigger/hook the node "Publish" event?

In Drupal 7, I want to add a additional process when a node gets Published. How can I get triggered when that node's "Publish" event fires? Is there any hook for node "Publish"?
夏期劇場
  • 15,969
  • 40
  • 121
  • 208
3
votes
5 answers

Creating nodes programmatically in Drupal 6

I have been searching for how to create nodes in Drupal 6. I found some entries here on stackoverflow, but the questions seemed to either be for older versions or the solutions did not work for me. Ok, so here is my current process for trying to…
user131441
2
votes
1 answer

add some custom information to node drupal 8

I need to update my referential entity with new values ​​that are inserted every time a user visits the page. I tried to use this code but unfortunately, the latter does not add a value but replaces all of them. I am attaching the code that I used…
King Greg
  • 25
  • 5
2
votes
1 answer

Drupal 8 use suggested template when programmatically rendering node

I'm rendering a node programmatically from within a Block class in a Drupal 8 module and I would like to be able to use one of the suggested template names I get in the generated DOM to override how the node is rendered. Unfortunately, any suggested…
2
votes
2 answers

Drupal 8 - Get a node url in twig

I have a content-type referring to an other content-type (a pair of articles), which refer to a content-type (an article). I would like to redirect to the article url when the article block is clicked on my twig, so I came up with the code below {%…
Tibo
  • 373
  • 4
  • 17
2
votes
2 answers

Drupal: How to Remove/Redirect node listing page

I recently launched a Drupal site and noticed, after looking through my admin logs, that there existed a page in which a summary of every node on my page could be viewed. I found that this page was accessible at [mysitename]/node?page=1 and showed a…
imgrgry
  • 620
  • 1
  • 5
  • 11
2
votes
3 answers

Loading the previous revision of a node

When you get a node, how do you load the previous version (revision)? I know how loading a revision but not how getting the previous revision number ($node->vid is the current revision). thanks
gagarine
  • 3,840
  • 25
  • 34
2
votes
3 answers

Placing block inside a node (positioning block between specific elements in node's content)

Basically I created a webform and enabled it as a block, now I want to put that block inside a specific node. I can do that by placing it in a 'content' region and defining the specific node BUT it displays at the end of the content. Now how can I…
1
2 3 4 5 6