Questions tagged [nodes]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
3k views

Drupal 7, displaying an image to search results

I have a content type called "people". When a search is made and one of the search results is of "people" type, I want to display two fields of the "people" type; an image called "photo", and a text ...
1
vote
2answers
2k views

node_presave doesn't work

I'm trying to do something before my invoice saves. In my invoice module I have: function invoice_node_presave($node) { var_dump($node); die; if ($node->type == 'invoice') { // If true we ...
1
vote
1answer
107 views

Is it possible to have “pseudo-nodes”?

Is there a way to expose content from other databases to Drupal so Drupal sees them like nodes? Importantly, this should work without making actual node entries in the Drupal database. This would ...
1
vote
0answers
618 views

Making contextual filter conditions “OR” vs. “AND” in Drupal7 [duplicate]

Possible Duplicate: Alter a Views query to use “OR” through the user interface I have a view that needs to allow for the "OR" of a set of contextual filters (filtering on node ...
1
vote
2answers
1k views

How to show/hide the prefix/suffix for fields?

Sometimes in theming I want to programmatically hide the prefix or suffix of numeric fields. How can I do so?
1
vote
1answer
179 views

How can I restrict various roles with limit in creating nodes of a particular content type [closed]

How can I restrict various roles with limit in creating nodes of a particular content type?
1
vote
1answer
101 views

How to track and report which data is used or accessed the most for a site on an internal network?

I have a Drupal site set up on Solaris 10. I made custom PHP file to allow users to pass parameters in URL to retrieve feedback in xml format, and a couple of views to display data in table format. ...
1
vote
2answers
940 views

How to query the Database logs and create summary reports and/or charts of them?

Is there a module for querying and creating summary reports of the Database logs? I need something that can create an equivalent of SQL Group by queries on the Database logs, eg, group by type, ...
1
vote
2answers
1k views

Display top level of book, in book navigation block

In my theme's .theme file I have the book navigation block stored in a twig variable like so. function mytheme_preprocess_page(&$variables){ $book = \Drupal\block\Entity\Block::load('...
1
vote
2answers
567 views

Import or Programmatically create nodes with Videos

I'm working on a new drupal site which I need to migrate from an existing non-drupal site. I need to be able to import the old blog posts as Article nodes (either through some standard import ...
1
vote
2answers
997 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 ...
1
vote
1answer
285 views

How to show filesize when content type contains more than one file?

I'm using Drupal 7 and having File 7.14 field installed.I have a content type (named file) containing more than 1 file. I have a view that shows the filesize of all the files of the content of that ...
1
vote
4answers
2k views

Creating a poll inside a content type

I need a poll inside my content types. Sometimes the users create an article and like to create a poll directly into the node they created. They don't want to create an extra poll with no connection ...
1
vote
2answers
558 views

Display a field of a node that is referenced on another node via a relationship

I have two content types, "Stores" and "Offers." In the "Offers" content type, there is a CCK node reference field type that references the "Stores" nodes. So essentially, I create a store and if the ...
1
vote
2answers
2k views

Why so many “page not found” for statistics.php?

In my Drupal sites, there are many "page not found" for modules/statistics/statistics.php recorded in the log ("Recent log messages" or /admin/reports/dblog). Many of them were accessed by the ...
0
votes
2answers
409 views

How to stop infinite loop on hook_node_grants

I am using hook_node_grants to provide access to a realm based on whether someone is an 'owner' of a node. The issue is that menu_get_object() may call hook_node_grants recursively. function ...
0
votes
2answers
328 views

Increase weight range for child pages in book outlines (Book module)

When a child page is added to a book via "Add child page" (node/add/{content-type}), the Weight drop-down field in the Book Outline tab has a range of -/+ 15. This is due to line 191 in web/core/...
0
votes
2answers
485 views

How can I alter the title of a node upon save?

I want to automatically set the title of nodes with content type ABC to the node ID. (I want to hide the title field from the form in the UI, and I don't care about titles for this content type.) ...
0
votes
1answer
1k views

How to create a child page that has the same content type as parent page?

I enabled the Book module on drupal 7 and created 2 new content types. Let said I created a new "content type A" and "content type B", and keep the book module content type as "Book page". The issue I ...
0
votes
3answers
268 views

Referencing other nodes created by the same author

I have a site where members can sign up and post an article (standard content type) which I'll call STYLE A. I now need to allow the members to create a different article (another content type) which ...
0
votes
1answer
362 views

Deleting nodes did not remove the node-related menus

Is there a "safe" way to delete all the existing content/pages/nodes from a Drupal 7 site, and delete corresponding menu entries? When I deleted the nodes using the admin UI, my menu entries didn't ...
0
votes
1answer
91 views

How to count the number of comment and flag in a node?

I want to display on my node the number of comment and flag. What should I add to my TWIG to get this? How to count the number of comment and flag in a node? Here is an example :
0
votes
3answers
50 views

For content, what are the differences between nodes and terms

I am debating whether to use nodes or terms to store a large amount of content in Drupal. There are a lot of similarities between nodes and terms in Drupal 8/9: Both can add any type of field. Both ...
0
votes
1answer
476 views

How to display node details and call function in *.html.twig

I work in D8, I create a custom module first_module. By modules create a url and display all nodes by *.html.twig file. Write code in controller.php public function contentthree() { $connection = ...
0
votes
1answer
99 views

redirect in hook_init makes body text disappear

What is wrong with this code. It makes my body text disappear in all of my nodes. function MYMODULE_init() { if (arg(0) == 'node' && is_numeric(arg(1)) && !arg(2)) { $node = ...
0
votes
1answer
519 views

Change content “Author” to the last “Editor”

On the admin/content page. The field "AUTHOR" shows who created the content, but this is not very helpful for seeing who last edited it. How would you change this to show who last edited it?
0
votes
1answer
2k views

How to use ctools modal to popup some fields of a node on node view?

I want when a user is viewing a node, some of the node fields will be shown as a popup (without any buttons). How can I do it? Thank You!
0
votes
1answer
2k views

hook node access drupal 7, not working when the node is updated

I have created a module using the following code. <?php global $user; if (in_array('contributor', array_values($user->roles))) { function publishEntities_node_access($node, $op, $account) {...
0
votes
2answers
333 views

How do I create custom content types in drupal?

I need to create a content type that is similar to a textarea, but I need to do some server side formatting before it can go out to the page. I want a user to be able to input a chunk of text, then ...
0
votes
1answer
287 views

Drag and drop nodes in a node list (to later use that sorting inside a view) [closed]

Under example.com/en/admin/content I show all site content filtered by content type and then I get a list of all nodes from that content type. The nodes will appear in some sorting (usually date). ...
0
votes
2answers
103 views

form in a .tpl.php file

This is the code in my template.php file. function studiga_theme_theme($existing, $type, $theme, $path) { $items['add_property_form'] = array( 'render element' => 'form', '...
0
votes
1answer
335 views

Pathauto menu token duplicated for a menu added in hook_node_insert

I have a content type using the following pathauto-token pattern: [node:menupath]/[node:title], I added manually a menu using a hook_node_insert (see my previous question: creating a menu in a ...
0
votes
2answers
793 views

How to add dynamic fields with condition?

I have a website that is about automobiles, I want when a user choose a brand drupal shows some of its models: This image show an example: for example I want when a user selected BMW drupal shows ...
0
votes
2answers
1k views

Entity Reference and nested arguments in Views

My site has 3 nodes: Program, which is a list of Course nodes. Course, which contains basic information about a course you can take Course Date, a specific instance of a Course. Each Course Date ...
0
votes
2answers
561 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 ...
0
votes
2answers
187 views

Change the amount of content displayed per page in Content Management -> Content

I'm trying to do a CSV export of all my content, but it only shows 50 per page and I have 50+ pages. I want to be able to check all and export as one csv. Is there a way to change the pagination ...
0
votes
1answer
190 views

How to sort the blog

I am trying to sort blog by title. The blog does not appear at view. Taxonomy does not has any setting related to sort. What else I should check?
0
votes
2answers
599 views

How to modify Author Pane date fields?

I have Author Pane installed along with D7 Advanced forum. I am wondering how to shorten the display format of 'Join' and how to remove 'Last seen:' from the pane? I could not see any guidelines in ...
0
votes
2answers
522 views

How do I add tags to Advanced Forum posts

I would like to add the type of tags this stackexchange forum has, so users can tag their posts and the tags appear at bottom of all posts. How do I do that?
0
votes
1answer
2k views

Drupal 7 views: Get NID in views using contextual filters

Does anybody know how to get the nid from a node using contextual filters or filter criteria in views WITHOUT using "Get id from url"? I was thinking about using PHP or getting it from a node-field. ...
0
votes
1answer
106 views

Importing nodes with different field names from Drupal 6 to 7

I need to import certain nodes from a Drupal 6 site to a Drupal 7 one. I have a particular situation: I need to import only nodes of a certain type Node types have different names in the sites ("...
0
votes
0answers
753 views

PUT or POST not working with Services UUID

So after installing UUID, the service module no longer has 'create' with the entity type 'node'. On looking at UUID documentation, it says that I can use update to both create or update content. ...
0
votes
2answers
41 views

more fields on a content type or more content types

I know this is a situational/subjective question..... but I am trying to figure out a site architecture for a drupal site. I have multiple products with different attributes/properties. I could ...
0
votes
1answer
625 views

Creating content types with fields that are other content types?

I have an existing content type in my current Drupal application, person. This contains all of the data you would expect, more or less - name, address, employer, etc. I'd like to create a project ...
0
votes
2answers
126 views

How to implement Administration UI notifications for new revisions?

I'm new to Drupal and I'm customizing an administration theme to be designed to our needs. One of the things we would like to have is a visual notification of a new REVISION (content needing ...
0
votes
1answer
24 views

References module doesn't specify/read a pager limit when field is using a view to generate potential references

Discovered an oddity that seems inherent in the node_reference.module 7.x-2.1. It is a rather specific use-case, so I can see why it might not have come up frequently before. Just wondering if anyone ...
0
votes
1answer
379 views

How can I convert character entities to display as 'normal' characters in Drupal?

I have a customised module that imports items from feeds accessed via a third-party API. The items are used to create nodes for each instance. All the content appears to be importing correctly, but ...
0
votes
1answer
177 views

How to put a node in a menu using an URL parameter?

While creating a new node, I'd like to pass a parameter in the URL: node/add/page?plid=123 in order to put the newly created node in this menu item as its child. I tried to hook_form_alter() the node ...
0
votes
1answer
266 views

webform submission details not getting displayed

i have multiple nodes each per language and the default is English(node/1). For french node(node/2) after submitting the details of the contact form, the details not getting displayed in Webform-...
0
votes
1answer
844 views

Change the way “add content” and “node's” are displayed

I was wondering how one would go about changing the layout of the nodes when you are adding content, as well as when you view the full story. I want certain text to be bigger, some fields to be ...