Drupal

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) {

ITV Player

in

Brightonart provided Drupal consultancy services to ITV from July 2011 to October 2013 for the development and maintenance of the ITV Player website for laptop and desktop computers which launched in December 2012.

Marcus Clements led the Drupal development team during the second half of the project, and was responsible for performance improvements, agile process implementation and enhancement with BDD, mentoring the team into a test oriented mindset and presenting progress to stakeholders and colleagues.

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

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';

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.

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