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
22 views

Show workflow transition bar in all states

I've created a custom workflow using the workflow module with the transitions listed below and I've noticed that when going to the view page of a node the workflow 'bar' that lets you transition a ...
1
vote
1answer
29 views

How to create node twig template suggestions for one content type?

I need to create a node twig template that is just for the basic page content type that based on a custom field on the content type. We have other content type like Article, Blog, Products that do not ...
0
votes
0answers
18 views

How to choose content field shown in View using URL parameter?

I have contentType Screenshot which has 6 Image fields shot1..6. Then I have a view screenshots_1 which shows shot1 in a grid. I need to have 6 paths, e.g. /screenshot_1..6 each pointing to same view ...
0
votes
1answer
25 views

How do I exclude a node from an entity reference field?

I have a homepage content type which has a featured_article field, an entity reference field that allows the editor to choose a single node from the Article nodes. That node is displayed as Featured ...
0
votes
2answers
48 views

How to reuse existing images in field type “Image”

I have custom ContentType with one field of type Image. Currently, when I edit a node I can only upload new images from local to server. I want to have the option to select images already existing on ...
0
votes
0answers
19 views

View with Taxonomy Path

We have a taxonomy vocab called Phones that goes like this. Taxonomy: Phones -Nokia --3310 --Jitterbug --7.1 -Samsung --Galaxy S6 --Galaxy Edge --S7 -HTC -- one --S7 list goes on, but you get the ...
2
votes
1answer
63 views

How to update a field on menu_link_content (added using menu_item_extras module) entity from node form

I have a checkbox field added to one of the menus using Menu Item Extras module. By default, the checkbox is checked and works as expected when I create a menu item via menu admin UI. however, when I ...
0
votes
0answers
42 views

Filter a view displaying nodes of one type using a user entity reference field on that node

I have a vocabulary (Countries) listing all countries. I added an entity reference field to the User entity (Nationality) referencing the Countries vocabulary. To the Article content type, I added: ...
0
votes
1answer
51 views

How can I loop through all article content types and get the content of each

I created a new article content and am overriding that by creating a template for it (ie: node--4.html.twig). Then inside this template, I want to loop through all nodes that belong to article ...
0
votes
1answer
38 views

Create nodes unlimited times

I've been trying to ajaxify the node creation form, the purpose? Save the node and remains in the node creation page (Done) If the user clicks the save button again save a new node The second point ...
0
votes
0answers
22 views

Programmatically add field collection items to a node [duplicate]

I have a node with a Field Collection [field_videos]. I would like to be able to progrmatically load a node and add field collection items. The field collection contains the following fields: ...
0
votes
0answers
9 views

How to fix malformed geometries in geofield

I have a form that allows to add geometries to a node. It features a geofield map widget where you can also add geometries using a WKT field. Plenty of users have used this field. However, some of the ...
1
vote
0answers
24 views

How can I alter the node title in every display?

I have a content type "Campus", I would like to concat to the title "Campus name campus". So, there is a hook or something to alter the node getTitle() method in every display? I've tested: ...
0
votes
1answer
29 views

How to remove Home title from the home page?

There are several posts on a similar question. Despite that, I couldn't find the best way to resolve it. Display Suite is installed but don't see option to turn off page title. Our home page content ...
1
vote
1answer
48 views

For each image uploaded in a node: get the url

I'm begining with Drupal 8 and I want to get the url of the photos in the content I create to display them. The context is : a photograph upload pictures for a customer. This customer can see it on a ...
0
votes
0answers
18 views

Node as field in content-type

I have one type of custom node called "Concerts", and another type called "Conductors". I would like to add a field to Concerts indicating which conductor led the concert. However, the field types I ...
0
votes
0answers
32 views

Getting white screen in Login /user and the page content

I was recently editing a website with Drupal 7 installed, and was integrating twitter feed. I created a block twitter_feed_block and assigned the block to the content section of the front page. It ...
0
votes
1answer
12 views

Anonymous permissions with Nodeaccess

Content type: Webform Allowed grants: View, Edit Allowed roles: Anon, authorized, admin Go to the webform node eg. node/20 Click Grants tab Tick authenticated and admin users can View, anonymous is ...
0
votes
0answers
23 views

How can we set entity refrence view in #selection_settings programtically?

I want to attach "game_name_entity_reference" view to autocomplete field in programmatically. Can we do this by #selection_settings attribute? or any other way?
0
votes
0answers
14 views

How to implement autoincrement field using inline_entity_form module in field collection?

I have 1 field collection in that added the entity reference field and set widget "Inline entity form-complex". Now i want to show auto increment number in "Game Code" text field. I have tried with ...
0
votes
0answers
47 views

Error “The value you selected is not a valid choice.” in drop down list

I want to list node titles in drop-down list programmatically. I have done below code in form_alter hook. function product_custom_form_alter(&$form, FormStateInterface $form_state, $form_id) { ...
0
votes
1answer
52 views

In Views, display additional fields from an entity reference

I have a content type with a field that is an entity reference to another content type called "URLs", and the "Allowed number of values" is set to "Unlimited", meaning that one record can have ...
0
votes
1answer
19 views

Published checkbox only available for administrator

Only the administrator can publish a node of content type Report. It is not using content moderation or groups though other content types are. All permissions are set for the "site admin" to create/...
0
votes
0answers
11 views

How to safely delete a node reference value

I have a field in a content type, content_type_A, whose field type is Node reference. It references another content type, content_type_B, which has a field which i cannot edit of type Node module ...
0
votes
0answers
23 views

Wrong path of Image for property = “og:image” of meta tag in content view source

I have uploaded an image in my content. When I checked view source of the page, it shows the wrong image path for og:image property of meta tag. After uploading the image in my content, image path ...
0
votes
0answers
16 views

“Promoted to Front Page” option only showing for administrator

I am using the "Promoted to Front Page" option for a view that is displayed on a landing page. The option shows in the create/edit form for an administrator, but no other user for the article content ...
1
vote
1answer
91 views

Migrate nodes with special characters in title

Given a source's title like This "cool" & "neat" article's title has HTML entities , is creating a title of This "cool" & "neat" article's ...
0
votes
1answer
31 views

Make my view the default for content type

I am probably doing this the wrong way, so please correct me if I am wrong! I have created a new content type, called "Entities". My content type has many fields, and the default view when you visit "...
0
votes
1answer
30 views

Add content screens from the front end

I am building a web application (for trusted users), so the logged in user will have the ability to add content. However currently, when the user wants to add a record, they move from the frontend ...
0
votes
0answers
67 views

How can I display a webform on a node?

I am trying to display my webform using MYTHEME.theme file but I did not get any result. I am using code below: function THEMENAME_preprocess_webform(&$vars) { $wfid = $vars["element"]["#...
0
votes
1answer
25 views

Referencing “type” in nodes returned by loadMultiple();

I know there are easier ways to sort nodes by type, using views, or using: $query->loadByProperties(['type' => 'my_content_type']); ... but what I really want to do is return ALL nodes and ...
-1
votes
2answers
54 views

Display the day of the week

I have a content type with various fields. One of these is a date field. After typing in the date I would like to display the day of the week to the right of the date.
0
votes
0answers
26 views

How can I append the node ID to the node title while saving a node? [duplicate]

When a node is saved, I want to append the NID to the title of the node. $node->title = "XYZ_" . $node->nid; If I put this code inside hook_node_presave(), it won't work because NID($node->...
2
votes
1answer
78 views

How can I get the parent node of a referenced node?

I have a node called project which contains field building as a referenced item, I used the the hook on building node insert and, having this building id I need to get project id which this building ...
0
votes
0answers
56 views

How to delete node of a content type if having millions of node

I have a content type in my Drupal 8 instance and having more than 2 millions (20 lakhs) node and want to delete those node, tried many things but nothing helps, either HTTP 500 error occur or Website ...
0
votes
0answers
34 views

How can I get the metatag_config site name by consulting my db with php?

I want to obtain the metatag_config data through a mysql query with php from my db drupal, in order to obtain the site name, description, keywords and abtract. How can I do it? Or where they are ...
1
vote
1answer
43 views

Fetching node field values programmatically

I have figured out how to query the node table programmatically without using the deprecated db_query() function. However, I soon discovered that the actual content fields are not held in the node ...
2
votes
0answers
36 views

Add an existing node as a translation to another node [duplicate]

I am migrating contents from a multilingual website. I'm using Feed modules to import all the nodes so, in the end, I have multiple nodes that are in English and multiple nodes that are in French. ...
-3
votes
2answers
42 views

Where might I place code to programmatically update nodes?

I want to update or set value of specific node/entity with one button that have function to update specific field on that node / entity? And put in on view tab on that specific node on a button? How ...
1
vote
1answer
27 views

Translatable image field gets replaced when adding content

I have added an image field with Translatable Content enabled. My content type has enabled translations too. But when I add an image in the translation, the english contents field get replaced with ...
0
votes
0answers
12 views

Print translated Image field in node template

$nodeObj = Drupal::service('entity_type.manager')->getStorage('node')->loadByProperties(['type' => 'books' ]); $nodeObj has field 'field_book_image' and 'target_id' => string(2) "65" in node ...
0
votes
1answer
24 views

How do I reference a file field and node title from another content type & node?

I need to add a link to a file, added through a file field on its own content type called "Document" from another content type and node call "plan information". The idea is that the "document" nodes ...
0
votes
0answers
17 views

Migrating into Double field

I am migrating a CSV into D8 node type which has a double field. The CSV has the following structure: I am trying to migrate the year, from the header, into the first double-field subfield (as a ...
2
votes
0answers
67 views

Webform module loosing language for referenced options

First I have content type "Quiz option" which is translatable. Then I have a view that returns Entity references of that type. For language option I selected "Content language of view row" and also ...
0
votes
2answers
66 views

Cloning nodes between multisite instances with separate databases

I'm working on a Drupal 8.6 multisite and my client wants to be able to duplicate content between many of these sites. The codebase of the websites is the same, but each of them uses a different ...
0
votes
1answer
66 views

import address data from CSV

I migrate my content from an old D7 site to D8 site. All went well, except the addresses from field address where not migrated to the new address field. Then I use feeds, feeds_migrate, content-...
1
vote
0answers
37 views

Can I alter the behaviour of a core function?

To make content management easier, for a large website we have allowed the content administrators to put a pipe in the title of a piece of content. Anything before the pipe is ignored. Is there a way ...
0
votes
0answers
14 views

Updating Solr search_api filters on node deletion

With Drupal 7 I am using a SOLR search index. The index covers a particular content type. I have a view which uses the search facets and displays a paged list of items in the index. My problem comes ...
1
vote
1answer
26 views

How to render translated node body in two languages?

I use entity_translation to translate node body field, so in a fully loaded node object body is an array of 2 languages ('en' and 'ru'). For specific node type I would like to render body in both ...
0
votes
1answer
59 views

Add Button to Node View

I want to add custom button on node page. I tried with hook_node_view but it didn't show up. like this: function mymodule_node_view(array &$build, EntityInterface $entity, ...