mediatribe.net -- Drupal et développement web

Drupal

Adding content (text and images) to a Drupal site via email

In my experience, there are several users who don't feel comfortable using the standard Drupal interface to create content on their website. I've noticed that this is the case with reforestation.net, I site I manage: even though I provide users with accounts and training, almost all users end up sending me their content (including images and text) via email, and I have to upload it myself to the Drupal site. The main reasons cited for not posting content to Drupal are: it's too complicated, connection too slow (especially in Africa and the Caribbean); and it does not work as expected.

Creating actions for use with views bulk operations

You can combine Views bulk operations with your own code to make powerful actions which can be applied to several nodes at the time.

Here is some sample code to create an action:


/* describe your action(s) */
function mymodule_action_info() {
return array(
'mymodule_action_callback' => array(
'type' => 'node',
'description' => t('My action description.'),
'configurable' => FALSE,
)
);
}

function mymodule_action_callback(&$node, $context) {

Displaying a block with a field from the current node using Views 2 and Drupal 6

I have a CCK field with an image on my page nodes. I want to display a block with the CCK field value on its related node, but nothing on non-pages.

This often works in the views preview, but not on the actual page. This was driving me nuts and I spent a few hours finding this solution:

Create view with

  • Filter: node nid > 0
  • Argument: node nid, Action to take if argument is not present: Provide default argument: node nid from URL; validator: basic. Action to take if does not validate: Hide view
  • Create a new block display and you're done!

Setting up wysiwyg with image upload on Drupal

Update May 3, 2010 -- Please see the first comment, below. Some of the hacks in this article are outdated. Please proceed carefully and report your results here!

Bloc de sélecteur de langue dans Drupal: Ne pas afficher la langue active

La plupart de nos clients ont un site bilingue (français et anglais). Le bloc "sélecteur de langue" (Language Switcher) est une bonne façon de passer d'une langue à l'autre, mais souvent nous ne voulons pas afficher la langue courante. Par exemple, sur une page en français, nous voulons un lien vers le contenu en anglais, mais pas de lien "français".