This tag is for questions regarding the use, reuse and manipulation of nodes, the most basic form of content on a Drupal site, and the API used to manipulate them. While nodes are implemented as entities in Drupal 7, this tag should be used instead, unless specifically referring to Entity API ...

learn more… | top users | synonyms (4)

0
votes
0answers
29 views

Why are my nodes not showing up in a Panel?

I am experiencing something strange: the nodes in my Panels are not showing up anymore. When adding content to my Panels, I can select Existing node, pick the right node title (e.g. Test article) and ...
2
votes
0answers
19 views

Multilingual admin interface

I have a multilingual website ( english, dutch and german ). The language detection is setup to look at the URL for both interface and content. This results in an admin interface that goes from dutch ...
0
votes
0answers
13 views

How to display a view modes from display suite in a form by custom module?

I work in D7 and I have 20 content types. For 10 content I would like to have a preview of the node on the same page where the node is deleted. Therefore I create a custom view modes in display ...
0
votes
2answers
34 views

How to get tid on behalf of node id (nid) in Drupal 8?

I am new in Drupal 8. I have created a node with category (taxonomy). Now I don't understand how to get tid by using nid. I am using $node->body->value to get the body field value and use {{ ...
1
vote
1answer
19 views

How to remove id=“node-[nid]” with Display Suite?

How I can remove the node id when I override a node layout with Display Suite? In some (old) how-to I noticed that the id node is not present when a node layout is overridden with DS. i.e.: from ...
2
votes
2answers
137 views

Which table stores the content type fields?

I have a content type in drupal 8 and which table stores the content type fields and type in drupal 8 ? Unlike in drupal 6 (in which there will be tables specifically for content types) like ...
2
votes
1answer
39 views

How is the node revision ID getting updated?

I have a question related to _node_save_revision function in drupal 7. I just want to know how I can get the new revision ID after saving a revision using this function It is mentioned in the ...
0
votes
0answers
11 views

How to handle translations for menu items?

Need to know what is the best way to translate menu items. Do I provide the translated menu link at the node level, when it's as to Provide Menu Item, or do I translate the menu item at the Menu ...
0
votes
0answers
32 views

How do I create a content type and assign fields to it, programmatically?

I have function which must create content type based on $data in ['base'] basic information about content type. Almost everything works well: The content type is created, but the fields aren't ...
0
votes
1answer
36 views

Term reference field won't display

I'm trying to add tags to my blog posts on my Drupal 7 site. I've added the Term Reference field to the content type and when I add a blog post it is letting me add tags without a problem, however ...
0
votes
0answers
11 views

How to programmatically add content to a group in 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 same code add this article ...
1
vote
1answer
138 views

How to return node object on programatically node creation

I can create node programmatically with following snippet use \Drupal\node\Entity\Node; // Create node object with attached file. $node = Node::create([ 'type' => 'article', 'title' ...
0
votes
2answers
32 views

Restrict the node local tabs access to specific content types

I have a module_name.links.tasks.yml file for Drupal 8, whose content is the following one. entity.node.module_admin: route_name: module_name.admin base_route: entity.node.canonical title: ...
0
votes
1answer
19 views

How to change a file field value with entity_metadata_wrapper

I need to remove a file field value, and instead, assign a new value to it. The file field contains video and the new video is in the videos directory. This is my code to delete a file field value (...
-1
votes
0answers
12 views

Replacing a video file doesn't take effect in the player

I am building an online video editor. The video is played and users can cut a segment of the video and replace the result with the current video. The video file is stored as a field in a content type,...
1
vote
1answer
108 views

How do I use node_load() with an array as first parameter?

In Drupal 6, I would use the following code. $nodes = node_load(array('title' => $vcenter_name, 'type' => 'vcenter')); What is the equivalent code for Drupal 8? I could use node_load($nid), ...
0
votes
1answer
9 views

Using taxonomy to give option of page layout - working but showing error (Notice: Undefined variable: node in include())

I have been building a site in Drupal 7. I have the content type "Basic Page" but added taxonomy terms for the user to be able to select "Standard" or "Full Width" page. If the user selects "Full ...
1
vote
1answer
23 views

How to Add Block with Page on the same view?

Initially, I have displayed the contents in the Block on View. Now I am trying to display Taxonomy Term in the Page ,with Block on the same view. There is a ADD button in the View, if I add the page ...
0
votes
0answers
11 views

How to check which user updates a page?

In the content listing page /admin/content, the author of a page is shown. How can I know which user makes the last change to the page?
0
votes
2answers
43 views

Making a home page without /home

My website is mycapecodvacations.com I need help how to make the default home page mycapecodvacations.com instead of going to mycapecodvacations.com/home I'm using host gator .com and want to know how ...
0
votes
2answers
32 views

How do I query entities to get all fields values - including referenced ones (INNER JOIN)

I have custom content types in my Drupal 8 module and want to query nodes of those content types programmatically. Querying through entityQuery is easy. However, I have also entity reference fields (...
5
votes
3answers
49 views

How do I execute code before update the content?

How do I execute code before updating nodes? I am looking for a hook to use in a custom module. I have created a content type. What I need to do is execute a hook before updating any content. I want ...
1
vote
1answer
15 views

How to determine if user X has access to operation Y on node Z

How can I programatically determine whether a certain user has "view" (or any other operation) permission for a given node? I'm trying this, but it doesn't seem to be calling the node access hooks, ...
1
vote
1answer
12 views

CRUD API from article [closed]

I would like to create 4 api calls (GET/POST/PUT/DELETE) for the basic node article. I'm a real noob in this. Can someone help me on my way? Where do I go for information?
0
votes
0answers
21 views

Content type add page misalignment in drupal 8

In D8 in all the content type adding pages the settings which display on the bottom of the page have been misaligned , refer the pic below . How can i fix this , Is it related to any style issues ? ...
0
votes
2answers
46 views

Rendering blocks inside node

I am building a Drupal 8 site. The site will have basic pages (nodes) that have three fields: a title, a body and a list of embedded blocks. The idea is to allow the editors to create content blocks ...
0
votes
2answers
28 views

Get Node Author's Name in Custom Block [duplicate]

In the admin area, to create a custom block, I go to: Structure, Block layout, + Add custom block. Once I create the custom block in the UI, I see a textarea field called "Body" where I can enter ...
0
votes
1answer
19 views

Images are refering wrong path on node import

i import a node in my site using paste code method. after imported some images are refering wrong path ("https://www.example.com/sites/default/files/styles/large/public/test.png?itok=a2KPyReV"). but ...
2
votes
1answer
32 views

Is it possible to pass a Field value Via URL when creating a Node?

This may be posted elsewhere but I was having trouble finding anything answering my question directly. I have a content type called Ticket that I want to have different fields based on what page a ...
0
votes
0answers
3 views

VBO operation without changing modified date of node

I am in situation where i need to restrict modified date to be changed while updating nodes using VBO module. Thanks in advance.
1
vote
1answer
12 views

how to create path node/{some id}/add/{node_type} which loads node/add/{node_type} page

Create a path node/{some id}/add/{node_type} which loads node/add/{node_type} page form. I want to get that { some id } to assign it default value in a form field client needed that url pattern as ...
0
votes
0answers
7 views

Getting a Book ID Token for Use in Menu

Using the books module I was hoping to have another menu to add a child page to a book, other than the immovable one that comes as default. My plan was to use the Menu Tokens to achieve this. ...
0
votes
0answers
19 views

Internal server error on node save

I'm getting internal server error on node save. In db log messages there is no such error regarding this issue. In apache error log I have these messages mod_fcgid: read data timeout in 40 seconds, ...
0
votes
0answers
17 views

Get related topics [closed]

I have code that shows related topics with one or more comments. It shows only these topics with a comment, and it based on taxonomy terms. It shows only one topic in related section, but it should ...
0
votes
1answer
14 views

rules does not have any action for publish seleccted content

In admin/content page we have some update options. I want to execute a php code only when I use 'publish selected content' or 'unpublish selected content' on that page. This rules should be fired ...
0
votes
0answers
14 views

publish selected content does not work with $node

I have written a rules to make my own URL alias and code field programmatically when node is saved or updated. This is my code: if (empty($node->path['alias'])){ $record=db_query("SELECT MAX(...
4
votes
2answers
52 views

How to unpublish a node with vocabulary term X after Y hours?

How could I automatically unpublish a node after Y hours (e.g. after 24h after it appears on-line) but only when it has a specific category - category is based of course on taxonomy's vocabulary. ...
0
votes
1answer
32 views

Display Nodes from Taxonomy Category Term and Parent Terms

I am using Views and Drupal Commerce but not sure this should matter as all my products are also nodes. I have a taxonomy hierarchy for categories. Example Exterior Accessories |_ Top |_ Soft ...
1
vote
0answers
22 views

Editing article returns “Authored by” to default value

I changed the default author of a node to blank (' ') for the needs of my project. So, currently when I create a node, "Authored by" field is empty. Then, I could assign author and this works fine - ...
1
vote
1answer
46 views

I Can't add node of a custom content type

I have to add a new content type to my site for a new feature i'm asked. I already added two of them before (very early in the building of the site, in fact) and it worked well but this time, when i ...
1
vote
2answers
25 views

Check content type of node in preprocess hook

I have a series of variables I want to make available on twig templates for specific content templates. In mytheme.theme I have function mytheme_preprocess_node(&$variables){ if(isset($...
1
vote
0answers
24 views

How to add/reference user specific data on/for each node?

I have a content type for which there is a user reference field,I can select multiple users for every node. For each node I want to save some extra information for each selected user. Like another ...
2
votes
1answer
32 views

How to mark a node as read per user?

I'm wondering what the best solution is to mark a node as read per user. The below scenario is what I am trying to achieve: Admin creates a node which requires to be read and confirmed and flags ...
0
votes
1answer
8 views

“Explanation or submission guidelines” missing

In editing a content type on a Drupal 8 site, I added text to the Explanation or submission guidelines, but when I surf to the node create/edit form, the text is nowhere to be seen. Is this a bug, or ...
0
votes
0answers
19 views

How to have rendered node html in a preprocess function

I need to pre-fill a webform hidden field with the nid of a node and display the node formatted in 'preview' mode. I formatted the URL like www.example.com/urlwebform?nid=56 and I built a ...
1
vote
0answers
15 views

Possible Cross Domain Proxy Issues

My drupalgap app works fine in ripple emulator when I disable the cross domain proxy options. However, when I compile the app and pull out the debug apk and run the app on emulator the main menu and ...
1
vote
1answer
16 views

More Stories appears when a user scrolls on a half page [closed]

More Article Box (More Stories) appears when a user scrolls on a single post at least 400px. The box appears in the right bottom corner and it can show one or more posts related with the current one. ...
1
vote
0answers
22 views

Node needs save -> edit -> save to fill all fields

I have a Drupal node form with fields that depend on each other. 1 - first field (text) takes data (using default value and tokens) from other fields 2 - second field takes data from the first field ...
1
vote
2answers
68 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 ...
0
votes
2answers
22 views

Passing arbitrary data into a node prior to preprocessing

I am looking for a way of passing arbitrary data though node_view() to a preprocess function. I am using the following code. $node = node_load(1); $node->mycustomdata = 'mydata'; // This is ...