Empower developers with tools that assist with developing and debugging the frontend or backend of the site.

Nodereference autocomplete nid trim

The Nodereference autocomplete nid trim module is a simple module that uses JavaScript to remove the [nid:X] text when you select an item in a Node Reference field.

For example, if you have My Node Title [nid:384] in the input, jquery_autocomplete changes it to just My Node Title.

Field Values

Provides field_get_value(), field_get_values(), and field_set_values() functions for developer and themer use.

Developers and themers expect to constantly type some form of $entity->field_data['und'][0]['value']; throughout site customization modules and themes. It gets tedious, the code can be difficult to read, and you find yourself staring at the output of devel's dsm() far too much.

Install this and you can use field_get_value($entity, 'data'); Note the missing 'field_' name prefix, it is automatically added as needed. Multi-value fields are converted to/from standard arrays, which can save a lot of array processing code. field_set_values() accepts values or arrays, so field_set_value() would be redundant. Note: Fields with multiple columns should be accessed with field_get_items().

<?php
//This "get value" code:
print $entity->field_data['und'][0]['value'];
//Becomes:
print field_get_value($entity, 'data');
//This "get values" code:
foreach ($entity->field_data['und'] as $value) {
print $value['value'];
}
//Or this "get values using field_get_items" code:
$items = field_get_items('node', $entity, 'field_data');
foreach ($items as $value) {
print $value['value'];
}
//Becomes:
$values = field_get_values($entity, 'data');
foreach ($values as $value) {
print $value;
}

Context Accordion

context_accordion.png

Context is a great module that aims to replace Drupals quite lacking block management system among other things.

Suggest a Friend

A feature is similar to "Suggest a friend" feature found on Facebook.

Step 1: User clicks on ‘my friends’ link to display a page.

Pages

Subscribe with RSS Subscribe to RSS - Developer tools