We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [7]

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

Filter by
Sorted by
Tagged with
6
votes
2answers
12k views

Filter a view based on current user's roles?

Using Drupal 7, Views 3 and the Node Reference module, I'm using a view to populate a node reference field on a custom content type. (So it's a view of "Reference" display type.) I want to filter ...
4
votes
4answers
3k views

inheriting fields from a base content type

I need to create 10 content types which, apart from their specific fields, will have 4 common fields (e.g name, surname, email, age). Since I'm using Features I could create the first and copy paste ...
3
votes
3answers
9k views

How do I change the uploaded file name after the node has been saved?

How can I change the name of an uploaded file after the node has been saved? I know there is the FileField Paths module for this purpose, but it's still buggy for Drupal 7. I looked at the source of ...
7
votes
5answers
27k views

Customizing menu link output

In Drupal 7, how I can intercept menu rendering in template.php and add pipes after menu links? I tried using template_preprocess_menu_tree but I don't think that is what I am looking for. I want to ...
3
votes
4answers
8k views

Views with Entity Reference

I'm not sure why this is difficult for me to get. It seems like it should be simple. I have a content type A and content type B. Content type B has an entity reference field to content type A. ...
5
votes
4answers
4k views

How can I show a block in a view page, excluding its paginated pages?

I want to place put a block in a view page. Let's say the news page, whose path is http://www.example.com/news. The view uses pager to list the content. I want a block to show up only in the ...
1
vote
1answer
738 views

How to add a link to the CSV download to my module page, for a report created with Forena?

How do I add a link to the CSV download created by the Forena module to my module page? Do I just copy the link in 'inspect element' and put that in my $output variable that I return on the ...
15
votes
0answers
9k views

A better anti-spam solution for Drupal 7? [closed]

I have Mollom and HoneyPot set up and working. I tried various Captcha modules with images, etc. I even put a question field in the registration form using Mollom and HoneyPot. Although the answer isn'...
4
votes
2answers
10k views

Adding more fields to the registration process

In Drupal 7, is there a way to add more fields to the registration process? I was thinking along the lines of birthday, fullname, gender, twitter, etc. Also how do I access this data once it's in, so ...
3
votes
1answer
914 views

How to iterate over all field collection items in an eMail body using Rules?

I'm trying to write a rule (using Rules) that will send an email to users of a role. Within the body of the email, I'd like to display the contents of a nested field collection. I've tried using what ...
3
votes
1answer
572 views

How to check for product taxonomy term in Rules actions (Ubercart)

I am using Drupal 7 with Ubercart. I am trying to configure to send an email when customer makes a purchase of a product mapped to one particular taxonomy term. I tried adding actions in a custom ...
2
votes
1answer
145 views

How to access current amount of earned userpoints in a Rules Condition?

I have no access from Rules to [points] field or any userpoints field (User points module). I have enabled: Rules, Rules scheduled, Rules_ui, Userpoints, Userponints_rules_integration, ...
2
votes
4answers
8k views

image style (imagecache) images are not being created

Currently i am unable to create images that get resized automaticaly according to the different image styles. This includes the default styles such as thumbnail as well as the custom created styles. ...
1
vote
1answer
6k views

Field level permissions in Drupal 7

What is the best way to create a piece of content with multiple fields... allowing users to edit the content as a whole yet blocking the ability to edit. The setup I have is a piece of content that ...
1
vote
3answers
1k views

How to bulk delete selected content/nodes?

I want to bulk delete data and along with it I need check-box where I should able to "select all" data to delete. I tried the Delete all module, which is helpful to delete all the content, but it's ...
34
votes
14answers
10k views

How to move installed modules from /sites/all/modules/* to /sites/all/contrib/modules/*

I have been searching for the answers to this question with no luck at all. From what I observe in the database structure, the location to the modules are specified in the 'system' table. The only ...
36
votes
9answers
13k views

How to create a union of two views?

I'm trying to get a union of a user's nodes and comments sorted by "post date". This post links to sandbox projects for D6 but there is nothing for 7. This post has an example of using ...
37
votes
4answers
24k views

What's the proper use of EntityFieldQuery?

In Drupal 7, the API documentation for node_load_multiple() specifies using the $conditions parameter has been deprecated in favor of using EntityFieldQuery. How does one use the class to generate a ...
20
votes
9answers
13k views

How to 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: ...
26
votes
5answers
9k views

Node translation vs. Entity (field) translation

I would like to know what you guys recommend for a multilanguage site. For example, consider the following case: A page and its content should be available in 3 languages (e.g. German, English, and ...
18
votes
4answers
12k views

How to use a views contextual filter OR?

After browsing the net and SE for a while it appears to me there is no good solution to combine 2 contextual filters with OR (rather than the default AND). This post mentions a PHP hack and this post ...
36
votes
4answers
7k views

How do I debug permissions?

How do I debug permissions in Drupal 7? I use core reporting, error logs, devel module error logs, backtrace and node access permission block but sometimes it is not enough. What else should I check ...
27
votes
6answers
30k views

How to add module to admin/config page?

I'm working on a module in Drupal 7. I've added a hook_menu implementation: $items['admin/config/content/mymodule'] = [ 'title' => 'MyModule', 'description' => 'Configure ...
21
votes
8answers
14k views

Revert a Feature Component programmatically

I have a Feature installed using an Installation Profile. But I always have to go and Revert a particular Component so that it's no longer Overridden (so that, for example, the Feature's Blocks appear)...
24
votes
6answers
25k views

Programmatically attaching files

I have created the "Gallery" content type, and added two fields: "photo," and "document." I then used the following code for uploading a file in the "document" field: $file = file_save_upload('...
37
votes
2answers
29k views

How to get a node by its url alias?

I know I can load a node by its title with the node_load() function. Is it possible to load a node by its URL alias?
20
votes
5answers
13k views

How do I use hook_views_query_alter()?

Following what reported in the documentation for hook_views_query_alter(), I created a file named alterform.views.inc and put it into an enabled module called alterform. I added the following code in ...
26
votes
4answers
30k views

How to theme a custom block

I've created a block using hook_block_info and hook_block_theme and the like. But how can I theme it? I have it working to return an array with the keys 'subject' and 'content'. But I created the ...
12
votes
2answers
17k views

How do I get a list of all taxonomy terms assigned to a node?

I have a node and want to get all the taxonomy terms assigned to the node. In drupal 6 I could use $node->taxonomy and the taxonomy_* functions but these don't exist in drupal 7.
11
votes
2answers
14k views

Webform - Submit values from Drupal 7 from to external url

I am a self-proclaimed newbie to creating forms in Drupal. I have a form hosted on a Drupal 7 website (using the webform module) and need to submit the form values to an external url. I've been ...
10
votes
3answers
21k views

How to change programmatically exposed filters in views

I have a page view with exposed filters. One of the filters is term vocabulary, and that's dropdown list, user can select only one category (term). I want to set programmatically one term from ...
25
votes
7answers
43k views

How to programmatically trigger a click on an AJAX enabled form submit button?

I'm trying to programmatically (with jQuery) trigger a click on button with AJAX behavior in a Drupal form, but so far jQuery('#edit-submit').click() doesn't do anything. A real mouse click on that ...
18
votes
7answers
22k views

Add FILTER CRITERIA in Views Programmatically

I want to add/modify a filter criteria programmatically. For example, for a view, I added an "Email Address" filter whose value is needed to change dynamically, it is needed to set to the current ...
10
votes
5answers
17k views

hook_preprocess_page(): how to tell a views page?

Im writing a custom module that need to insert some javascript and css files only in a Views page. Im using hook_preprocess_page, but I can not tell if the current page is from a view: function ...
8
votes
2answers
11k 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', ); ...
7
votes
2answers
11k views

Create Entity Programmatically in Drupal

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 ...
5
votes
2answers
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 ...
5
votes
2answers
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"...
20
votes
4answers
12k views

Send user's password in mail

I want to send a reminder email to the users to log in to my website with their username and password. My mail script is ready with the login ID, but I don't know how to decrypt the user's password. ...
15
votes
5answers
47k views

render or print image in a drupal 7 node.tpl?

I am trying to theme a node with tpl and when i tried to print image , I cant find image path like in d6.. which function i have to call to properly output image .. I mean something like theme('')? ...
13
votes
5answers
11k views

Programmatically delete one entry from one field on one entity

What's the proper way to programmatically delete one specific field entry for a multi-entry field from one specific entity? (that's specific fields and specific entities, not field types or instances ...
10
votes
7answers
20k 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 ...
9
votes
4answers
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. ...
9
votes
4answers
19k views

How to make form buttons call only javascript?

I'm experimenting with JavaScript and Drupal forms. Currently I'm trying to make a button in the administration form of a module that will use JavaScript to append options to a select list. The ...
7
votes
4answers
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 ...
5
votes
2answers
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'] = ...
22
votes
5answers
36k views

Hide a field label

Is there a way to hide the field label when rendering a custom field in Drupal 7? In my node template I have: <?php print render($content['field_image']); ?> Which gives me: <div class="...
17
votes
4answers
8k views

How do I programmatically install and enable a module?

There is a lot resource for doing it in Drupal 6, but I didn't find a solution for Drupal 7. How can I install and enable selected modules?
14
votes
1answer
4k views

Can I use the Twig template engine?

I do a lot of Django development and I like their templating language. Twig, the new templating engine in Drupal 8, looks very much like it. How can I use Twig in Drupal 7 or even Drupal 6?
13
votes
4answers
20k views

How to clone a content type? [closed]

I want to clone a node type and add a few fields in it. I think the simplest will be to duplicate it and start working on it. It seems there is no official way to clone a content type in Drupal 7. ...