User login

Drupal 5

Adding tracking code via template.php

Adding custom tracking Javascript confused me on doing it the Drupal way.

When the goal was adding:

  <script type="text/javascript" language="javascript">llactid=14159</script>
<script type="text/javascript" language="javascript" src="http://trackalyze.example.com/trackalyze.js"></script>

Provide an 'Add New' link on a simple view for easily creating more content to list

It's a common situation– you create a simple view that may do little more than filter on one content type in order to get a listing of press releases or links or recipes.

Sure, you can explain to your client and users that going to "Create content" and clicking press release or link or recipe will, when the post is submitted, get it automatically listed on this Views page. And that's pretty nice. But it's a lot more intuitive if the link to create relevant content were right on the view itself.

Looking at SQL to fix broken queries in a Drupal environment

Alternate title: Apparently I don't understand SQL (and so need all the help I can get)

The easiest way to get a better look at your SQL in Drupal is to install the devel module. (Hint: It's for use on development sites, not production sites!)

Configuring Global Redirect and Path Redirect

The modules in question:
Global Redirect: http://drupal.org/project/globalredirect
Path Redirect: http://drupal.org/project/path_redirect

Download and place your modules in the sites/all/modules directory of your site using your chosen method. Agaric recommends Drush.

Allow people to upload user pictures during registration

Well that's annoying.

Spend a good chunk of time creating a module to address a need, return to the thread that's been discussing it since 2006 June to post your efforts and discover it's just been updated to report that the module has been around since 2007 November.

[Download Agaric's user_reg_picture module anyway.]

Where in the theme are the tabs printed / giving tabs to admins only

On giving View, Edit, Revision, etc. tabs to administrators only.

In Drupal, tabs are not printed by the node, but by the page. On the one hand, since views and administrative pages and anything else you can think of can have tabs, this makes sense. But on the other hand every node can have

But in any case, if you're looking to change the presentation of tabs somehow (or as in our case, restore them to a theme design from which they had been removed), you will find the place to look is not node.tpl.php but page.tpl.php.

Sidebar graphics with links ("promotional badges") the Agaric Drupal way

A note of warning about the length of notes to follow: This is site configuration at the point where it verges on developer documentation, such is the power of Drupal, and there's some outright theming in here too. This article is a reaction to doing sidebar graphics the painfully non-Drupal way.

Fastest way to get just one result from a database table in Drupal

To get a single value result – one row from a just one column – the Drupal function for that is db_result(), which takes the result of db_query() as an argument.

http://api.drupal.org/api/function/db_result/5

(The same function works for Drupals 4.7 and 6.)

How to theme a Drupal form

Update: This tutorial has been revised significantly to provide a robust solution consistently works.

Define a function named your_theme_name_ or phptemplate_ plus name_of_form($form).

Syndicate content