drupal

Check for role in node-type.tpl.php

Is there any way to check the role of the viewer within a drupal theme file, so as to write a conditional statement? Thanks... ...

Javscript for() loop in Drupal not working?

Hello, I've just spent a long time trying to figure out why my Javascript for() loop won't work in a Drupal block, I feel like I've checked out the syntax - any idea why this isn't working?! $(document).ready(function() { var i=0; while (i<=5) { alert(i); i++; } }); That doesn't do anything - and also if I put something like thi...

Content Taxonomy along with Conditional Fields

I'm still young at Drupal.So please correct me wherever needed. I have a requirement wherein I want my content type to have my own fields (achieved with CCK), then I want one of the fields to be a selectable drop down and each drop down value should actually categorize them so that each type can come on separate page. This I managed wit...

drupal, rules, flag, date

Hi, Hope someone can advise. I am using drupal 6. I have a node called [classroom]. I would like to have a [vacancy register] associated with each classroom. vacancy register is a cck type with: - uid - nid - join date I would like for each user to [register] for a vacancy. I think I can use flag for this. When a user joins, I ca...

Improving Drupal development with Extreme Programming practices

Has anyone applied XP principles in Drupal development? E.g. I wonder about such things as unit testing and whether it may be used in Drupal development, or about continous integration. I am not sure about unit testing, because Drupal environment is a very specific thing and not enough object oriented to have mock objects. As I see it,...

Time field in Drupal forms?

In creating a drupal form, one can easily create a date field. '#type' => 'date', But what about a time field? Is there an easy way to create and use a drupal form field type that describes the time of day? (Something more elegant than just a textfield with the label "time"?) ...

Ungroup user menu in Drupal

I am using Drupal 6.x with Zen theme. Currently, the following 3 user functions are grouped under a menu, when accessing urls like http://domain.com/user Create new account / Log in / Request new password How can I un-group them so that each of them can still be accessed via its original url; while removing/ supressing the men...

Ubercart 2.0 - list of code changes to allow for Fractional Quantities?

I am working on an Ubercart 2.0 project for a client. It is for a fabric store. They want the ability for customers to add fractional quantities (or decimal quantity) like 1.75 m. Does anyone have a comprehensive list of code changes that will allow for this functionality? ...

DRUPAL: Fatal error: Allowed memory size error when editing specific existing pages.

Fatal error: Allowed memory size of 18874368 bytes exhausted (tried to allocate 1481725 bytes) in __/public_html/includes/database.inc on line 224 I'm having this error occur in Drupal 6 every time I try to edit the following pages (sorry about the xx's): hxxp://chipkin.com/fs-8700-125-stulz hxxp://chipkin.com/fs-8700-47-dnp-3...

Change size of user/password login box

I don't know how to change the size of the login username/password boxes on the drupal site that I'm trying to build. I'm stumbling through the theming, and don't know where to find the file that needs to be changed in order to have boxes that fits the aesthetic (so a file path would be very helpful). I'm hoping it's a css solution. Y...

drupal actions triggers rules

Hi, I'm looking at the code in the signup module. It seems that there are triggers and actions in place already for certain events. If I was to add rules events, would that confuse the situation? Or is it possible to use the triggers to call rules actions? I would like to add rules events and rules schedule to it. Thanks Ed ...

PHP Parse Error; Drupal6 Deployment

I had a Drupal installation at www.example.com/test. Now, it's ready to go live, and I am trying to move it to www.example.com. I changed the line in sites/default/settings.php to: $base_url = 'http://www.example.com/'; // NO trailing slash! When I navigate to my index.php, I get all sorts of parse errors, like this: Parse error: sy...

Theming for/with javascript?

A colleague made a small module to retrieve twitter search results based on user configurable search terms and display them in a block. He is doing the searching with javascript to keep that traffic on the client side, something like: $.getJSON('http://search.twitter.com' etc.. Then when the json results are returned inserting them int...

Drupal section accessible by role.

I need to limit access of content on Drupal site based on the Drupal User's Role. http://site.com/managers/intro http://site.com/managers/reviews http://site.com/managers/up-for-raises The content can be of multiple content types and isn't limited to one specific content-type. These content types will be used elsewhere on the site s...

Drupal shared tables, but from another database

I have a Drupal Multisite set up with hundreds of sites. I want to make some tables shared (like banners, and roles) so I don't have to update hundreds of sites when changing a banner (for example). I know this can be done using these strings in settings.php: $db_url = 'mysql://user:pwd@localhost/example_db'; $db_prefix = array( ...

Drupal Custom Form Arrangement/Placement

I am just starting out with Drupal but I am pretty clueless how to custom 'place' all of the form elements. I usually have a lot of stuff, like this other dude's thing, so placement and aesthetics are a MUST: Drupal's default way of rendering forums like a questionnaire (one long horizontal column with lots of spaces) are unacceptable...

Setting up a WYSIWYG editor for Drupal site users

Looking through the Drupal contrib modules, and after a few Google searches, it becomes evident that there are any number of choices and combos available to set up a WYSIWYG editor in Drupal. I'm hoping that I can do this as simply and quickly and painlessly as possible, and not have to keep trying out different combos till one actually...

Drupal Multi-language: Simple strings not translated

I'm adding additional languages to a Drupal site that I'm building. Getting the translation of content working is fairly easy using the Internationalisation module. Yet, simple things such as date strings, i.e. day, month and year aren't translated. I would expect simple things like this to be some of the first things to be translate...

Issues with a drupal form submission with a checkbox whose value is 0

I am writing a drupal module that involves a form with many checkboxes. E.g. $form['myform_checkboxes'] = array('#type' => 'checkboxes', ...) I have made the key for these checkboxes numeric, starting with 0. E.g. $form['myform_checkboxes']['#options'][0] = '0:00'; $form['myform_checkboxes']['#options'][1] = '1:00'; Upon implementi...

Drupal page optimization question... which is better?

In terms of: Speed Required processing (which will influence speed) Following standards Which of the following two methods will be better? I want to create a general page layout, however, the frontpage will look different from the normal look and feel. Method 1 Creating a normal page.tpl.php file but with the following code in it:...