Questions tagged [nodes]

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

Filter by
Sorted by
Tagged with
-4
votes
0answers
18 views

Cannot change node url value [on hold]

I am using drupal 8 and php 7.2 in windows 7 How can I change or replace url value in node field ?
0
votes
2answers
25 views

How do you hide a page?

I'm using Drupal 7, can you tell me how to hide a page if the page does not have a menu settings at the bottom?
-1
votes
0answers
26 views

Finding a page to edit? [closed]

I found a page on my site through a Google search. I can not find it in admin. I looked in the page's code and there is no node number for the page. In /admin/content/node I have looked at the pages ...
0
votes
1answer
23 views

Select all nodes, where date is greater then current date and repeat event option is empty

I have content type "event". In this content type I have a date field, provided by the Date Recur module. At the result I have range of the dates: Event start and end date. Also Date Recur provides an ...
0
votes
0answers
13 views

How can I list the previous published revisions of a node? [on hold]

I have workbench moderation and revisions enabled on my content type. How can I list all previous published revisions of a node in views? I have created a node with revision 1 and published Then I ...
0
votes
0answers
17 views

Show who published a revision/page - publish history [duplicate]

I would like to know which user published a page or revision of the page and when was it published. Is there something like publish history? In the image we can see only the revision (date and author ...
-3
votes
1answer
43 views

Create module that create Content Type [closed]

I'm developing module that creates a content type. I saw the same question and there was a solution. I had tried it but it didn't work. job_post.info.yml name: Job Post description: A job posting ...
0
votes
1answer
28 views

How to un-cache a specific node field (also for anonymous)

My goal is to replace (by a custom markup) the render array of field_product when some conditions are met. (in a ecommerce site) Ex: If this is the weekend or if it is after 12pm the field_product ...
0
votes
1answer
39 views

Scoping an admin link to only show for certain node bundles

I have 2 node content types / bundles, A and B. each A has a relationship with multiple Bs. When on the edit page, node/%/edit, for A, I want to show a link to the list of related B so that an editor ...
0
votes
1answer
39 views

Programmatically remove content from a group

In order to add a node to a group in Drupal 8, I use the following code. $group->addContent($node, 'group_node:article'); Now, for removing content from a group, I have tried $group->...
0
votes
1answer
81 views

Can't render node view mode programmatically

I try to render an HTML data from my node view mode but unfortunately, I have some small progress. I did some searching and modification on the others code Here. I have this now. $nid = 145; $...
0
votes
0answers
15 views

How to refer to the node created date in Computed Field PHP

I am using the Computed Field module in D8. I am trying to compute some dates using the node created date as the start point. As my first try, this code works: $valuein = $entity->field_datefield-...
0
votes
1answer
28 views

Field contains list and values of it are shown in one symbol

I'm developing a drupal module and there's a problem. I need to make a content type with some fields and one of them should have list with string values. But when I try to create content and choose ...
0
votes
2answers
20 views

Display selected fields from referenced node rather than just referenced node title

I've searched for an answer to this, I can't find it for the life of me. I want to in a node display additional selected fields from referenced nodes, not just the title field of the referenced node. ...
1
vote
0answers
40 views

How to display the parent node or product of a comment?

I installed the Message module on my site. I created a custom module that created a message when a comment is created. https://imgur.com/a/4OLhGlL How to display the parent node or product of a ...
1
vote
1answer
43 views

Change field label used in node display

I have a custom content type in Drupal 8.6.x. I want to be able to change the text used for a field label based on the value of a taxonomy term reference in the node. For example, I want to change ...
1
vote
1answer
21 views

Where are the settings for read time module in admin area? [on hold]

Installed the read time module and can not find any settings in the admin area. The description says its configurable, but where? I can see the field in manage display, but the article is not ...
-2
votes
0answers
20 views

Showing field information in node edit

I am currently showing the data from different content type (Products) to another content type (Orders) through the module "field collector" and it is working fine. But, it is showing the field_id ...
0
votes
0answers
25 views

When I try to edit nodes from a specific content type they throw an error

When I try to edit any node from my Page Template content type it gives me a blank screen with this error, The website encountered an unexpected error. Please try again later. then when I go to the ...
1
vote
1answer
30 views

Get unsaved node from route parameter

What I want: In hook_media_presave I want to set a field value according to the same field on the referring node. By the referring node, I mean the node where the media entity is created through an ...
1
vote
0answers
20 views

Attaching webform to node

I have a question regarding the webform module. Is there a way to automatically attach a webform to a type of content? I have done something similar through adding it as a field in that content type, ...
0
votes
1answer
51 views

Node field not sanitize on render

I have a form for users who want to add new content on my Drupal 8 website. I render node field on a twig template : {{ node_field_title.value }} But field are not sanitized by Drupal. Is it the ...
-2
votes
0answers
25 views

How can I avoid recreating a node?

Let's say I want to save a node programmatically and the following function will be called inside a foreach loop for each event object. Therefore, a event object will be saved as a drupal node with ...
0
votes
0answers
12 views

Why are only some nodes represented in simplenews_statistics table?

I've only got 5 nodes represented in the simplenews_statistics table. This means that only 5 nodes produce anything other than a blank page for statistics. The code that adds to the ...
-2
votes
0answers
10 views

Encoding issue SMS Framework module with Nexmo SMS

i am using this SMS Framework module with Nexmo SMS gateway but i was facing an issue with encoding messages , i have to send messages to Sweden also MENA countries . is there any fix to handle this ...
0
votes
1answer
18 views

Filter a view with contextual authored date

I have a Drupal 8 view where I want to sort nodes by authored year using contextual filters. So www.mysite.com/2017 will list all nodes from 2017. I set up the filter using 'Content: Created Year' ...
0
votes
1answer
24 views

Link module output with content type

I am confused on how to output links from a content type into a list in HTML. Currently I have the following code. <div class="lenders-block-content clearfix"> <ul> <?...
0
votes
1answer
12 views

How to join the `field_data_field_*` tables with `node` table using SQL?

I apologize if I ask for something obvious, but I am asking because I could not find a simple answer anywhere. I know how to work with these tables in the PHP Drupal code, which built-in functions to ...
0
votes
0answers
29 views

Create custom webform when creating node?

I’m trying to find out if it’s possible to create webforms when creating nodes or paragraphs. I mean instead of choosing a predefined webform, then build it right inside the field. I figured that ...
4
votes
1answer
121 views

How to disable creation of node revisions on programmatic node update?

I added a field of type computed field to existing nodes. It's required to re-save the nodes to set/update computed field values. As I do not want to update the changed timestamp I decided to not use ...
0
votes
0answers
25 views

Node::access with anonymous user

I want to add a CSS class in hook_preprocess_html(), which indicates that logged-in users have access to the content and that anonymous users don't have access to it. First I get the node with $node ...
0
votes
1answer
27 views

How to use hook_views to add calculation to a field?

In a custom module (assoc), I have a custom Content Entity (Person) with these fields: $fields['lastname'] = BaseFieldDefinition::create('string') $fields['firstname'] = BaseFieldDefinition::create('...
0
votes
3answers
53 views

Menu tree from taxonomy terms and nodes which belong to them

i need to create a collapsible menu tree from taxonomy terms and nodes which belong to them (not nested terms, but content pages) i'm totally stuck about it i've found solutions for nested taxonomy ...
0
votes
0answers
23 views

Check if a user has already created a node and redirect the user when the node exists

I am trying to redirect users to a page when they have already created a node in mytheme.theme, in order to prevent a user to create a node twice. function mytheme_node_prepare($node) { if ($node-&...
0
votes
0answers
16 views

Override imported data on node creation

I would like to transform some data I am getting from an RSS feed. I get a set of items and create nodes using the data I get, so far so good. However, some of the data fields contain relative URLs, ...
0
votes
1answer
11 views

Node Export being downloaded as a .sh file and unable to be imported

In my Drupal 7 project, I have some content of a custom content-type (page) that I need to import into another environment. When I go to this content instance, I select on Node Export, which then ...
-2
votes
1answer
19 views

Creating a displayable 'index' of content nodes within a path

Ok, it's been over a decade since I've worked with Drupal (primary use was for a personal blogging platform, with a bit of extra extensibility and a well developed plugin ecosystem). Sadly, most of my ...
0
votes
0answers
26 views

Drupal 8 uploaded should be stored in certain s3 bucket

Currently, I'm facing an issue while uploading a file. I'm fetching the file tid with hook_entity_presave: $file_tid = $entity->get('field_photos_photos') ->getValue()[0]['target_id']; if(!...
0
votes
1answer
20 views

Unable to access translated node content

After performing a Drupal core update on my site today I've found that I can no longer access translated content. When I try to view or edit the translation, I only see the default language content. ...
0
votes
1answer
17 views

How to validate field in inline entity form referenced field

I have created field "Referenced" which is entity reference field of other content type. Also this field have inline entity form functionality means its giving two button "add new node" and "and ...
0
votes
2answers
57 views

AJAX callback inside hook_form_alter()

I don't know how to implement AJAX callback in hook_form_alter(). The field is plain text by default and it is populated by NID (number) of the client company. The module name is "my_car". I didn't ...
0
votes
1answer
11 views

Excluding inline images in views

I have a node type with an image field and insert button to get the image into the text field. Then there is a view that is getting the content of the text field and shortening it to 150 characters. ...
0
votes
0answers
27 views

Render content type display mode in custom module [duplicate]

I'm facing the issue with rendering content type in specified display mode (teaser) in my custom module. I have a module which stores NIDs in session, and when user enters specific page, I want to ...
1
vote
0answers
19 views

behavior of path on unpublished/draft nodes

We have a Drupal 8 site with a press releases page. Currently the press releases page is provided by a view with a page display. The path in the page display is set to /press-releases. I've been ...
0
votes
1answer
30 views

How to print the URL of a title field?

I'm trying to print out the url path from the title in my twig template however I haven't been successful so far. Printing out the title containing the link works fine using: {{content.title}} ...
1
vote
1answer
47 views

How to use hook_prepare to modify a field of a node before it is edited

I want to modify the contents of a field of an Article node just before it comes up for editing. I have read the documentation at http://api.hostdog.gr/api/drupal-8/drupal%21core%21modules%21node%...
0
votes
1answer
41 views

Custom Page routing

I created a custom page type called 'Angular page' and a custom twig template for it which loads my angular scripts and prints the <app-root> tag. I set the page URL to /angularpage and the ...
0
votes
1answer
22 views

REST Export Views and images alternative text

I have a simple REST export View. The View format is set to "Show: Entity". The content type I am exporting contains a standard image field. My image field settings is set to "Enable Alt field" and "...
0
votes
0answers
25 views

How to get referenced entity fields from another content type in single node template [duplicate]

I have a content type called "Resources", this is referenced from another content type called "Projects". I can get simple text fields in my single node--project.html template for example - {{...
0
votes
2answers
68 views

How do I pass a value to a content type field with a custom submit please

and thank you for your patience in helping me learn I have created a content type called response (Through Drupal, not in a custom module) In the content type I have a field called ...