Altering SQL in Views 3 for Drupal 6

I struggled all day to figure out why hook_views_pre_execute was not responding to custom SQL I added in a module with $view->build_info['query'] = "SQL QUERY HERE"; in Views 3.

Passing arguments from URL to Blocks in Drupal 6

Views 3 looks like it should be able to do this out of the box, but I couldn't get it to work. I have an annual event where the path for each year's page is event/year. On some of the subpages for the event I wanted to display a view in a sidebar block. The path for the subpages would be something like event/year/presentation. In the attached screenshot, Views 3 has a Default argument type setting for "Raw value from URL" where the path component can be set. For my example path I set the Path component to 2 so that the year part of the URL is the argument.

New modules

I added Mollom today because I got my first spam user registrations early this morning.

I guess this means my site is being crawled by something!

I also added the Module Filter module so that when I do this more and more the module list becomes more manageable.

count results of a view

http://drupal.org/node/534714#comment-3736358

I should probably see the performance effects of this, but at least it works. I should probably also put it in a tpl file instead of the header of a view.

variables in settings.php

I was tired of redoing cache settings when copying a production site database to development. I figured there must be variables I can set in settings.php. And of course, there is. A good write-up helped me decide on using these:

Working with drush feeds-import

I'm working on writing a bash script to automate the importing of feeds.

Nodes initially created via Import button on feed node.

Feeds and Drush to import in sequence

One of my projects involves setting up many feed importers to populate users, nodes, and data tables on a site. The setup is rather complicated in that many of the items reference each other through node references. Because of this, I need the feeds to be imported in a certain order—if a node that is referenced by another node does not yet exist things will go wrong.

Hello World!

I thought it was time to put this domain to use and start a Drupal 7 site of my own. Also, it will be a good place to log things that I’m learning as I’m doing projects. This will certainly help me remember all the tangents and stray ideas I have, and who knows, they may help someone else out there. Most of the content will be related to Drupal, but anything is on the table. That’s what tags are for, right?

Here’s to yet another website! I hope this one doesn’t fizzle, because that would mean my excitement is fading.

Subscribe to tommyk.net RSS