User login

How to

Information on how to do something... anything.

Make a new Drupal site project in the Agaric system

This is deprecated in favor of Deploying the Agaric Way.

Run from anywhere on the test or development server:

sudo /srv/scripts/agaric-newproject.sh 5 myagaric myagaric.com my.agaricdesign.com

You'll see a fair amount of output, and the last line you see should be:

Site myagaric installed; run /etc/init.d/apache2 reload to enable.

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.)

Different page templates for different content types

Once upon a time there was a drupal themer working on a dark and stormy night, he sat there wondering how to make different page templates for certain content types on his site. He thought about how the drupal template system seems to be missing this for some reason... Suddenly, he had a vision! Like a ray of light bringing, hope and happiness down from the heavens!! oh yes!!

Get the path to a Drupal module or theme

This is a very useful function in Drupal's API that is hard to find searching online for file system paths to Drupal modules or themes or anything like that.

So to get the path to a Drupal module or theme it's as simple as:

<?php
  drupal_get_path('module', $module_name);
?>

or:

<?php
  drupal_get_path('theme', $theme_name);
?>

How to add users to or edit user passwords for a Subversion repository

add new users to an svn repository:

sudo vi svnrepo/conf/passwd

Resolution

See what Subversion repository you are drawing from with vi .svn/entries

See from what repository checked out subversion code is from by looking at the entries file in a dot SVN folder:

ben@server:/var/www/drupal-5-live/sites/democraticmedia.ca$ vi .svn/entries

Here is the key line, "https://dev.grassrootsconnection.org/svn/drupal/anderson/trunk/democraticmedia.ca," from this output:

8

Adding a new version of Drupal core to Agaric's Piston-enabled deployment system

cd /RCS/agaric/drupal-core/
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal co -r DRUPAL-6-3 -d drupal-6 drupal
sudo svn add drupal-6
sudo svn commit -m "Drupal 6"

drupal-6 and DRUPAL-6-3 need to be replaced with the major release and point release that you are dealing with (though with luck we'll have moved from CVS soon and this will all be moot).

Ways to share private or pre-publication content with Drupal

Public Preview
http://drupal.org/project/public_preview

This module allows public access to unpublished content on a per-content-type basis.

Use "edit" in CiviCRM URL to edit a new contact

Here's a sample path to create a CiviCRM signup form in Drupal:

civicrm/profile/edit&reset=1&id=1&gid=1

The documentation has "create" instead of "edit". It's not clear whether the problem is that I'm already logged in to Drupal.

Resolution

Drupal 6 Theming Question & Answer

themes have info files now?

yea

regions are in there

and other stuff

nice

like ya know how most themes dont have a search box you can activate from the them config page?

well now in the theme info file

you tell it you dont have it

ahh

and the button (check box) goes away

clever

or that you DO have it etc

Resolution

Syndicate content