Questions tagged [7]

Version tags should be used for questions that apply to a version only, not to merely say what version a site is using.

Filter by
Sorted by
Tagged with
8 votes
3 answers
5k views

In hook_user_login is there a way to know if this is the first time the user has logged in?

I'm overriding hook_user_login to redirect users to a specific page when they log in. The problem is I'm using the verification email setting on registration which requires the user to set their ...
SomethingOn's user avatar
  • 1,281
8 votes
3 answers
3k views

Issue a html.tpl.php override from a module?

Is there a way to override the output of a page from a contributed module and issue your own html.tpl.php, effectively taking control of the output from the theme? I want to do this in effort to ...
Kevin's user avatar
  • 27.8k
8 votes
2 answers
13k views

How do programmatically create fields for content types, and ADD them to the the content type form

Say I have this field, "map_description". I know I would this function to define the field: $field = array( 'field_name' => 'map_description', 'cardinality' => 1, 'type' => 'text', ); ...
rugbert's user avatar
  • 249
8 votes
3 answers
5k views

How to display a flag to anonymous users?

I'm using the Flag module, but I have a problem in displaying a flag to anonymous users. I have 2 flags called "make feature" and "add to Favorites". I want to display this flag to anonymous users ...
Pranav Gandhi's user avatar
8 votes
4 answers
2k views

How can anonymous users be allowed to post while still maintaining content integrity?

A little background: As you see on http://charlotte.ebayclassifieds.com, if you click 'post an ad' and then choose a category, you can fill out the form and submit content without having to sign up. ...
blue928's user avatar
  • 3,804
7 votes
2 answers
12k views

Programmatically create an entity

I created an entity via Entity Construction Kit, Initially I wanted to use rules to create the new entity but the entity is fielded and the fields don't get exposed in rules (as of now, someone is ...
Antonio Torres's user avatar
7 votes
4 answers
2k views

How can I send email to user that is not logged in since 30 days?

I am using Drupal 7, and I want to send email to registered users who have not logged in to the site since 30 days; for example, an email saying: Hello user, you are not login since 30 days. Is ...
joelle lonnie's user avatar
7 votes
6 answers
14k views

How can I import and export Drupal Commerce Products?

I have a Drupal 7 site and installed the Drupal Commerce module. In which I have added Commerce Product with Category like: Software Products Hardware Products Electronics Others I would like to ...
AshwinP's user avatar
  • 406
7 votes
2 answers
3k views

Public and temporary files error in my "Status Report"

I just upgraded to 7.25 from 7.19, and now in my Status Report I have a red X on my "Public Files" and "Temporary Files". See http://drupal.org/SA-CORE-2013-003 for information about the ...
EGHDK's user avatar
  • 315
7 votes
3 answers
22k views

How do I define a template file for a specific node ID?

I'm trying to define a custom template file for a specific node, using the node ID. I read a lot of topics saying to create a node--X.tpl.php file in the templates folder. That's what I did; ...
Ludovic's user avatar
  • 95
7 votes
5 answers
8k views

Changing an inner join to a left join in views 3.3?

Using views 3.3, I have a view in Drupal 7 where I am showing two content types. I have a filter criteria based on the value of a field that is attached only to one of the content types. So long as I ...
user1359's user avatar
  • 3,909
6 votes
5 answers
24k views

How do I programmatically create an entity with its fields?

I'm using Entity API to work with some entities but I cannot figure out how to create a new entity with its fields attached. I created a bundle and added some fields to that bundle. I'm looking to ...
user1750's user avatar
  • 1,276
5 votes
2 answers
7k views

Theme Drupal Form API checkboxes as a grid

I have a custom form that displays a form element of about 2 dozen checkboxes. I would like to output them 3 per row, in a table if possible. How can I go about doing that? $form['preference'] = ...
Kevin's user avatar
  • 27.8k
5 votes
2 answers
4k views

How to create basic Organic Groups functionality with flags and references?

I've used Organic Groups for the past 6 months and found it to complex for my simple use case. Creating even basic views to show users of a group or content of a group turns quickly into "rocket since"...
uwe's user avatar
  • 12k
5 votes
2 answers
5k views

Add properties to an entity hook_schema_alter

I need to implement a custom module that adds fields and properties to an entity defined in another module. I felt the best way to do this was using hook_schema_alter and hook_update_n to achieve the ...
Kevin's user avatar
  • 27.8k
5 votes
2 answers
11k views

Looking for a good Mini - Panels tutorial [closed]

There are lots of good to tutorials for view and panels, but I'm having trouble finding specific information on how to properly use mini panels. Does anyone know of a good tutorial or explanation of ...
user379468's user avatar
  • 2,520
4 votes
2 answers
2k views

How to create (& pre-populate) multiple “field collection” fields on an ajax call

This is an extension of this question - "How to pre-populate multiple "field collection" fields in node form" I'm trying to do the same thing, but I'm trying to get it to work on an ajax ...
Dominic Woodman's user avatar
4 votes
3 answers
6k views

create drupal 7 webform programmatically?

I have already created a webform and I need to fill it programatically. how can I create webform ? Can i create it like node creation: $node = new stdClass() $node->type = 'webform' $node->...
genaro's user avatar
  • 71
4 votes
2 answers
3k views

How to debug a rule that doesn't want to fire?

I have nodes that can be flagged with a global flag. When a node is updated I want a rule to unflag that node. Rules Event: After updating existing content Rules Action: Unflag a node. I then select ...
uwe's user avatar
  • 12k
4 votes
6 answers
8k views

How to hide default "N/A" option for checkboxes?

I have a "gender" (checkbox) option that I want to show on the user profile page (but not on the registration page). The options are "Male" (default) and "Female". Since I don't make the field ...
uwe's user avatar
  • 12k
4 votes
3 answers
9k views

Path alias tokens and node references

I'm trying to figure out if path aliases are even capable of what I'm trying to do, or if I need some other sort of module. I have a content type "project" and a content type "mockup". A "project" ...
Matthew's user avatar
  • 245
4 votes
3 answers
1k views

PHP in database: bad practice but

Lots of times here I've been told that using views custom php fields, filters or others is a bad practice, because putting php in the sql is dangerous. My question is, if you only call to a function, ...
Gregory Kapustin's user avatar
4 votes
0 answers
843 views

How do I suppress a warning or error message for site users? [duplicate]

file_unmanaged_copy() drupal_set_message() on certain conditions. Even with visible errors messages disabled, anonymous users see this. Indeed, the comment in the code even has a TODO to change it to ...
njp's user avatar
  • 727
4 votes
4 answers
6k views

After logging off, a user is able to see the pages by pressing back button of the browser

I have a requirement in which the user should not be able to see the books in the site unless he is logged in. And the user is not able to see the content. The problem is when a user logs in, views a ...
AjitS's user avatar
  • 10.9k
3 votes
5 answers
14k views

How can I add the full HTML format, and attach CKEditor to it?

I have 2 Drupal sites running on Drupal 7. How can I add the full HTML format, and attach CKEditor to it?
Russ's user avatar
  • 65
3 votes
2 answers
5k views

How to trigger Ajax forms machinery

I'm working on ajaxifying a form which uses Hierarchical Select widget. I need to update a text field based on the value of HS and a couple of other fields. I want to use Drupal forms Ajax API. I ...
Dmitry Vyal's user avatar
3 votes
2 answers
5k views

Need to redirect the non-existence URL's to 404 page instead of parent url

This is in connection to drupal.org issue #432384. That's when I happen to request for page "node/1/aaa/bbbb", I'm served the response for "node/1" (it's parent page). I can understand, this is the ...
Sivaji's user avatar
  • 2,466
2 votes
1 answer
3k views

Filename for the front page template file

How can I I create a theme for the front page only? I only want to change what is in the content area and leave the rest as it is on the page.tpl.php template file.
2 votes
1 answer
826 views

How to revoke edit access to the node's author after publishing a node?

I am trying to build a new rule on Drupal 7 with both the Rules and Content Access modules (and its sub module Content Access Rules integration). Thus, I get new actions like "grant or revoke an ...
Toki's user avatar
  • 424
2 votes
2 answers
251 views

Custom Login form question

In my website have two types people login one is designer another is reader, i want people come to login my website by role. Mean designer go to design login form to login. Reader go to reader login ...
zeno's user avatar
  • 21
1 vote
2 answers
950 views

How to make menu badges count disappear after the page is viewed?

With reference to my previous question which was a little confusing or I should say it was mixed up with two different problems. I am posting my question again with clarification. I have created a ...
Umair's user avatar
  • 441
1 vote
2 answers
89 views

How to grant userpoints only for modifying nodes last changed at least 20 days ago?

I am not sure how to go about this. I use the Userpoints module in Drupal 7 to attribute points to users who create nodes ('reviews'). I also want to allow them to gain some points if they supersede ...
Pierre_colin's user avatar
1 vote
1 answer
1k views

Optionally add image/icon after node title based on boolean content type field?

Using Drupal 7.10 with a Zen sub-theme. I have a custom content type, say Product. The products have titles such as "Wrench", "Hammer", "TV". I want to designate certain products as being a ...
User's user avatar
  • 1,723
1 vote
1 answer
178 views

Cannot login after moving site [duplicate]

I am in the process of recovering from a catastrophic hard disk failure on a completely new machine. I am fortunate to have both a database backup and a backup of the folder with the D7 code that was ...
herzbube's user avatar
  • 225
1 vote
1 answer
485 views

How to add a column to the list of group members or create a Views equivalent of it?

I use the "Group" module and I want to add a column "Email Address" on the page that lists the members of the groups (I want to put this "Email" column between the column "member name" and the column "...
user avatar
40 votes
11 answers
29k views

How to display a field before node title?

I'm looking to render a certain field before the node's title when displaying a teaser in D7. Effectively I want to go from this to this. I have looked into updating the node.tpl.php but I notice ...
irishbuzz's user avatar
  • 645
36 votes
12 answers
38k views

Get all users with specific roles using EntityFieldQuery

I thought this was an easy task, yet there does not seem to be a Drupal-method for this. I came as far as knowing I have to use EntityFieldQuery for this - because the API said conditions for ...
nocksock's user avatar
  • 689
36 votes
2 answers
26k views

Difference between Minimum cache lifetime and Expiration of cached pages

On Drupal Performance Page, under the fieldset Cache you have two options. One is Minimum Cache Lifetime and the other is Expiration of cached pages. What is the difference between these two.
Gokul N K's user avatar
  • 6,703
33 votes
19 answers
41k views

How to hide Input Format Options and help text under a textarea?

How to hide Input Format Options and help text under a textarea when adding|editing a node?
Cosmodrom's user avatar
  • 458
33 votes
8 answers
51k views

How do I programmatically show a view block?

I created a view block, whose machine name is "news." How do I display it using module_invoke() and the machine name of the view?
vitaly.batonov's user avatar
32 votes
5 answers
17k views

Do I need a cron task for processing a queue?

I've got a task that takes about 45 minutes to complete and needs to happen every day (synching users to several external database, etc). To handle the work, I've set up a cron queue with ...
joe_flash's user avatar
  • 664
32 votes
4 answers
53k views

How to use drupal_mail() to send emails with custom template

I would like to use the drupal_mail() function to send out emails but with a custom HTML template so that they are in keeping with my website design but I am a complete newbie to hooks and modules etc....
Andy's user avatar
  • 775
30 votes
5 answers
22k views

How do I override a taxonomy/term/% list with a view?

I have a vocabulary attached to a content type. Only one term can be selected to categorize a node made with this content type. The vocabulary is called Vehicles and has terms 'cars, trucks, boats.' ...
blue928's user avatar
  • 3,804
29 votes
6 answers
16k views

Debug EntityFieldQuery?

I have a module which is misbehaving. An EFQ is returing unexpected results, but I can't see why just by looking at the code. Is there a dpq() equivalent for EFQs? Other ways of debugging them?
Letharion's user avatar
  • 27.5k
25 votes
14 answers
13k views

How do I hide the default page /node?

Drupal out of the box comes with a page (which is the default homepage) that is assigned to the node path. How do I avoid users reach it, and redirect them to the actual homepage of the site?
wiifm's user avatar
  • 5,290
23 votes
5 answers
39k views

How to add extra fields to user profile?

I'd like to add additional fields to the user profile. I'd like user to be able to edit almost all the information I store in the database about him. I have some ideas: maybe it's possible to do ...
Alexey's user avatar
  • 941
23 votes
5 answers
43k views

How to update a field value for a node?

I want to change the value of a field for a node.I used the following code: $node = node_load($nid); // $nid is the function's parameter $node->field['field_myfield'][$node->language][0]['value'] = 1;...
hpn's user avatar
  • 2,398
22 votes
7 answers
17k views

How to programmatically set the front page?

I want to set the Drupal front page programmatically at run time. How can I do this? Is this possible?
radu c's user avatar
  • 4,350
20 votes
6 answers
14k views

How do I implement two-way node references?

The node-reference module (a component of CCK) provides a great way to create a reference one node from another. What is the best way to expose a two-way relationship between the two? Example below: ...
markdorison's user avatar
  • 5,604
20 votes
1 answer
11k views

What API function do I use for redirecting to external URLs?

When writing a module, for redirecting to Drupal paths, one uses drupal_goto. Is there some API function that I should use for redirecting to external pages? Or is setting the Location with ...
Chris Wesseling's user avatar

1
3 4
5
6 7
59