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

Drupal defining node grid data

I need to define a 10*10 grid of nodes. Each cell in the grid has to contain exactly one node. A newly created node gets inserted into the next available cell and a new node can not be step to occupy an occupied cell. That's the scenario I am trying…
sisko
  • 9,604
  • 20
  • 67
  • 139
0
votes
1 answer

How do I store content in Drupal 9 about wrestlers and their entrance themes in such a way that a theme entry can be "borrowed" from another wrestler?

I am building a site in Drupal 9 that will, ideally, list the entrance themes of professional wrestlers. I am having trouble figuring out the architecture of such a site given the following requirements: Each wrestler/team is a node (most likely a…
TerranRich
  • 1,263
  • 3
  • 20
  • 38
0
votes
2 answers

How to load Product from nid

How Can I load a Product from the db based on the nid?
keyoke
  • 1,209
  • 12
  • 26
0
votes
1 answer

Set values for default address fields in Drupal 8

I need to set values for default address fields(langcode, country_code, administrative_area, address_locality ect.) when I create a node. I used below code in the submitForm function of a Form class which is extends by Drupal\Core\Form\FormBase…
Hemantha Dhanushka
  • 153
  • 1
  • 5
  • 14
0
votes
1 answer

Drupal node checkbox checked even after deleteing from database table

I have written a code in drupal that after hitting node edit a delete query will run and unselect the radio button to display an alert each time. The query is working fine but the radio button got unchecked after second time reload. I want to…
Souvik Das
  • 49
  • 2
  • 10
0
votes
1 answer

Drupal 7 : View filtered with taxonomy / user relation

I have a view "news" which is listing nodes from "news" content type. This content type contains a field "countries" which is multiple. So, my news "Test 1" will have a field countries like this one : France, United Kingdom, Spain My users have a…
Pauloscorps
  • 564
  • 1
  • 6
  • 16
0
votes
1 answer

Where to place presave functions?

I need to manipulate a content type (people) before being saved from ADMIN. I need to save the name + surname in the title I know the presave functions (hook_node_presave or hook_entity_presave) should be used. My problem is where should these…
Javier
  • 395
  • 3
  • 18
0
votes
1 answer

extracting Drupal node and menu relationships with SQL

I am trying to untangle a complicated multi language Drupal site with custom SQL reports. By poking around I bit I was able to construct this SQL statement which gives me all nodes and helps me find translation relationships. SELECT node.nid as…
0
votes
3 answers

Using URL Alias with hyphen (-) to create a node template on Drupal 7

I have a basic page with the URL alias "empezando-ahorrar" and I need to create a node template for it but I can't use the nid. I've made it work when the alias has no hyphen (empezandoahorrar) but I can't make it work with the hyphen. When the URL…
ZenemiG
  • 15
  • 3
0
votes
1 answer

Relationship between noderefernce fields

I have two content types: Region and City, Region node includes City node, every City node is related to some Region node, how I can create relationship for this situation: when I create Region node and refer a City node in a field, all City nodes…
Artyom Kondra
  • 105
  • 1
  • 8
0
votes
1 answer

500 Internal Server Error : An error occurred(0): Unknown data property field_group_privacy

I am trying to Create Services to Create Node Type Discussion in a Group using Services Module, but getting the error : 500 Internal Server Error : An error occurred(0): Unknown data property field_group_privacy In the Header I have…
Malik
  • 45
  • 1
  • 1
  • 7
0
votes
1 answer

Drupal7 Node table query contents

I migrated some 20,000 nodes from d6 to d7 and when i check on the front end some node of content is not present so i would like to know the query to check the node id whose content is null or empty...
Chetan
  • 29
  • 7
0
votes
1 answer

Drupal 7: Populate node fields with values from $form

I would like to know if it's possible to populate a node fields with the values from form_state or something like that. Basically what I do is to show a register form merged with a form from a Content Type. I do that by using field_attach_form().…
mihai
  • 43
  • 8
0
votes
1 answer

How to filter field when adding node in Drupal

My Drupal site has form for adding node. Node can be added by guest, so I need to filter field 'phone'. Give me advice how I can add array with prohibited phones. If completed form is sent with phone from photibited array Drupal wouldn't have to add…
966p
  • 535
  • 2
  • 7
  • 17
0
votes
2 answers

How to retrieve field value from another tpl in the template.php file for drupal 7?

I need to retrieve the field values in 1 page.tpl.php on my template.php. The normal way to retrieve a field in a page.tpl.php is: $field = field_get_items('node', $node, 'field_name'); $field_name = field_view_value('node', $node, 'field_name',…
Moushrat
  • 21
  • 8