Living in Malta, this is the blog and journal of Simon Facciol.

Here we discover new technologies and try to discover solutions to common problems.

Drupal 7 – Enable a theme from a custom module via code

Drupal 7 – Enable a theme from a custom module via code

Sometimes you are required to enable a theme programmatically from a module without needing to do it manually all the time, so to do this I have used the hook_init() function to get a list of all the themes in Drupal which contains all the themes info.

Then I am using the name of the theme (the one in the .info file) and after checking if the status is disabled I call themeenable function and pass an array with the theme name I want to enable. The themeenable function accepts an array of theme names, so you are able to enable multiple themes at once.

Setting environment variables in Magento using .htaccess or httpd.conf

Setting environment variables in Magento using .htaccess or httpd.conf

How to stop a youtube iframe video after closing a popup

How to stop a youtube iframe video after closing a popup