mediatribe.net -- Websites, Web Development, Custom Solutions, Bilingual Sites, Drupal Specialist

BLOG

CREATE YOUR OWN WEBSITE ONLINE

Watch the video (4 min.)

Blogs,
videos, photo galleries, advanced content categorization, off-site
backups, form creation, e-commerce, domain names, multilingual
websites, copyright-free images. We have integrated the latest
open-source systems with several existing services into an easy-to-use,
easy-to-understand, affordable package.

You no longer need a team of geeks at your disposal for your website to shine.

[learn more]

Blogs

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!

Counting inodes (files, folders, symlinks)

Many hosts restrict the number of inodes you can use on a VPS or shared account.

If you have shell access, the following commands are useful to determine how many inodes you are using:

ls -R /path/to/directory | /usr/bin/wc

cd /path/to/directory
for i in $(ls);do echo -n "`pwd`/$i: ";find $i -print|wc -l 2>/dev/null;done

Setting up wysiwyg with image upload on Drupal

Warning: this will take you at least an hour and if you make even the slightest mistake, it won't work!

Please try this on a test site to make sure it suits your needs!

Related issues:

  • Doesn't work with themes with dark backgrounds: see http://drupal.org/node/732048
  • When you upload two files with the same name, you get an annoying "this file already exists" message (it works though).

Using diff and patch for directories, and managing patches during Drupal upgrades.

Background: I was recently making a Drupal site where I needed (as is often the case) a visual text editor along with image- and file-upload capabilities. I tried using the wysiwyg module in conjunction FCKEditor 2.6.x, which is a good combination for that purpose.

Since this does not work out of the box, I followed the instructions here.

Setting up Cron with Drupal 6 and cPanel

If you have a drupal site on a cPanel account, you can set up cron in cPanel. Here is how:

(1) Your site is, say, example.com
(2) Log into cPanel (example.com/cpanel)
(3) Go to cron jobs > standard
(4) Enter the following code in your cron:

/usr/bin/lynx -source http://example.com/cron.php

(replace example.com with your actual website)

Language Switcher Block: Not displaying the active language in Drupal 6

Most of our clients have bilingual (French and English) websites. The Language Switcher Block is a great way to switch between languages, but we often don't want to display the active language. For example, on a French-language page, we want to have a link to English (not French and English).

Our solution is to add the following css either to your theme, or, if you are using a contrib or core theme, to css injector. (Messing with a core or contrib theme will cause your changes to be lost during upgrades):

Portfolio

WHAT OUR CLIENTS ARE SAYING...

It's marvelous to be able to post content on the site and especially to be able to make many updates. It's all really a pleasure for me; I believe it's because the website is well thought-out... Thanks again for your advice. (Pascale Bironneau, atelierdecarole.com)

THAT's what I wanted... I did not even know... very happy and impressed up to now. WOW. (Élise Gravel, illustratrice. elisegravel.com)

After the tests, it is working and it's exactly the configuration that I wanted. (Marie-Louise, productionsqualia.com)

I even did more than you recommended. Soon I will become an important computer scientist. (Kouassi Bohui Melaire, reforestation.net)

You really are pros! (M.-H. Verville, monhebdo.ca)