All Questions

2
votes
2answers
728 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 ...
20
votes
5answers
10k views

Why would some features still show Overridden after a revert all --force?

Why would some features still show as "Overridden" even after running a full features revert with the force switch? Below are the commands I am running, for the sake of clarity. drush fr-all --force -...
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 ...
5
votes
2answers
1k views

How can I make a module's configuration exportable by features?

At a high level, what needs to be undertaken to take a module's configuration data and make it exportable by Features? Whether this is a contrib module that does not yet have Features support or a ...
13
votes
2answers
5k 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 ...
11
votes
3answers
8k views

How do I convert a Wordpress theme?

I googled, but I didn't find any automated solution. So, I've started it manually. Mapping CSS files is easy, but I'm looking for a way to map blocks/templates. Please, help.
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....
4
votes
3answers
848 views

How do I go about putting standalone PHP files into Drupal 6?

I want to add an extra cool PHP Class, where would I put it in Drupal, how do I make absolutely sure the code doesn't present a security risk, should I just make it into a module?
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?
6
votes
2answers
4k views

When should the “container” form element be used?

The System module defines the container form element, but that form element is not documented in the Form API Reference. When should that form element be used? What is its purpose?
142
votes
11answers
181k 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 are the recommended security-conscious file and directory permissions should be set. Specifically default/files/ ...
6
votes
2answers
1k views

Programmatically insert webform result

I'm using drupal 6 with the webform module installed. I need to be able to remotely POST, from PHP results to a webform. Pseudocode: <?php //File: ...
7
votes
2answers
3k views

Making drupal_goto Ignore ?destination=foo

I frequently come across cases in my Drupal 6 sites where a user might encounter my module's pages with the ?destination=foo querystring appended to the URL, from previous interactions on the site. ...
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
747 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
408 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 ...
3
votes
2answers
262 views

Core forum form dropdown empty

In a D6 site, when a user goes to node/add/forum, they find that the dropdown "Forums" just shows "Please choose" but there is nothing in that menu. There is nothing in the PHP error log or in the ...
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 ...
6
votes
3answers
785 views

Would cache in files be an alternative?

Once I worked in a company that had its own CMS and we used to cache data in files so basically the system would check if the cache file existed, if not it would go to the database, get the data, save ...
3
votes
2answers
797 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.
52
votes
13answers
20k views

How do I hide nodes that shouldn't be directly accessed from users and search engines?

I've found that there are times I have a node that simply contains content that will be displayed somewhere else, but shouldn't be viewed directly. That is, no one should ever go to node/1234, but the ...
11
votes
2answers
465 views

What is the best way to keep your site code in git and pull in core and contrib in the same repository?

Back when drupal was in CVS I had my sites in a git repository and then pulled in core and contrib via CVS. The two systems happily co-existed and I could track changes to everything and make patches ...
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?
49
votes
7answers
56k views

How to a use a template file to theme a form?

While nodes, comments, blocks and many other things in Drupal are themed using theme template files (like node.tpl.php), forms are a different story. There are no theme template files for forms. How ...
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 ...
2
votes
1answer
303 views

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

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 ...
11
votes
1answer
437 views

Multiple (and differents) crons?

In a normal production webiste, there are many tasks that need to be done via crontab, but lets say you dont want all of these tasks to run on every cron. For example, i would love to have: A cron ...
1
vote
1answer
845 views

Is hook_translated_menu_link_alter() thought to be used only on translated menu links?

Could hook_translated_menu_link_alter() be implemented to simply alter a menu link before it is rendered? Clearly, hook_translated_menu_link() is only invoked for menu items that have been flagged ...
8
votes
6answers
2k views

Will Drupal 6 be left in a secure state after it becomes unsupported?

I created a custom database interface using Drupal 6 + Views + CCK that works really well for my company and recently I had to migrate it to another server. I thought "Hey, why not install Drupal 7 ...
2
votes
1answer
569 views

What is the difference between user_is_anonymous() and user_is_logged_in()?

What is the difference between the two functions? When should one be used instead of the other?
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 ...
6
votes
4answers
794 views

Can anyone recommend a good Drupal module for managing/displaying videos

I would like to put together a video gallery on my website and am wondering if there are any existing Drupal modules to manage that. I'm using Drupal 6 and most likely the videos will be hosted on ...
4
votes
1answer
908 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
185 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 ...
7
votes
4answers
3k views

How to remove the default “Anonymous” from comment author name?

In the comment form field (core comment module) I would to leave the comment author name empty, in order to encourage commentators to come up with original epithets. What's the easiest way to do it?
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
439 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 ...
6
votes
4answers
2k views

How can I expose Drupal data to external applications?

How can I expose data from my Drupal site via web services to external applications such as iPhone or Android?
72
votes
8answers
9k views

How can I obscure what I am using to run my site?

Is there anything I can do to prevent somebody from knowing my site is using Drupal by looking at the source code of the front page? I am referring to people who scan sites using software that detects ...
15
votes
2answers
10k views

Site stuck in maintenance mode

I have put a site in maintenance mode. Before I could visit the administration pages as user #1 (which was the user account I was already using before to put the site in maintenance mode), I had to ...
3
votes
1answer
849 views

What argument to use in Views that excludes the node currently being displayed?

For instance: if you have a view that produces a list of titles of nodes of content type X, how can you make that list exclude the node that is currently displayed to a site visitor?
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 ...
1
vote
1answer
170 views

Integration with the RDF module

I have a module that creates HTML output. Does it need to support the Drupal 7 RDF module? What are the functions made available from the RDF module that allows a module to integrate with it? What ...

15 30 50 per page