The Brightonart Blog is the collected musings of the team. Expect quite a lot about Drupal development and a smattering of other topics that interest us.

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

Taxonomy NCO

Brightonart is currently involved in a series of new developments on the Drupal module Taxonomy NCO - AKA 'Matchy matchy', this module derives inferred semantic relationships from large folksonomies that tend otherwise to fragment and become unmanageable.

The module was originally developed in Drupal 5 as part of the School of Everything project. I am reposting this original blog post to preserve some technical background:

Russell Blakeborough

School of Everything

May 2009

Summary

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.

Taxonomy NCO AKA 'Matchy Matchy'

We've been working on an interesting new system over the past few years in the field of semantics.

It all started out with a big problem at the School of Everything. People were searching for music teachers and not finding people that had tagged their teaching profiles with piano. People looking for Martial Arts weren't finding teachers tagged with Tai Chi. The freetagging subjects vocabulary was getting out of control and the community was fragmenting as it expanded.