Articles

Articles

How to turn off all contrib modules

Posted by Michelle on Thu, 04/17/2008 - 13:57 in

If your site is totally crashed and you suspect it's a contrib module but don't know which, here's a quick way to turn them all off in the database:

UPDATE `system` SET status=0 WHERE filename LIKE '%sites%'

This simply disables them; it doesn't uninstall them. It also assumes you are putting your contrib under sites\all or sites\sitename.

Michelle

Converting from nodeprofile to bio

Posted by Michelle on Tue, 04/01/2008 - 21:47 in

I decided to convert CRO from nodeprofile to bio. Nodeprofile is nice for really complex profiles with multiple nodes but I didn't need anything that fancy. More important to me was the ability to put individual fields on the registration page.

Managing your views in code

Posted by Michelle on Tue, 03/25/2008 - 14:26 in

Note: This is for Drupal 5.x and views 1.6. You can find a tutorial for Views 2 here.

Panels 2 comes with a nifty exporter that will dump all your panels related stuff (pages, views panes, mini panels, etc) into one export file set up to work as a module. It's a really useful feature for moving them from site to site or simply keeping them in code for outside the database backups.

Views 1, being a much older module, doesn't have quite as nice of an exporter. It does allow you to export your views one at a time but using that export in a module takes a bit more work. This article will show you one way of doing it. There are other ways, such as putting all the views in one file, but I find this method easier to maintain.

hook_theme_registry_alter for advanced template control

Posted by Michelle on Sun, 02/17/2008 - 15:00 in

I'm in the process of porting Advanced Forum to Drupal 6.x and am trying to take advantage of the new theme system. One of the things I wanted to do was get rid of the requirement to copy the forum theme to the site theme directory. My goal was to make it so the whole thing could be run right out of the module directory but allow any template copied to the user's theme to override what's in the module. merlinofchaos helped me quite a bit and told me about hook_theme_registry_alter(), which isn't documented much yet. I decided to write up what I learned today in this article. Keep in mind that this is written by someone who has only really dug into the new theme system in the last few days, but merlinofchaos gave it a look over and he thought it looked ok. If you have comments on the article, I'd like to hear from you, but please no support questions. I barely understand this myself. ;)

---

The theme system in D6 does an excellent job of handling template files which will work well for most people. If you need very specific control over the theme registry, however, there is hook_theme_registry_alter(). This hook lets you get in and modify the registry directly. It has a paramater, $theme_registry, which holds the whole registry. To see what's in it, you can use something like this:

<?php
MODULENAME_theme_registry_alter
($theme_registry) {
 
// Assuming you have the devel module installed
 
dsm($theme_registry);
}
?>

This will give you a nicely formatted listing of the entire array to check out. By modifying this array, you can affect how template files are handled.

Directory browse page

Posted by Michelle on Fri, 01/04/2008 - 17:35 in

It's likely to be some months before I get to writing this tutorial so I decided to throw up some tidbits. These are offered as is. Please don't ask for support. I'm already behind in supporting forums & profiles and just can't add to that. Don't expect to be able to just drop this in and have it work but, if you have some idea of what you're doing, this may be helpful.

Syndicate content