marcus's blog

Remove the name and email cookies from the Drupal 7 core contact form

in

The contact module in Drupal 7 core uses a pair of cookies to pre-fill name and email in the form for returning users. Since the change in legislation around user details in cookies a lot of site owners will not want these cookies to be set.

Since editing core is a cardinal sin a good way to prevent the server setting these cookies is to add a submit hook for the contact form in a form alter in your own module.

/**
  * Implements hook_form_FORM_ID_alter().
  */
 function module_name_form_contact_site_form_alter(&$form, &$form_state, $form_id) {

Education research and health research

Brightonart has built websites for two new research companies that work with public and private organisations providing quantative and qualatative research services.

In the field of healthcare research KNV Research knvresearch.com

In the field of education research edyou.co.uk

DOM ID encode PHP function

I needed to encode strings in a reversible way to be valid as XHTML IDs (letters, numbers, '-' and '_', must start with a letter). The following encode and decode functions do just that. If you are not using Drupal just replace drupal_substr() with your favourite multi-byte safe substr() function.


/**
 * Encode a string for use as a DOM id.
 * 
 * Replaces non-alphanumeric characters with an underscore and the hex representation of the character code
 * with letters in lowercase

Coq au Vin recipe

My manager at Red Bee Lefty asked me for this recipe before I leave the company this evening so I thought I would post it for others to enjoy!

Coq au Vin

Makes enough for 8

Ingredients:
Handful of Peeled shallots
Handful of Carrots 2cm chunks
Handful of Celery 2cm chunks
Button chestnut mushrooms ( or quartered bigger ones)
Handful of Baby plum tomatoes or cherry tomatoes
2 Handfuls of Baby new potatoes (or 3cm cubes of bigger ones)
2 small organic chickens chopped into pieces. I do two wings, 2 legs,

Override node reference select list options in node edit form

The requirement is to change the list of options for a node reference cck field to limit the select according to the user. Creating a hook_form_alter in a custom module and do dpm($form) there is no '#options' element in the field. This is because nodereference module adds it's stuff later in the form build process. However there is a way - like so often in Drupal it takes a few web searches to find - and that is '#afterbuild'.

In the hook_form_alter
$form['#afterbuild'][] = 'my_module_custom_function';

Netsounds A/V Workshop

in

Gridio Interactive Audio Visual InstallationBrightonart presents the Netsounds audiovisual production workshop. This event is in association with Same Sky and occurs in the frame of “THE GREAT ESCAPE” Festival - Brighton UK.
More information about the workshop on the Netsounds website

Drupal Association Member

in

Drupal Association At Brightonart we have employed open source software in our projects since 1998. The benefits of open source are well documented and Drupal is a perfect demonstration of the power of a dedicated community to develop software which compares favourably with and surpasses proprietary closed source options. During the development process, when we identify required functionality which is general enough to be useful to the community, we release modules on Drupal.org

Soap Server for Services 3, Drupal 6

Drupal has been making waves in enterprise circles as the collective work of the community allows developers to prototype web applications very rapidly and move them into implementation with few extra steps.

At Brightonart we are being asked by our clients to make Drupal's library of UI tools available to other applications by connecting through web services such as REST and SOAP.

i18n_sync and i18n_helper

in

Our application has translated nodes with certain common fields synchronised using i18n_sync but we want the translation source node (in our case in English) to control these values and for them not to be editable in translated nodes. A real world example of this problem would be a product content type with stock code common to all translations.

Syndicate content