User login

Drupal Development

Label nodes with their content type

In the node.tpl.php (example attached), Agaric simply added:

<div class="type"><?php print $node->type ?></div>

And the CSS:

<pre>
.node .type {
  float: left;
  font-size: 80%;
  font-style: italic;
  color: #714839;
  margin-right: 5px;
}
</pre>

List taxonomy terms that belong to nodes that belong to another taxonomy term

The SQL for this is a little tricky. I know I wrote down what needed to be done for Christophe to tackle but I can't find it now.

In short:

Select all nodes that belong to the taxonomy term being passed into the Place page.

node -- in drupal 6 node_revision -- but in any case it comes from the taxonomy table.

Select all taxonomy terms that are in a given vocabulary that belong to those nodes.

This requires also a look at {term_data} which stores vocab information (as vid).

Modifying a view with a views hook: example of custom empty text

From wsf_action.module:

<?php
/**
 * Implementation of hook_views_pre_view
 *
 */
function wsf_action_views_pre_view(&$view) {  // don't need $items
 // in_array($view->name, $place_views)
  if (substr($view->name, 0, 6) == 'place_') {
    wsf_action_place_view($view);
  }
}

Taxonomy_term_count_nodes gives stupid results when child terms have same nodes

The Drupal core function in taxonomy.module, taxonomy_term_count_nodes, has no check in it to remove duplicate nodes, which can happen in situations where a nodde belongs to both a child and a parent. In my opinion there should be a different function taxonomy_term_and_children_count_nodes or a flag in the function to say if nodes belonging to children terms should be counted at all, and if they are, there should be proper checking to remove duplicates.

Record process of checking out code of a Drupal site so it can be played back

Agaric wants a way to say to our servers, keep track of every svn checkout done here, so we can do it again in an instant for test sites etc.

Resolution

How to add CSS and Javascript just for the front page, as for a custom GMap call

You cannot call drupal_add_css, drupal_add_js, or drupal_set_html_head in any page.tpl.php files themselves. This makes sense, as the variables used to display the page have to have been loaded already for the page to start displaying.

Fix RSS output for CCK node types so that information from all important fields are included

Solution for RSS, CCK and Views...
http://drupal.org/node/87430

I think this is basically what the Contemplate module can do? But can it be used to theme RSS only, and leave regular theming to node-type.tpl.php files?

Resolution

Return path module (working edition)

Due to poor reading of the issue queue AND not looking for the HEAD release, I (accidentally?) coded the fix to this myself. But actually both head and the official release are broken in different ways, so here's Agaric's service to the community.

Presumably the official version at http://drupal.org/project/returnpath will be working soon (version 5.x-1.1 does NOT), but until then here's a working download.

Setting up cscope for Drupal: the find command to list the files to index

Thanks to one of a whole slew of development environment tips from chx, Agaric is going to try to install and use cscope.

Installing cscope on a Mac with the fink package manager is as easy as typing on the command line:

fink install cscope

There is also a graphical interface for Fink called Fink Commander, I think.

Telling fink what to index is a little harder.

Syndicate content