Blog

Posted by: 
Dominique De Cooman

In drupal 7 the recommended method to render output is by using the render api. So no more calling theme(...) directly. Here is a simple example based on the example from the examples module.

<?php

function render_something() {
  
$render_array = array(
    
'child' => array(
      
t('This is some text that should be put together'),
      
t('This is some more text that we need'),
    ),
?>

Posted by: 
Dominique De Cooman

When you query your entities on values on a field, for example you want to get all nodes via a node reference field. In our case we have an event and we want to know all referenced sessions to it.

Posted by: 
Dominique De Cooman

If you want to render only one field of your entities you can in drupal 7. Here in the example we have an entity called model which contains an image field.

To render the field you have to specify to the field_attach_view function which entity type, the entity and the view mode you want to use. The function returns a renderable array.

Posted by: 
Dominique De Cooman

If you want to save only a specific field on your entity instead of saving the whole entity you can. In a submodule of the fields module you ll find a module called field_sql_storage module. In that module all functions available for the sql storage backend can be used. One of them is field_sql_storage_field_storage_write, which you give your entity, type, operator (update, insert) and which fields to save.

Posted by: 
Dominique De Cooman

This small drupal 7 tip will help you get out values from entity objects, like nodes, users, taxonomy, ...

You probably seen this data structure when loading nodes:

<?php
$entity 
->fieldname[language][delta] = [item];
?>

Posted by: 
Dominique De Cooman

This post will explain how to automate installing drupal on a development environment using a stack installer script.

We used the script to speed up a drupal training. With the script and the install profile we could set up a development workstation very fast. Leaving us more time to look at the important stuff.

Posted by: 
Dominique De Cooman

This post will summarize the experience of introducing drupal into an enterprise. How we achieved a level of quality in drupal development needed for an enterprise application.

It will cover:

  • Setup : The drupal 6 site and the integration with the other apps in the enterprise.
  • Level of quality
Posted by: 
Dominique De Cooman

After some long reading in several issues on drupal.org. Here is the solution:

Install http://drupal.org/project/jquery_update (install the 6.x-2.0-alpha1)
Patch it with this patch http://drupal.org/node/685060#comment-3560788

Now you need a core patch otherwise some the views ajax and some other jquery will stop working. The core patch is here:

Posted by: 
Dominique De Cooman

As discussed in previous blog post, drush cron can be run from crontab too. While seeming pretty straightforward, trying it out caused some troubles.

The thing you would do to make drush run from crontab is:

$ crontab -e
* * * * * drush -r /path/to/drupal

Also tried to give full path to drush install

$ crontab -e

Posted by: 
Dominique De Cooman

Running cron from cli in drupal will result in.

PHP Warning:  include_once(): Failed opening './includes/bootstrap.inc'

Running cron from cli is useful when your behind external authentication and crontab is not available over http. Because normaly you would put something like:

0 * * * * wget --spider <a href="http://yoursite/cron.php
">http://yoursite/cron.php [/geshifilter-codes]

Pages

Subscribe to Blog