Code development

Latest techniques in site development; simpletests, coding practices, scalability, deployment and so on.
no_longer_active_13's picture

Setting Clean URL's with SSL (https) for the backend and http for the front end when Drupal is in a subdirectory/ subdomain?

After reading various documentation on the subject I figured out how to possibly do this. I started a write up in the documentation, and placed it under technical review. Are there people with knowledge on the subject who want to take a look at it? This to ensure that there are no mistakes.

The url is:

Read more
sydneyDK's picture

Dynamic Redirects

I'm working on a module that needs to create dynamic redirects. For starters, I've installed the Redirect module, which allows me to create static redirects via the admin panel (and API for further development). I'm finding that although it does redirect to external sites, it only redirects within the current window and I'd like the redirect to occur in a new window. I'm thinking this may require some javascript script as well, but maybe I'm missing something or another module is better suited to my needs.

Seeking thoughts and advice from the group.......

Read more
wipeout_dude's picture

When to use hook_menu vs hook_menu_alter??


Can someone tell me when its correct to use hook_menu vs hook_menu_alter??

Quite simply I am wanting to create a local action on a view to add content.. In the past I have used Page Manager to do this but looking at the code it doesn't seem logical to load a whole module when this is all I want to do.. I am just not sure on the correct way to do it..

Any help appreciated..


Read more
wipeout_dude's picture

How do I create a static block in code?


Hopefully someone can help me out here.. Firstly I am not a coder but I have a problem that needs code to be resolved..

I am creating a feature using "features" and I need to create a static block where the content is a simple HTML table.. Features doesn't export blocks so my plan is to add it in code to the .module file of the exported feature..

I haven't been able to find any code examples for a simple block to start from so if anyone can give me a pointer and perhaps a sample that would be great!!


EDIT: I am using Drupal 7 if that makes any difference..

Read more
cithukyaw's picture

Drupal hook menu and node form

I have a content type 'leg'and this hook_menu :

$items['leg'] = array(
'title' => t('Choose Leg'),
'page callback' => 'drupal_get_form',
'access arguments' => array('create leg content'),
'page arguments' => array('mymodule_leg_select_form'),
'weight' => 0,

$items['leg/select'] = array(
'title' => t('Choose an existing leg'),
'page callback' => 'drupal_get_form',
'access arguments'

=> array('create leg content'),
'page arguments' => array('mymodule_leg_select_form'),

Read more
justluvgod's picture

filtering pdf file attachments

I have a Drupal 7 question that I can't seem to find a clear solution. I have a lot of pdf files that I want to add to our website. I want to be able to query/filter the pdf files based on year and department. I would want something like a drop down menu or radio buttons to accomplish this so the user can select to sort by year and/or department. I can't figure out how to add any taxonomy or association to the file to do so.

Do you know if this can be done or not? If you know of any books or tutorials that will help me, I would greatly appreciate any assistance.

Read more
cithukyaw's picture

User Role Selection and Profile Fields

Hi Drupalers,

I have two user roles with profile fields.

Role 1
Name, Username, Password, Email, Address line 1, Address line 2, Website.

Role 2
Name, Username, Password, Email

I want to let anonymous user to chose user role on registration.
Upon user role selection, I want to show role-related fields interactively (with javascript).
I mean that when select Role 2, Address line 1, Address line 2 and Website fields will be disappeared, and when select Role 1, they will be appeared again.

I currently use 'user_role_field' module and 'autoassignrole' module.

Read more
Nothing4ever's picture

Widget setting for module Node Reference

I have a question:

In Story content type, create a CCK Node Reference as "author". Config Autocomplete for the matching is "Starts with".
In Page content type, add Existing field "author" and then config Autocomplete matching the is "Constrain".

But when I creating node in the Page, the "author" field is "Starts with" not "Constrain".
If I change the type of story is "Constrain" and Page as "Starts with", when add node in the Page is "Constrain".

I keep settings are different for each Content type when create node
(In widget settings work fine)
Please help me.

Read more
Spark_man's picture

Webform. Specifically, formatting the webform-mail-xx.tpl.php

I am using Webform to build an simple order form and with the help found @ and I was able to get he form data entry stuff accomplished and looking presentable. However, to really refine the product (i.e. create a decent looking receipt), I need to be able to format the submitted data in email so that is looks at least a little like what the online version of the form looks like.

Read more
WebmistressM's picture

Drupal 6 and OSM: Loading Prompt but Doesnt Load or Play

Im running Drupal 6 on my local/home server while I test things and set new items up. I decided to create a playlist for playing albums in OSM player. I used the following tutorial and it seems just about everything worked as noted in the tutorial:

Read more
Subscribe with RSS Syndicate content

Drupal Dojo

Group organizers

Group events

Add to calendar

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week