Fcgid settings on Apache

If you are using fcgi and mpm-worker mode with your apache. You will probably need to set some variables to make your drupal sites work. As they have some stupid defaults like 128kb upload limit (really 128 kb today?) and they override your php.ini settings as now PHP is running trough this FCGI, then you need to go to

Memcache and admin

If you are planing to do some optimization for your server, I would recommend to use memcache at least for your drupal admin pages. When installed it will cache some vital tables that will make faster your admin, even if you use boost and static pages for all your content and your visitors, install this module, it is rather easy this days to do it.

More here

Adding menu level value to CSS class

I need to theme a menu so that each level has different class in CSS. This needs to be done over template.php and additional code that adds menu level value to your links.

Here is the code you paste in template.php for drupal 7

Memcache setting for drupal 7

There is some slight change in default settings.php memcached setting for drupal 7, here is the setting you need to add to bottom of your file and you are ready to go.

$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
  $conf['cache_default_class'] = 'MemCacheDrupal';
  $conf['memcache_key_prefix'] = 'TD';

Apache, higher performance - MPM worker and Fcgid

After reading on many places that drupal should work better with MPM-worker and fcgid I decided to swith my debain to that configuration. For that I had to do the usuall, collect the info around the web and hope for the best. So here goes information about this on Debian Linux.

First we need to install worker and FastCGI

How many modules

Often you can see if drupal site is bloated with modules if you just check how many of them are enabled, you can do this quickly with mysql command.

select name from system 
where type = 'module' and status = 1 
order by name;

Views: display only original revisions/only latest versions

I used revisions and almost emidietly regreted. Revisions are just like other nodes. So if you use views to display them, then you will have by default both original nodes and their revisions displayed. What you could probably do is use content revision type of view, but you still get all the nodes there. I tried with some relationships but no luck.

Colorbox and video (you tube, vimeo....)

Adding colorobox to link is not so hard. You need to follow module instructions and it will work, just be careful to add EMBED code to URL, not just plain link. For example when adding You Tube video do this

Custom Token and languages for titles and labels

As views and even more panels are not perfect when it comes to translations if you need to have some fixed label with translation for some view/panel. You can create custom token for it and then just translate it over translation interface. Token creation is simple, just use this guide