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
1
vote
1answer
5k views

Drupal 7: adding an image and a link to a user page

I have a new Drupal 7 website with user profile pages like this one. I'm new to Drupal and do not want to install any modules besides the core ones and the few written by me - because this will keep ...
6
votes
2answers
2k views

How should I handle container form elements?

I have added some custom fields to the register user form and I'm discovered that they are sent back, packaged in a form element of type "container". My code needs to handle all kind of different ...
4
votes
2answers
861 views

Is it possible to make only one field in a content type language neutral?

If you have a text field, that you do not want to be translated (i.e. language neutral) as in a field for an email address, how do you set just that one field to be language neutral, while leaving the ...
8
votes
6answers
7k views

Taxonomy breadcrumbs

I'm using the core taxonomy module for blog tags but when on a tag's page can only get the breadcrumb to appear as 'Home', whereas I'd like it ideally to be 'Home > Blog > #Tag#'. I'm using custom ...
14
votes
2answers
8k views

Changes in the way Drupal 7 handles JavaScript and jQuery

I'm currently developing a JavaScript script that runs on an administration page. I read up on the changes made in Drupal 7, namely the move from document.ready() to its own jQuery function. However, ...
1
vote
2answers
319 views

Is possible for a module to know when one of its blocks is being output on the dashboard, and change the content of that block?

Drupal 7 has a new core module (dashboard.module) that allows users with the right permissions to add blocks defined from third-party sites to the dashboard, which is shown as overlay on the current ...
2
votes
2answers
240 views

How can a module check if Drupal is showing one of the update pages?

What should a module do to verify if Drupal is updating the database tables to avoid to output a message when one of the update pages are being shown (or to avoid to do any superfluous task during the ...
3
votes
1answer
1k views

Node form redirect based on submit button value

I've read and experimented with several ways to redirect a form once submitted. However, I only want to redirect a node form if the operation is t('Save'). If I set $form['#redirect'] = 'blah' in ...
3
votes
6answers
2k views

Can I use the Rules module to send mass emails to authors of selected nodes?

How can I leverage the Rules module to look for nodes where a CCK field has a specific value, and when found, email those node authors? For example, if I wanted people to login and update their ...
4
votes
2answers
1k views

Is there a way to alter the implementation of a hook given by a third-party module, or a core module?

I have a module that should replace the implementation of a hook done by another module. Is it possible to do it, with Drupal 7? If it is possible, under which conditions is possible? By replacing ...
1
vote
1answer
3k views

How do you use the Drupal 7 overlay on the node/edit screens for your popups when it's already being used?

I'm writing a module that adds a button to node/edit forms. This button needs to popup a DIV/IFRAME in a light box. I notice that Drupal 7 uses the new Overlay module for administrative and node/edit ...
2
votes
2answers
2k views

How do I load a library defined with hook_library() on node/edit pages?

I've defined a library of JavaScript files and CSS files required for my module to function using hook_library(). How do I go about loading this library on node/edit pages?
1
vote
3answers
919 views

Customising field container

I've created a cck field formatter. The field outputs uploads from filefield into embedded iframes that link to google docs for display. It currently outputs: <div class="field field-type-...
1
vote
2answers
517 views

How does Drupal determine the context in which to display the admin theme?

One of the great things about Drupal 7 is the inclusion of an admin theme, Seven. But how does Drupal determine whether to display the administration theme, or to display the site's theme? Is it ...
18
votes
2answers
5k views

How to create a hook?

How can I create my own hook (similar to the ones Drupal core creates) for other Drupal modules to utilize?
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: ...
14
votes
5answers
3k views

Building a Views Filter

I want to build a filter for a custom module I built and have integrated with views. In essence, the module allows you to define types of relationships between different nodes. I'd like to create a ...
2
votes
3answers
3k views

Drupal caching prevents cookie read

On one of my production sites I wrote a jQuery stylesheet switcher. It drops a cookie when a selection is made and uses php to select the corresponding stylesheet on pageload which overrides styles. ...
1
vote
1answer
275 views

Allowing third-party modules to alter the query executed by a module

I am developing a module that exposes a public API, which includes functions to save data in his own database table, which is supposed to be used from any module that uses my module. The module ...
2
votes
2answers
730 views

How can I provide a filter with context/nid of node invoking?

I'm currently working on a custom module that has a filter that requires the node object for the output. Originally the filter was simply pulling in the NID from arg(1) and using that to load in the ...
9
votes
2answers
3k views

How to automatically deliver Drupal 7's static contents using CDNs?

I use "Rackspace Cloud Files" service as my CDN (Content Delivery Network). This service provides nice API for many CDN-related automation. Please, help me to integrate Drupal with Rackspace Cloud ...
8
votes
3answers
3k views

How can I create a bulk node creation interface?

I have a request for an interface where nodes with a small amount of required fields (for example, a title, date, and a node reference) would be able to be created in bulk on one screen. I am ...
13
votes
2answers
6k views

Drupal 7 and PageSpeed

The Apache module PageSpeed provides various optimizations for HTML, JavaScript and such, which is great. However, some of its features are redundant with Drupal's own aggregation and optimization ...
7
votes
2answers
457 views

How can I have non-exact locations on a map?

I'm using GMap to help users find other people in their area. But I'd like to let users have some privacy only making their city and zip code available in the map, but still have the full address in ...
7
votes
3answers
2k views

Can I change the order in which hook implementation by different modules are called?

In D6, I use a contrib module, but I would like to override a small bit of its behavior. I have a custom module for that, but my implementation of the relevant hook is called before the implementation ...
2
votes
2answers
285 views

How to denote a user as a “system account”?

In the Unix world, there are "user accounts" for humans to use, and there are "system accounts" for software to use. On a Drupal site, I have a couple of system accounts intended for use by services....
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'] = ...
5
votes
4answers
3k views

Remove colons from Drupal form fields/labels

How can I remove the : from appearing after every label in forms made with the Drupal Form API?
145
votes
11answers
186k views

What are the recommended directory permissions?

I'm gearing up to deploy a Drupal 7 site and I can't find any documentation about what the recommended security-conscious file and directory permissions should be set to. Specifically default/files/ (...
18
votes
4answers
12k views

How do you make sortable tables with a pager with data from a custom table?

For Drupal 6 you could do something like this: $header = array( array('data' => t('Order id'), 'field' => 'order_id'), ... array('data' => t('Transaction time'), 'field' => '...
9
votes
5answers
750 views

How might I create a “step-by-step process” content type?

I'm thinking about creating a process manual for an intranet. Most (all?) of the processes have a very clear order, although the actual order may change from time to time. The plan is to have the ...
1
vote
1answer
410 views

Custom SQL: nodereference joins and latest VID

I'm having a heck of a time constructing a custom SQL query. The query has multiple nodereferences and needs to return the latest node revision. I understand joins pretty well, but for some reason ...
11
votes
4answers
6k views

Candidate page template filename for particular custom content type entry

I'm working on a Drupal 7 website. I created custom content type for works. I have many fields, and some of them are related to page layout like particular page bg for each entry. So I need custom ...
3
votes
2answers
801 views

How to automatically highlight syntax of code displayed on page?

I'm developing a website to publish my codes from different programing languages. I want to highlight syntax of codes with different colors. But, doing it manually is time consuming. Is there any ...
16
votes
7answers
7k views

How can a module detect when the “access denied” page is output?

How is it possible for a module to detect when Drupal is outputting the "access denied" page? I know how to do it with Drupal 6; I need to know how to do it with Drupal 7.
9
votes
1answer
2k views

Programmatically impersonating another user without causing the currently logged-in user to log out

How should a module change the value of the global $user, execute its own code, and restore the original value of $user without causing the current user to be logged out if an error happens?
2
votes
2answers
1k views

Where is the best place to insert additional logout functionality?

To insert additional logic when a user logs off one might look at function user_logout() in user.pages.inc. This code being in a core module, you should not edit it, but works very well... for ...
0
votes
1answer
309 views

Whats the best way to add an object to a form array? [closed]

What is the best way to add an object to a form array so that any form_alter hook can interrogate the form for the object and act accordingly. For example, I have an object I pass to my form which ...
2
votes
1answer
1k views

Gmap Views Module - Popups are too big

I'm using GMAP module and its views counterpart. The issue I'm having is that I'm using a custom text field to display fields wrapped in HTML that I have pulled in from the query. However, the popup ...
4
votes
1answer
909 views

Invoke Mollom CAPTCHA directly

I have a custom form within CTools form wizard that I would like to use Mollom on. Is there an API function I can use to place it in the Form API on that page?
3
votes
1answer
186 views

How to retroactively apply Mollom spam filtering?

I've been asked to clean up a site that's been running for a few years, and has accumulated some spam in addition to a lot of valid content. I've just installed Mollom on the site to help reduce ...
4
votes
2answers
2k views

Login shared between subdomains

If I should allow users to log in using the same username/password, what should I consider when choosing between the following solutions? Install, and use Bakery Single Sign-On System on the main ...
3
votes
5answers
802 views

How to make a Feature available only to certain Spaces?

For a Drupal 6 Open Atrium site (i.e., Features, Spaces, Organic Groups) I'm running, I've created some custom Features that only really apply to a handful of the hundreds of groups on the site. As ...
5
votes
3answers
2k views

Views Slideshow vs list View+jquery cycle lite?

The rotating images on my work site's home page are created as a View in list format. I'm using the jQuery Cycle Lite plugin for the rotator effect. The cycle.lite.js file is set in the scripts array ...
6
votes
2answers
440 views

Field API versus custom code

If I need to add custom fields only to user profiles, is it better to create a module that uses the field API, or a module that uses its own code to show the custom fields at a custom URL and to save ...
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 ...
3
votes
2answers
315 views

How to handle blog tags in a contrib theme?

In blog or blog-like sites, taxonomy is often used for tags and categories. In Drupal 6, node.tpl.php files could use the $taxonomy variable if they needed access to an array of unrendered taxonomy ...
5
votes
1answer
1k views

Bulk saving nodes with a file field

I'm in the progress of creating a bulk upload function for a Drupal site. Using flash I'm able to upload the files to a specific url that should be able to handle the files. What I want to do, is not ...
0
votes
2answers
121 views

How to generate a list of which Features are enabled in which Spaces?

I'm running a Drupal 6.x site with Organic Groups, Features, and Spaces, and I'm interested in generating a list of which Spaces have which Features enabled. Preferably a table, with Spaces along the ...
5
votes
2answers
330 views

How to perform an operation every time a node is viewed?

When writing a module, how can I perform an operation every time a node is viewed by a user?