Drupal tips

Installing Open Atrium

Stragegy

  • download no-core version
  • replace all modules in repo with symbolic links
  • create standard Drupal 7 site
  • link openatrium directory into profiles/openatrium
  • install site using openatrium install profile
dget install openatrium 7.x-2.19-no-core d7paths
grep memory_limit /etc/php.ini       #should be >= 256M
grep max_allowed_packet /etc/my.cnf  #should be >= 32M (add under [mysqld]}
  • Go through OA contrib modules and any we have already replace with the one in the repo
mod=/opt/dr7/contrib/modules
oa=$mod/openatrium

function repoa {
  rm -Rf $oa/modules

Drupal and Facebook

Installing RedHen CRM

1. Install modules on server

dget install redhen 7.x-1.7 d7paths
dget install message 7.x-1.9 d7paths
dget install relation 7.x-1.0-rc5 d7paths
dget install registration 7.x-1.3 d7paths
dget install redhen_membership 7.x-1.x-dev d7paths
dget install entityreference 7.x-1.1 d7paths
dget install addressfield 7.x-1.0-beta5 d7paths

  • assume entity, ctools already installed

2.

Drupal performance notes

Here are some useful links:

In case the problem is the underlying system performance:

RedHen vs CRM Core comparison for Drupal CRM

Here are some resources for comparing the two systems:

Add Zurb Foundation theme to Drupal 7 site

1.

Installing Compass on Drupal server

The Select builder adds a LOT of overhead. You should not use it unless you need one of the things it offers: Dynamic query structure, hook_query_alter, certain db-unportable features that don’t have a simpler version (random ordering, for instance), etc.
For the run of the mill SQL query, db_query() is several times faster than db_select(). If you need a limit query, db_query_range() is still there.

updating webform from 2.x to 3.x

Some notes on configuring the module

  • Follow the online instructions, but also
    • set the support content type not to be on the front page
    • set the from email address to be do-not-reply@mydomain
    • Default sort: State/ascending
    • Secondary sort: Last update/descending
    • Modify the new and updated ticket email to be something like this:

Drupal Video Players

  • You can easily delete all comments with:
DELETE FROM comments;
  • The problem comes when there are good and bad comments, and you only want to get the bad comments. -The cleanest way is to delete all the rogue users first. That will set the UID on their comments to 0, so you can delete all their comments by running:
DELETE FROM comments WHERE uid=0;

Theming CCK fields in Drupal 7

Drupal node display can be overridden using a template file of the form:

  • node--content_name.tpl.php

The simplest way of displaying fields is to use the render() function

The render array is documented here: drupal.org/node/930760

  • Individual field values can be found in one of:
    • render($content['field_name'] fully rendered value
    • $content['field_name']['#items']['0']['safe_value'] will include paragraph markup
    • $content['field_name']['#items']['0']['value'] raw
    • $content['field_na
Syndicate content