A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [nodes]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
692 views

Display articles on home page in a news site - layout style.

We are creating a new site for our online news platform with drupal 7, and want to display al our recent news articles in a news site layout style. (like our local news paper and many other news paper ...
0
votes
1answer
7 views

Send view field in URL - Drupal

I have a search page created with embedded filters in Drupal 8 View. In the list of fields I have a fields - [Field_program_id]. I also have a button 'Learn more' when clicking this button I want to ...
2
votes
1answer
753 views

Override a node page of specific content with views page

I want to create a views for overriding the node page for specific content. For example, when I click the link of a node in a list page, by default , it will go to the node page (e.g node/1), but I ...
1
vote
2answers
436 views

How to extend a specific node type form?

I am searching a way to overwrite the NodeForm to get a class per bundle. Actually EntityForm manages the form for all entities. NodeForm extends it and manages the forms for all nodes. I wrote a ...
1
vote
1answer
1k views

Create an expiration date field that auto expires

We are currently migrating a Drupal 6 site to Drupal 8. We have a view that shows a table of files uploaded through the file depot. One of the columns on the table was an Expiration Date. In Drupal 6 ...
1
vote
1answer
642 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"> <...
0
votes
1answer
1k views

Getting values on twig node template

I have installed ECK module in my website. Using it I have created a "report eck" entity in which I have different bundles like section, notes, etc., each containing different fields. I have my ...
2
votes
1answer
603 views

Term lineage in simple Hierarchical select module

I'm working on a project using Drupal 7. I'm using simple Hierarchical select module. How its possible to attach the parent lineage to the node? Is there any way to do so using simple Hierarchical ...
0
votes
3answers
1k views

Max length of text field

How can I increase the max lenght of Tab-Title ?
2
votes
2answers
2k views

How do you rename the MACHINE NAME of a CONTENT-TYPE?

I have this content-type that i created titled: "Engineering". 1500 hundred nodes later management wants me to rename it : "Staff". I can easily rename the label but how do i rename the machine name? ...
2
votes
2answers
577 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 ...
0
votes
1answer
744 views

token_filter module: [node:nid] for custom block?

Drupal: 8.1.7 Module: token_filter 8.x-1.0-beta1 I have a custom block with a Text format that has Global and entity tokens are replaced with their values enabled. The custom block has this value: ...
0
votes
2answers
2k views

Insert values into a node fields with entity wrapper

I've tried to use entity wrapper to create a new node and insert the values into the fields, but I get an error. <?php $values_entity = array( 'type' => 'anuncio', 'uid' => $userid, ...
4
votes
2answers
1k views

How to programmatically add content to a group in the Group Module?

I'm using the Group module. If I have a group type such as Project, and I have a content type such as Article, and I programmatically created a new article node using Node::create(), how can I in the ...
0
votes
1answer
18 views

how disable edit for a certain content type, and a certain role,

in a drupal 7 site i have been given to maintain, it seems that permissions are not working as expected. I check and uncheck the buttons for a certain user role, but that user role always has the ...
0
votes
1answer
17 views

Page Content Type: Displaying error in Preview mode

Whenever I am creating or editing my page Content Type and go into preview mode I see these errors: And here is the code for it: The dark theme does not show up in preview mode though. However, if I ...
0
votes
1answer
40 views

hook_node_update not working

I placed the following function in my custom module. function MYMODULE_node_update($node) { if ($node->type === 'page') { $node->title = 'test'; } } When editing and saving a node of ...
1
vote
2answers
579 views

How to render multiple values of node reference in the form of an ordered list without views?

I have a node reference field that references another node and has multiple values. I want to get an ordered list of the output of that field and display it in the custom node template. I am rendering ...
0
votes
4answers
66 views

Restrict node to be shown only in a view and not by its url?

I created a node which has an entity reference to select a user. Then, I created a view to show the node only to the user referenced in the node. This works fine, but the problem is that the node can ...
2
votes
1answer
21 views

Why would a multilingual site sometimes say “Save (this translation)” and other times say “Save (all translations)”?

We have a multilingual Drupal 8 site supporting 17 different languages and many more localized versions of those languages. I have been noticing that sometimes when I am editing a node it says "Save (...
1
vote
1answer
2k views

Advanced forum email notification to both users and administrator

I used advanced forum in one of my site, working all good except 1 thing i couldn't able to find how to notify my users and also admin through emails about forum posts updates
0
votes
1answer
85 views

Node content is not shown

I installed DrupalGap. Everything works fine so far, except that the node body is not displayed. I have none of the mentioned interfering modules installed. I also tried with a fresh Drupal 7 ...
2
votes
2answers
31 views

How do I add fields to the sidebar menu when creating/editing nodes?

I would like to add to the sidebar menu on the create/edit node pages. How would I do this? I would like to do this in order to make the content creating/editing a little cleaner and easier to ...
2
votes
2answers
751 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 ...
0
votes
1answer
377 views

Templates and hooks by Universally Unique IDentifier (UUID)

I'm looking for a solution to migrate content between environments (dev->staging->production) and currently I think I'll use UUID and Node Export (as far as I see UUID Features is still in alpha and ...
2
votes
2answers
477 views

How to display custom data array via Twig [closed]

I've created service which gets the raw data from custom content type. It looks like this : Array ( [front_page_slider] => Array ( [1] => Array ( ...
1
vote
2answers
5k views

Print author details for a node

How do I print the author details for a node? In particular, I am interested to the following values. Author picture Name Description In Drupal 7, I would use this code. <?php print $author_data[...
0
votes
2answers
853 views

How to set body content using preprocess_node?

I need to alter the body html for a specific content type which will be processed by the Pagination module. I think preprocess_node will work, but I'm having trouble figuring out how to change the ...
1
vote
1answer
672 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 ...
1
vote
1answer
932 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. ...
0
votes
1answer
19 views

How can you identify all nodes that use a certain paragraph type or template?

In Drupal 7, given a custom paragraph bundle and an associated template file, is there a way to list all the nodes using that bundle? Or, if it's any easier, a way to do the same for a specific module ...
4
votes
2answers
408 views

How to Auto Publish nodes based on set interval?

I have nodes being generated from a Feeds import on a periodic basis, however when they are imported I would like them to be queued to be published on an hourly basis (or x minutes) I have looked at ...
0
votes
1answer
414 views

How to hide a field when its value is set to zero

I want to hide a field on a node when its value is set to zero using a content type. Here is what I had done so far to achieve my goal. function pay_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { ...
2
votes
2answers
834 views

How to filter a view based for the current user based the value of custom fields in his profile and fields in the list of items viewed

I'd like to implement Views that conditionally show or hide item listings of content nodes to the current User based on: (1) value(s) in the current User's profile and (2) value(s) in the profile of ...
1
vote
0answers
36 views

Is it possible to modify the node edit form in a constraint validator?

Is it possible to manipulate the node edit form after it fails a constraint validation? My scenario is as follows if a user attempts to save a node and fails the constraint validation a validation ...
1
vote
2answers
409 views

Auto-populating Storm Invoice

I'm using Storm for a bunch of its varying functionality, and figure it thus makes sense to use its Invoice module as the final part of a multi-part project (see previous SO post). Everything in ...
0
votes
1answer
453 views

How to use a terminate kernel event to log page access statistics?

In Drupal 7 hook_exit is implemented in the Statistics module to gather statistics for page accesses. This change record suggest the equivalent in Drupal 8 is to listen for kernel.terminate events. ...
4
votes
3answers
3k 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 ...
0
votes
2answers
891 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 ...
1
vote
1answer
27 views

Why isn't the value for a new Boolean field rendered?

I added a new Boolean field to a content type. For some nodes, I did set this field. Still, the field value is not shown on the node page. Why? I realize that, as long no value is set for ...
0
votes
1answer
739 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 ...
1
vote
1answer
361 views

How can I override the default forums and container pages with a view?

I need to override the default pages that come with forums with views. I need to still include the default info as per the screenshots. I can't seem to get the right relationships and the correct ...
0
votes
2answers
952 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
2answers
611 views

How to set and inherit variables within different twig templates?

I'd like to set a variable in my node.html.twig template: {% set title = label %} {{ content }} The content consists of one field visible only, which has it's own template: file-link.html.twig How ...
0
votes
1answer
173 views

Implement javascript inside body, error: jQuery is not defined

In Drupal 7, I had js-output template. I define the template output as javascript. This is used for our front end person that can easily input javascript without touching backend. <script> <...
2
votes
1answer
24 views

How can I check to see differences across my multisites?

Currently, we're using Acquia Content Hub to syndicate content across our sites with a spoke and wheel syndication architecture. We essentially use a single site (that content editors use to create/...
1
vote
2answers
335 views

Restrict delete operation on node refenreced by other nodes

I am using References module to make a node reference in my course content type that reference to school content type (a course belong to one school and a school have many courses). Now what I want ...
0
votes
0answers
43 views

Query params in url does not appears in node url after updating

I need to append node path programmatically to make the url look like [the link]?utm_source=Home%20Page&utm_medium=website&utm_campaign=AB%20Test&utm_content=Headline A I'm updating node ...
1
vote
2answers
986 views

Body field data disappeared

EDIT: Looks like I accidentally changed number of values for this field to 1 - it should be Unlimited. It's working now, thanks everyone. I don't know what I did but I noticed that all (except the ...
2
votes
2answers
400 views

How can I always have the node title display on top of a background image? [closed]

With Drupal 8, the page title is available through a block now. We have several content types where we have an Image field (field_image) and we constantly have to write templates per content type to ...