This tag is for questions regarding the use, reuse and manipulation of nodes, the most basic form of content on a Drupal site. While nodes are implemented as entities in Drupal 7, this tag should be used instead, unless specifically referring to Entity API functionality.
3
votes
2answers
675 views
Get node values from array with Drupal API?
With Drupal API I found you can get the values of a node with noad_load like so:
$thisnode = node_load($nid = $child2, $vid = NULL, $reset = FALSE);
Now it is easy to echo the title in this way
...
3
votes
1answer
273 views
Where to place PHP code for a node if not in the node body block itself?
Up until now, I have found it most convenient and easy to place PHP code into my node by placing it in the node body and enabling the PHP filter. However, I have been informed that this is incorrect ...
3
votes
2answers
2k views
How do I programmatically create a simple 'page' node?
I have already found Drupal 6 documentation on how to programmatically create a page node.
How is it possible to achieve that in Drupal 7?
I've changed my strategy, and I'm using another approach, ...
3
votes
3answers
102 views
fast saving single field value
I've got around 70k nodes of specified type on my site. I need to run an update on them. Some operations and setting one field to desired value. node_save is really slow and it causes crashes (too ...
3
votes
1answer
85 views
Creating nodes and sub-nodes from database table
For example I have a database table defined from the following SQL.
CREATE TABLE IF NOT EXISTS `mytable` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`base_id` int(11) NOT NULL,
`page_type` ...
3
votes
1answer
512 views
Including multiple authors in Authoring information for a Drupal 7 node
I have a CMS to which many people can possibly provide data. So, I would want to include all the users who have contributed the data for a node by adding new data or moderating existing data, because ...
3
votes
1answer
318 views
Correct way of upgrading Drupal 6 to Drupal 7 with huge data
I have a Drupal 6 site that contains hundred of thousands of node and bunch of custom and contributed modules. My problem now is how can I upgrade this correctly in Drupal 7. I tried to steps ...
3
votes
1answer
428 views
Adding a clearfix class to hook_node_view
Ok, so what I want to do is to add a class of clearfix whenever Drupal outputs a node view with inline links.
I've been looking around and I figured hook_node_view() is what I need to alter.
Looking ...
3
votes
2answers
704 views
View's Block displaying above node content
I created a Block from a view and Displayed on a particular node. However the block is being displayed before the node content. I tried with the Blocks row-weights but is of no use.
All i need is to ...
3
votes
1answer
523 views
How do I add a description to the node title form field?
This might sound stupid, but I can't find a way to do it. I need to add a description to the node title, just like I add a description to other fields. How can I do it?
3
votes
2answers
1k views
search form at admin/content
I try to administrate a lot of content in Drupal 7.
How may I add a search form at Content administration page (admin/content)?
I need it so that I can easily find a node when there are hundreds of ...
3
votes
1answer
614 views
What is the best way to upload a PDF attachment, that can be attached to multiple nodes?
I want multiple nodes to all have a download link on each node to one, shared PDF file.
What is the best way to upload the PDF file one time, but add it as an attachment to each of the multiple ...
3
votes
2answers
116 views
archive_page() from archive module in drupal 6 shows all nodes not date specific
I installed Archive module and used following code in a custom template:
print archive_page('all', 2012, 10, 12);
but it shows every single node I posted, How can I make it load nodes according to ...
3
votes
6answers
2k views
How to hide page title based on node type using template_preprocess_page()
I am trying to hide the title of the current page (as printed by page.tpl.php) if the current page is 1) a node in full display (as opposed to teaser mode), AND 2) the node type is either 'concert' or ...
3
votes
3answers
119 views
Is there a module that can display a specific block to a specific node?
I have quickly seen view reference and context module, though they can display a view or block to a specific content type, Im not sure if they can do it within specific node.
Example I want to ...
3
votes
2answers
2k views
Embed a node form with default values in drupal 7
How do I embed a node form and set some default values in that form in Drupal 7?
I understand that I can use this:
$form = node_add('product_plan');
print drupal_render($form);
That prints the ...
3
votes
3answers
2k views
Disable vertical tabs by content type or user role
Some users may only have the ability to edit one of the fieldsets that shows up in vertical tabs on the node edit form. In such a case it looks rather silly to be using vertical tabs since there is ...
3
votes
4answers
4k views
How do I print the body of a node?
I am struggling to work out how to print a node body on a page.
I normally use something like this print $node->field_manufacturer[0]['view']; but I am unsure how to print the body of a node.
...
3
votes
2answers
786 views
Drupal Multisite…sharing content
Is it possible to share content/nodes in a drupal multisite environment.
For example:
Content type "Story"
Site 1- Use this content
Site 2- Don't use this content
Site 3- Use this content
It ...
3
votes
1answer
75 views
Look up nodes that reference a given node
I'm using the references module (not grounded to it, but it seems to work well enough) however I don't know how in a custom PHP block/etc I would be able to do a query that can look up all the nodes ...
3
votes
1answer
519 views
How to disable status messages
I am creating/updating terms and nodes dynamically using code. It shows a lots of status message as usual. But I need to hide those message only for this task. That means if any user create/update ...
3
votes
2answers
1k views
Drupal 7 services json node object
There seems to be a problem with the Services module of Drupal 7 when submitting nodes using the node create reosurce, for example I can create nodes just fine, even with custom fields, but the ...
3
votes
3answers
340 views
how to create a view that searches nodes and users at the same time
I'm creating a custom search to my site using views.
And I want to search both nodes and users at the same time, with exposed filters like this:
[ ] events
[ ] bands
[ ] products
[x] users
But ...
3
votes
1answer
50 views
Looking for a function that searches for nodes
Is there a function in Drupal-7 that looks or searches for nodes that match some criteria (e.g. promoted nodes, published nodes, nodes of a specific content type), rather than using Views?
3
votes
1answer
410 views
how to give edit permission content to new user in drupal?
I have a content type called "company." I have uploaded a lot of company details to the site by myself.
Now I want that people employed by these companies create new accounts in my site, and they ...
3
votes
2answers
2k views
Setting node title as view argument/path
I'm creating a feed view that generates a specially-formatted file when nodes of a specific content type have /tsv appended to the path (generated by path_auto)
I.e.,
...
3
votes
1answer
315 views
Node pagination
I was wondering if there was a way in Drupal to create previous/next links between about 100 nodes of a specific content type. I know there is a pager module, but that allows you to break one node up ...
3
votes
3answers
754 views
Combining two node forms: is that possible?
I am using Drupal 6 and I got a node form for a content type. I want to alter the other content type node form inside the first one; is that possible?
3
votes
2answers
340 views
Single SQL query to pull recent two nodes from each node type
As mentioned in the title, I was wondering how this can be achieved with single SQL query. All I need is the node ID from node table that matches the given criteria.
3
votes
2answers
127 views
How to install a taxonomy system that represents records in another high-volume, non-content-node table?
Here's the scenario:
A writer about celebrity gossip posts a node (article) on a Drupal website.
I have a module that scans the article and automatically creates taxonomy fields based on celebrity ...
3
votes
1answer
32 views
Is it possible to create a Nodequeue of Nodequeues?
I have a number of node queues that serve as collections of nodes. I want the user to be able to take those collections (node queues) and add them to a queue, essentially allowing the user to have a ...
3
votes
1answer
32 views
Do I need to build a custom page to list nodes by content type?
Environment
Mac OSX 10.8.2
MAMP
Drupal 7 (just downloaded the stable today)
Objective
Create a menu item in the main menu to list recent and all nodes of a specific content type.
Question
It ...
3
votes
1answer
69 views
Manage node body in git
For a new blog, I like to have the post text stored as markdown (or an other suitable format) on github. But I want to have all the nice features of drupal (comments, nodes, captcha, menu syste, ...
3
votes
3answers
105 views
problem with hooking node add/edit form
I wanted to hook node/add/patient-history form because I wanted to add ajax in that form.
Before adding Ajax I wanted to get field names correctly. So I tried this:
function ...
3
votes
1answer
243 views
Why node custom fields weren't saved when adding node programmatically?
On node insert I want to save another node with data taken from first node into other Drupal database. The node in second site has 3 fields: title, image field, is_public.
Both Drupal installation ...
3
votes
2answers
92 views
Retain “Last edited by” info
I would like to keep info on the user that last edited a node. From a little search I found that you can easily obtain that info from the node_revisions table. But what if you don't want to enable ...
3
votes
1answer
49 views
Install drupal without node module?
I know this is achievable in Drupal 8 but is there a way to do this in Drupal 7? I've looked into drupal modules, core files but couldn't find anything reliable. I'm asking this because I might want ...
3
votes
1answer
119 views
prevent drupal from redirecting to created nodes
as you know after publishing a node Drupal redirects to that node. How Can I change this functionality ? I want to force it to stay on the same page or maybe redirect it admin page instead of nodes.
3
votes
2answers
1k views
How do I programmatically add an image while programmatically creating nodes?
I'm writing a script to add nodes programmatically, and I don't know the proper way to add/attach image. Actually I'm not that familiar with Drupal.
Here are the (sample) image objects I found while ...
3
votes
1answer
227 views
3
votes
2answers
530 views
Adding multiple nodes using a single form
I want a user to be able to create n nodes of type "Photo Gallery Photo" using a single form.
The node would have the following fields:
name (For the entire upload; only shown once)
phone number ...
3
votes
2answers
311 views
Best way to break up node edit forms smaller, more manageable forms?
It's pretty common to end up with massive node edit forms once content types start accumulating fields. Collapsable fieldsets and vertical tabs help the UI, but it can still be overwhelming.
Example: ...
3
votes
2answers
145 views
Finding all nodes not referenced by a menu entry or another node
In the course of creating the content for a site, we've ended up with orphaned content nodes that are not linked to from anywhere. I'd like to find and examine these. Surprisingly, I can't find a ...
3
votes
1answer
233 views
Return themed node via AJAX / AHAH
Is there a way to get a fully themed node given the node id or path alias so that I can render it via AJAX / AHAH?
3
votes
2answers
208 views
How to reference identical files on multiple nodes?
I have created two nodes that contain a File Upload.
Is it possible to reference files common to both nodes or do I have to create duplicates? I want to reduce the overhead of managing large number of ...
3
votes
2answers
369 views
Node display mode on taxonomy page
How do you choose the display mode for a node that is used on an taxonomy page?
As default the nodes are displayed using the node-teaser mode but i would like to create a custom style for nodes that ...
3
votes
2answers
174 views
Confirm module uninstall
I have written a module that creates a node type and I want to put in a warning on uninstall that lets the user know that the nodes created under that node type will be deleted if they continue to ...
3
votes
2answers
770 views
How to Bi-directional link two nodes from different content type?
Hello i am new to Drupal. I have used Joomla for very long time and some wordpress.
I want to link 2 or more nodes bi-directional. Meaning that if i link A to B, B must be also linked to A.
I will ...
3
votes
2answers
796 views
How do I associate multiple nodes to a user?
I have some users, and I have a "product" content type, which has the following fields: "name," "type," and "description."
I want to associate specific nodes of this content type to a user. How do ...
3
votes
1answer
48 views
Question regarding rendering fields in node.tpl.php
I'm confused in how the fields can be rendered.
There are 2 variables in node.tpl.php $node and $content, both of which contain fields.
My task was to render all fields separately, to surround them ...
