drupal-module

drupal questions - how to print a form from another module?

I'm trying to include a module form in a panel and I've tried using drupal_get_form(), but not sure I'm using it correctly. In the organic groups module, there's a function to render an og_broadcast_form. It's called within a page_callback in og.module: // Broadcast tab on group node. $items['node/%node/broadcast'] = array( ...

retrieve cck field for form_alter

I would like to retrieve a cck field "field_info" in my form alter to insert into another table when user is submitting. This doesn't seem to work. //mymodule_form_alter() implemented function mymodule_form_mysubmit{ $test = $form['field_info']['#value']; //insert stuff code } Is there any mistake in th...

Static Main Page (login page) on Drupal Install

Hi All, I am starting to create a site that uses Drupal. One of my requirements is that nobody will see any "real" content until they log in. The home page will basically be a static page with a logo, some basic "this is what the site does" copy, and then a login form. If you don't login, you can then only see some other static pages...

Hook called before to delete a node

I'm writing a custom module, and I would like to do some checks before the node is deleted. Is there a hook that gets trigerred before a node is deleted? And is there a way to somehow prevent the deletion? BTW, I'm using drupal6 ...

Search forms linking to actual search page

I have created a search page uising exposed filters and views module. The user can choose from different values in order to get a table with specific results (returning node fields). This page is located under mysite.com/search. The problem is that I would like to put a simplified version of the search form on my homepage (lets say just ...

Drupal excessive menu parts

In a module development (webtv) I am providing a generic block that can be configured for its contents (playlists). On the configure form there is a list of added contents (playlists) along with links "add new playlist" and "edit" existing one placed next to each entry. As the block configuration path is: "admin/build/block/configure/[my...

How to edit email templates without the mail editor plugin?

I've installed the mail editor module for drupal in order to edit the templates for emails that my site sends out and I get this message after enabling the module: "This version is incompatible with the 6.16 version of Drupal core." How do I work around that? Do I just keep trying older versions of the plugin or is there another plugin I...

image gallery slideshow module in drupal not showing pager images

hi guys, i'm building an web app in drupal and i'm stuck at image gallery, the module i'm using for it is "views slideshow ddblock" Module. This module is working fine i.e showing images in slider section but the pager thumb images are not displaying, only a faded box is show in that pager area. i hv searched on drupal forum a lot but no...

How to get and set the delta value?

How can I affect the delta parameter value? Where it can be set? I'm beginner with Drupal but know my way around PHP and other CMS apps e.g. Joomla. I've working on my first drupal module and need to create a module with multiple blocks. I know how to switch based on the $op parameter but the $delta value seems always to be the default ...

Output Truncated by browser Error while Extracting cTools Module

Output Truncated by browser Error while Extracting Drupal cTools Module, the result is that the version is not updated. The consequence is not able to update panels version (need to be in sync w/ ctools version). This happens to CCK module as well. Please help. Many thanks ...

How to hide Date of birth field in overriden form?

In my hook form alter, this is the date of birth array: [Birthdate] => Array( [#type] => fieldset [#title] => Birthdate [#weight] => 1 [profile_birthdate] => Array( [#type] => date [#title] => Birthdate [#default_value] => [#description] => The content of this field is kept private and will not be shown publicly....

How to have a customized user profile for certain users?

We need a customized user profile page for users that signed up this month (some marketing promo). What would be the simplest way of doing this? Again its only for users that signed up this month. Please provide detailed instructions if possible. Thank you ...

What is the proper location to place jQuery and or jQuery plugin in a Drupal installation?

I just want it to be at a standard place. Thank You ...

Why is WYSIWYG editor removing PHP code?

I use input format as "PHP Code"...enter PHP code and it looks fine. Next time I go edit it, it removes it all. This is very frustrating. ...

Change the product image when visitor makes an attribute selection in Ubercart

Current Setup Each product on the store has multiple images. When the visitor visits a product page they see a main image and a series of thumbnails (view). When they click on a thumbnail that image is instantly displayed in the main image area. Each product also has an attribute selection dropdown for example "Colour". Drupal / Uber...

What to put in "type" when adding new content to node via $node->content

I'm adding new content to a node, but I'm stuck on what to put in #type. I know that when you're dealing with a profile page for example, you would put '#type' => 'user_profile_item' but what to put for new content on a node? $node->content['newc'] = array( '#type' => , //what to put here for type '#title' =>...

How to assign custom role automatically on registration?

I am using a hook form alter to override the registration process. I want to assign a custom role that i have defined to the new user. How do i get about doing that? I see that there is a users_roles table. Would simply making an entry in it with the user id and role id do the trick? Thanks ...

How to display a custom profile based on a specific role?

For example I have a role called "teachers". For any user that belongs to that role, I want to be able to display a custom profile that is different then the main one. I read at some place that one can make a tpl file in the pages folder of the theme and some how it could be made to show for specific roles or URL path. Would anyone care...

How to get rid of 0-width empty button in Drupal

I am using fivestar rating module with Drupal Acquia Slate theme. This rating system works with both javascript enabled and disabled. In first case you click on the star and the voting is done, in second case there is a button with 'Rate' label and a dropdown list. The problem is that with js enabled there is a 0-width empty button that ...

Any alternate of drupal_json for non-JSON output

In an AJAX call back in drupal it is normally recommended to use drupal_json() to send data to client. This function converts the raw data into JSON along with HTML encoding. I want to send the HTML data without encoding to client. for this I am using following code: print $html_output; exit(0); Is there any recommended or best way i...