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.

learn more… | top users | synonyms (1)

3
votes
2answers
93 views

Alternate solution to avoid handling a huge number of menu items

I am on Drupal 7 and I am facing a dilemma with a project I am building. It will be a content-rich website, which means lots, lots, tons of articles. When user enters an article page, I want him to ...
3
votes
1answer
869 views

How to enable users to add content only from some pages (and only once) in Drupal 7

i currently need to implement this use case in drupal. We have two different type of users: registered users and moderators. I need to do the following: registered users can add only one ...
3
votes
1answer
70 views

How to add an external image to node with a module?

I have created a form through my module in which the user(anonymous) can enter an image URL and some title for the image. The link needs to be, like with remote stream wrapper, shown as an actual ...
3
votes
0answers
61 views

Replacing tokens in Newsletter

I'm trying to create a custom template using the drupal Newsletter module. I need to populate the newsletter with existing content. For this, I think I need to replace a token like [node:nid] in the ...
3
votes
2answers
688 views

Drupal 7 node.tpl render field from referenced entity

I have a node.tpl.php file where I need to output a field from an entity referenced via the entity module (a reference field). I have tried using: print ...
3
votes
1answer
470 views

Is there a way to set the pager's page number programmatically without the page being in the url?

I would like a user who has previously left a comment on a node to initially see the last page of comments while a new user (to that node) will initially see the first page of comments. I know that ...
3
votes
1answer
884 views

pass cck email value to webform block

I currently have 2 webforms displayed on a page - these are inserted dynamically from a node.tpl.php file. However, I also have a cck field on the current node for an email address - I would like to ...
3
votes
1answer
549 views

Why cannot an administrator user create new content? [closed]

I log in as administrator user, and create a new node. I fill all the form fields, but after I click on "Save," the node is not created, and I don't get any error message in the form. I tried with ...
3
votes
0answers
213 views

Autocomplete field is blank on form submit

I'm using jquery UI dialog to create a confirm save/publish popup. The dialog has the author field displayed in it and works pretty well, the autocomplete looks like it's working, until you submit the ...
2
votes
1answer
311 views

Executing PHP code only once, when the node is created

I am using Drupal 7 with the Token module. I wrote PHP code using the token field that can satisfy loading a specific node, updating some field values, and saving the node (using node functions). ...
2
votes
1answer
424 views

How to add a term image to node

I have a nodes, and a few vocabularies to choose terms from. I would like to show images of terms from specific vocabulary in nodes (If node is associated with term from specific vocabulary, it would ...
2
votes
3answers
597 views

change save button text of a node to submit

I am using drupal 7.10 I have a content type in which i want to change the save button text to submit.I tried various posts in this forum to no avail.i need help on this.Thanks in advance.
2
votes
2answers
387 views

What is right way to modify a node field in a multilanguage system (LANGUAGE_NONE or $node->language or …)

Let's say we want to modify the body field. $node->body[LANGUAGE_NONE][0]['value'] = "test"; This will work if the node is language neutral (?) $node->body[$node->language][0]['value'] = ...
2
votes
5answers
4k views

How to print fields in node.tpl.php?

I need to print individual fields from the $content variable in node.tpl.php file in separate div tags. How do I do that and how do I find out what the field's names are?
2
votes
2answers
1k views

Automatically unpublish / move to archieve an article or node in Drupal 7?

I need to have a functionality that allows the user to create an article and choose for how long he/she wants it to be published (for example 7 days or 2 weeks). After this time the node will ...
2
votes
2answers
159 views

How to translate my drupal site in other language.

My drupal site is in default English language and I have added Spanish and German languages using Internationalization and Locale Modules. When I switch to other language using Language Switcher block ...
2
votes
3answers
1k views

How to create new node programmatically, when a new user is created, in Drupal 7?

At the time when a new user is created, I want programmatically to create a new node (of some defined type) and make him the owner of that node. How can I do this in Drupal 7 ?
2
votes
1answer
1k views

Check if the page is a node using arguments in D7

In Drupal 6, to check if current page is a node, we use the following snippet: if (arg(0)=='node' && is_numeric(arg(1))) { /* Do stuff. */ } Since this is a frequently used statement, I ...
2
votes
5answers
3k views

Using a different view mode with a node

I understand using Views you can use a different view mode, e.g. teaser or full content. Is it possible to view a node using a view mode other than the full content view mode? What I want to achieve ...
2
votes
1answer
407 views

CSV node import using feeds module on a Mac

I'm using the feeds module to try to import several thousand nodes, but I'm getting mixed results: sometimes it seems to work, sometimes it doesn't. I understand there are some sort of issues related ...
2
votes
1answer
419 views

How to acess node object in hook_form_alter

I am trying to access node object in hook_form_alter.But it throws following error Notice: Undefined index: #node in themename_form_alter() By using dpm($form) i found there is no access to #node. ...
2
votes
1answer
121 views

Is it possible to assign permission to fields?

The idea is that one can assign permission to fields just as node types. Evidently this gives great flexibility to webmasters to account for unforeseen requirements. The advantage seems obvious: one ...
2
votes
1answer
523 views

Get IP address of submitter

I'm actually testing a website with Drupal 7. I am searching a way to get the visitors' IP, when they submit a new node; the users can also be not logged-in, as anonymous users are allowed to submit ...
2
votes
1answer
108 views

Project Pages of Drupal

I have seen project pages in drupal under http://drupal.org/project/xyz. I don't know how that works really. Is this a specific 'Content Type' it is, but each node (aka project) has extremely ...
2
votes
3answers
180 views

What's wrong with my custom node template?

I'm attempting to make my first custom node template that is supposed to be used for a certain content type with the machine name of "content_block." I copied the "/modules/node/node.tpl.php" file to ...
2
votes
3answers
190 views

Disable comments in nodes specific taxonomy terms are attached to

I know it is really easy to disable comments if your content is organized by content type, but what if it is organized by taxonomy, is it possible to disable comments on all nodes with, say, the term ...
2
votes
2answers
1k views

How do I print out a specific node to my page?

I'd just like to print out the body of a specific node (no title or other fields). Am I doing this right? echo node_load(127)->body['und'][0]['value'] I can't seem to find the answer in any of ...
2
votes
1answer
191 views

Drupal use Node or not? And how to use them?

I'm on the way to develop a website for a kind of a sport-league where we have every year one season with different teams. A team can be built out of two Users and they can play against other teams. ...
2
votes
2answers
292 views

Attach different CSS styles on a node basing on publishing date or other PHP properties

I want to attach a different CSS style to a node, basing on the node publishing date or some PHP properties. What would be the best way to do this?
2
votes
2answers
510 views

Different style when listing nodes and displaying a single node

I'm new at Drupal, coming from the PHP framework world, and I'm having some problems understanding the the template hierarchy in Drupal 7. I've created a template called 'node--article.tpl.php' and ...
2
votes
3answers
203 views

How do I allow users to determine which other users can edit their content?

I'd like to let users specify which other users may edit their content. Basically a user would be able to create a piece of content, which they are then allowed to edit but no other users can edit ...
2
votes
1answer
581 views

Converting a timestamp to PHP date format for a field in a node template

I have an imagefield, 'event_image' and printing all possible variables for the field tells me I have timestamp as a possible variable of the image to render. I use: print '<pre>'; ...
2
votes
1answer
483 views

How to stop Drupal for setting node changed date on creation?

This is my second question about my issues with creating custom migration script. I am creating only new nodes and don't care about updates. Code: $node = new stdClass(); ...
2
votes
1answer
1k views

Drupal 7: Filter nodes with a date range arround an exposed date

My issue is somewhat opposite of the common "List nodes within a date range". So, I have an Event content type, with fields start_date and end_date. They show when the event starts, and when the ...
2
votes
2answers
507 views

Drupal node templates which apply to more than one content type. Possible?

I've started looking at content type specific node.tpl.php files. However, say I have two content types, and wish both to be displayed in a similar manner, but not apply this to every content type (at ...
2
votes
2answers
761 views

How to add custom node field into page title?

I have a custom node field I want to add into the page title. How can I do this? Content type is a property listing and I want to have area size and location printed next to the title. e.g. Large ...
2
votes
1answer
650 views

Find if the drupal node is published or not published in node_save()

I am trying to find if the user has set the node to be published when creating a node. Upon hitting save, the call to node_save() is done; I tried to call print_r($node), but nothing seems to show up ...
2
votes
3answers
150 views

How to create two nodes at a time?

I have one cck content type and two fields in this content type 1. is First name 2. is Last name i am trying TODO when i fill this these fields and click on save button Automatically create Forum ...
2
votes
2answers
55 views

Updating user profile to update node

I currently have a user's profile set up with some extra fields and when that user obtains the role "paid user" an entity is created with a rule and a node that copies those extra fields in the ...
2
votes
1answer
41 views

Avoid duplicated external links

I would like to add a section on my website (Drupal 7) which consists of articles with external links (as source). To avoid spam and duplicated content, I would like to avoid that users may add a URL ...
2
votes
1answer
290 views

Getting the entire index of nodes from REST API

I'm looking for a way to get all the nodes to be shown on my REST service. When I query the endpoint index http://server/api/node it only returns 20 results. Are there any additional parameters I can ...
2
votes
1answer
197 views

Moving title into Content Type node?

I'm currently building my first Drupal theme (have experience in other content manager systems) and just have a quick question regarding normal practice... So, I have a number of different templates ...
2
votes
1answer
182 views

Fetching specific node fields instead of whole nodes using EntityFieldQuery

The standard for fetching specific nodes from the database in Drupal 7 goes something like this: $query = new EntityFieldQuery(); $query->entityCondition('entity_type', 'node'); ...
2
votes
3answers
202 views

How to prevent admin role from changing “Updated date” of content

The updated date of the content is displayed on each node with this code in template file. <?php print strftime( "%Y-%m-%d", $node->changed) ?> Now when I save the content with admin role ...
2
votes
2answers
467 views

Determine if node is new

I am inserting nodes from an external application into Drupal (7.x). I've taken care of the node_revision table and other tables needed by Drupal to see the node. However I have pathauto installed and ...
2
votes
2answers
478 views

How to programatically print all comments from a given node?

I need to print comments belonging to a given node. So basically, get a node id then choose all the comments from a given node and print them. I know that I can print one comment(for example with ...
2
votes
1answer
3k views

how to create rules to send email notification for node reference content?

i have two content types 1) job posting 2)job Application content type "job Application " has node reference field for "job posting". so whenever one user create a "job posting" means, ...
2
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 ...
2
votes
1answer
2k views

Node path change [closed]

On every node save in Drupal, the menu looks like 'node/3' which is the nodes path, i assume the engine that is responsible for building generic paths to any menu path in drupal talks with menu_router ...
2
votes
2answers
876 views

Hook into node operation from theme template.php?

I have made a new content type in Drupal 7 in Drupal Admin (not via module). What I want to do is to add a Hook on the insert and update operation. How can this be done when my node type is not ...

1 2 3 4 5 25