Skip to main content

Questions tagged [nodes]

The most basic form of content on a Drupal site is a node.

Filter by
Sorted by
Tagged with
2 votes
2 answers
883 views

creating nodes with many to many relationship type with some fields?

This is in line with How to structure a "many-to-many" relationship between nodes. To keep things in line with the example from the linked thread, what if i was a book warehouse and i had ...
4 votes
3 answers
5k views

Node add form alter & submit custom field

I have a content type "event" with a field called "field_pricelist". It's a dropdown with no values, I add the values when I alter the form. The values come from a custom table (install / schema) in ...
2 votes
1 answer
444 views

Change the sorting order used for Book nodes

How can I change the order used for Book nodes, which by default is based on weight and title? I have a set of nodes displayed inside a page that use a structured book. I want to display them ordered ...
2 votes
1 answer
1k views

Unable to set file upload destination private when programmatically creating new content type with file field

I am creating a module to upload video to an in house media converter - as part of the module installation I create a new content type called "user video" which has a file field as part of it. I need ...
0 votes
2 answers
908 views

View not displayed for other roles

I have a block view that displays own articles created (this view is inside a panel page). But this view didn't displayed for other users except administrators, or when I check the permission 'Bypass ...
0 votes
2 answers
1k views

Problem adding button to custom content type form

I am trying to add a cancel button to a custom content type form (typename/type/add). I have looked around and there seems to be two main ways of doing this: Creating a template file with the name ...
1 vote
1 answer
535 views

Open Atrium 2: comment forms not appearing on pages

Situation: Recently created a fresh Open Atrium 2 installation to replace an old AO1. No content from the old OA1 database has been migrated, we're making a fresh start. Some content (a few pages) ...
1 vote
2 answers
606 views

How to have separate private comments for nodes apart from the general comments?

I have a specific requirement. Apart from the general comments which everyone can view or post for my custom node I also require private comments thread which will be shared only by the node created ...
1 vote
3 answers
991 views

How to make galleries relative to particular nodes?

I have a site with news and I want to make it possible for admin to add image gallery to Articles (nodes) the admin wants. So, the idea is to make gallery image field for every content type from which ...
2 votes
2 answers
592 views

Assign a node to an organic group

Programmatically assign a node to an organic group is following my previous question which I have found the solution for Drupal 7, but I am now looking for the same issue in Drupal 6. How can I ...
-2 votes
0 answers
23 views

Error deleting content in the main translation "ES"

I have a Drupal 10 site hosted on CentOS. I have a problem and it is that the content created with the main translation which is "es", is not deleted. The log does not return anything nor ...
0 votes
2 answers
1k views

Cannot use object of type stdClass as array error in node save

I built a custom form and one of them is of type geocode with lat/lon fields. When I try to save the node I receive the following error: Cannot use object of type stdClass as array in /var/www/...
0 votes
1 answer
813 views

Reply for comment redirects to the next page

I am using advance forum module and having commenting functionality for the forums. But the problem is when I use to reply to the comments it redirects me to the next page. Where I want to display a ...
2 votes
1 answer
3k views

Validating node creation / edit form

I'm using form_alter to play with the node form for a specific content type. This content type has many different fields and I'm also using Field Collection module to organize all these fields & ...
2 votes
3 answers
956 views

How to hide specific term/field value on the node?

Is there a way to hide a specific taxonomy terms (specific field values) on the node? (not hiding field/vocabulary altogether, just some values). For instance, there is vocabulary "Location" with a ...
0 votes
3 answers
821 views

copy term reference from one to other field

I have two fields (fieldtype = term reference) in the same content type and I would like to copy the settings from the first to the second one. After searching for a solution I found this thread but I ...
3 votes
1 answer
643 views

Is there a way to add node grants to anonymous users?

I want anonymous users to be able to access nodes that are promoted to the front page. (They can't access to nodes that are not promoted.) It seems hook_node_access() isn't seem called for anonymous ...
2 votes
1 answer
2k views

Image preview thumbnail does not display

Drupal 7. When adding a core image field to a content type to display an image, the preview thumbnail does not display on the edit page when uploading an image. What appears after clicking on the "...
0 votes
1 answer
651 views

How to get menu tree from a node to build a customize breadcrumb?

I would like to build a custom breadcrumb based on node relation from entity reference. For example there is a book node that has menu hierarchy: Book |-chapter 1 |--sub chapter 1.1 |---sub sub ...
0 votes
1 answer
857 views

View Bulk Operation with custom action

I have a custom action to update some table values base on node content selection. My custom actions are listed correctly on bulk update select box. But I can perform operation some random node ...
0 votes
1 answer
49 views

How do you theme the book module?

I am rather new to Drupal and am trying to understand how the themes, templates, layouts, and fields work. When editing the content type in the UI on the website for the book type, and "manage ...
0 votes
4 answers
520 views

Create two nodes with url aliases on one submission

I have a content type "News". With URL aliases pattern and token the URL is like this: news/[node:title]. Is it possible to create two nodes on one submission with different URL aliases? Let's say on ...
3 votes
2 answers
1k views

"This page was last modified on" code not displaying

I added the following code to my node.topl.php but nothing is displaying on my site. What am I missing? <?php if ($submitted) { echo 'This page was last modified on ' . date( "F j, Y",$node->...
2 votes
1 answer
683 views

Data in field_revision with Create new revision unchecked

The field_data_myfield and field_revision_myfield have the same row entries (D7 fields). All of my content types have the "Create new revision" unchecked. Is this how it's suppose to work? If yes, two ...
1 vote
1 answer
770 views

Creating nodes from json including image field upload

I am trying to create a node programmatically from the data(JSON) sent by my front-end template. <input id="title" name="title" type="text" > <input id="body" name="body" type="text"> <...
1 vote
1 answer
412 views

Customize admin content type page design

i have created template file for my contenttype wallpaper but i don't know how to get form design in that page. for example my content type name is wallpaper, so i create template file for page--...
1 vote
2 answers
71 views

How to get the title of a referenced entity with `?_format=json`?

I have a site https://www.huytonweb.com/ the front end is in Next.js and the back end is Drupal 10 CMS. The front end will access the data from the back end using ?_format=json (like https://cms....
0 votes
1 answer
468 views

entity_load based on language selection

I have a node for different language, but I would like to load node for "en" language only using entity_load after firing entity query. How can I achieve it using this function in Drupal 7
0 votes
1 answer
526 views

How to get the publishing and menu fields from the node edit form in the "Manage fields" tab?

I am wondering what is the cleanest way to customize the core node edit form fields like the publishing and menu options fields? They do not appear in the Manage fields tab, otherwise I would be able ...
1 vote
2 answers
985 views

Node Add / Edit Options Vertical Tab Problem

For just one of my content types -- the built-in Article content type -- the node option vertical tabs at the bottom of the add / edit form are not displaying correctly. As shown in the attached ...
2 votes
2 answers
2k views

Altering nodes title value

I am trying to alter the title of my nodes to prevent URLS appearing in any title. This is the code I am using. function mytemplate_preprocess_node(&$variables) { $node = $variables['node ']; ...
1 vote
1 answer
980 views

How to calculate the average ratings for the post when the user submits 3 field ratings?

I need to implement ratings in my site. I have user five star rating and voting API module, I created a content_type with "beach", and created some field in the manage field settings, name, id, etc. ...
7 votes
2 answers
10k views

Accessing $language inside a node content

Normally, I would get the active language used for a page from the global variable $language. I have a node whose body is using the PHP code input filter. Within that PHP code, I am not able to get ...
0 votes
1 answer
50 views

The node ID for newly created nodes is fetched but the node is not loaded

I have a custom module that loads all my nodes from type demarche_en_ligne, it worked fine for a few years but now when we create a new node it won't load. For instance I created a new node and ...
0 votes
2 answers
1k views

How to output custom field of Content type in page.tpl.php?

I want to display a custom field which I created in my custom Drupal theme. The field I created called "Startnummer" so the machine name of the field (I didn't change it) was created as "...
2 votes
2 answers
2k views

How to display comments and comments form on custom node pages

I am new developing my first ever site in drupal. Along the line, due to the requirements of the project I had to create custom node pages (template files) instead of the default ones in drupal. For ...
5 votes
2 answers
3k views

Content type title field not available in manage display

I have two customized content types, both having a title field. Yet this field does not appear in the Manage Display panel. Moreover, they are not displayed when the content is displayed. Is this ...
2 votes
1 answer
413 views

Create an Action on 'node_insert' or 'node_presave'

I created a new action on a new node being created, it shows up in my triggers and the action gets triggered. Works so far. Problem is trying to add additional functionality using some submitted field ...
0 votes
2 answers
1k views

Provide a default image for image field programmatically at theme level

I have an image field on a node, which will not always be populated. In the case where the field is empty (no image), I want to alter the markup to display a random image which always exists in a ...
0 votes
1 answer
1k views

How can I programmatically restrict node access?

I'm using Drupal 8 with the nodeaccess module. I'm able to set the node grants with the form. I also have a custom module which imports new nodes. These new nodes should be shown only to certain ...
0 votes
1 answer
838 views

Migrate multiselect taxonomy values from node with csv

I want to import companies with csv into Drupal 8 with migrate_source_csv module. CSV: company_name,company_categories,company_size "Dummy Name","Category 1";"Category 2","2 people" How to ...
0 votes
1 answer
630 views

Topics are not getting associated with forum

I am testing out the Drupal 8 core Forum module. I am using a theme that I based off of Acquia Lightning. I have successfully installed the module and added Containers, Forums and Topics. My issue ...
0 votes
2 answers
386 views

Linked entity references in a content type

I am unsure if this is possible in Drupal 7, but here is my problem: I have 3 content types, A, B and C. B and C refer to A through a field field_A (entity reference). C refer to B through a field ...
3 votes
1 answer
561 views

What methods are available to resolve "The node.field_name field needs to be updated."?

When Drupal status report says field “field_name” needs to be updated I found out that it sometime hard to resolve. In the past we used to have entup but that was removed. The following works in many ...
1 vote
1 answer
688 views

Content type disappears in content list

I created a taxonomy with the same name as a content type. Now the list shows with no content type on the nodes with that type. I have since renamed the taxonomy, but there is still an issue. When ...
0 votes
1 answer
1k views

How can I insert fields from custom content to custom form?

I have a problem with form. I had to create a custom content with fields. User can put variables into those fields and save to database, for example "Anna" into column field_student_name in ...
0 votes
1 answer
675 views

how to save checkboxes values in node programmatically

i want to save checkboxes values in entity reference checkboxes field with node_save : $form['wrapperrr']['id_offre'] = array( '#title' => t('Liste des Offres'), '#type' => '...
0 votes
2 answers
399 views

Children of children not appearing in book navigation menu

UPDATE: I should mention that this is concerning the Book Navigation Block I'm using the book module to display children of a book in a side menu. It displays the title of the book and it's children ...
0 votes
2 answers
550 views

How to add extra data to a programmatically created node

Using Drupal 8 i am importing data from an external source and creating the node programmatically from the controller: $node = Node::create(array( 'type' => 'article', 'title' => 'some ...
0 votes
1 answer
651 views

Breadcrumbs for some content types

I'm using breadcrumbs generally throughout my Drupal 7 site and all working well. However, for news articles, I don't want to have to add each into the menu structure as over time, this will be a ...

1
2 3 4 5
152