User login

Agaric

Account management with LDAP

Add new user

$ sudo cpu useradd user

Add existing user to group

$ sudo ldapaddusertogroup user group

You can check that the add has taken effect by looking over the lists of groups the user is in (due to caching this may take some time):

$ sudo -u user groups

Add a subsection class to Drupal page body for theming Views and other parts of a site that can be defined by parts of the path

I had wanted to add the name of the view with its display to the body classes (Views apparently provides everything but that combination, and not all browsers we need to support deal with matching on two sibling classes). Looked in Zen for how to do it first though and as a consequence saw a way to add new sub-section body class with the first two parts of each URL.

This goes in your zen subtheme's implementation of preprocess page:

Mysterious insertion of paragraph tag (in DOM only, not in code) inside span

.section-aboutus .date-display-single {
  color:#2d95c1;
}

.section-aboutus .date-display-single p { margin:0px; padding:0px; }

Can that second CSS rule call the p tag into being?

Definitely one of the freakiest things I've seen. The source code contained no p tag within the span. The code shown by Firebug and Safari's inspector both had the the paragraph tag.

Actual source code:

<p>Tri Star Pictures <span class="date-display-single">2009</span></p>

Fixing Menu Block for menu items with the same path (that also have another valid path)

"exanded" elements of a menu-item-rooted tree aren't expanded
http://drupal.org/node/398888

Working modified function (the patch has more):

Make modifications to a sidebar block menu that primarily mirrors top-level drop-down menu

Using the magic of menu block (dev) and menu attributes.

theming menus
drupal menu theming

Another great reason to use Menu Block - the menu block alter function.

Check for duplicate titles of a node with AJAX to warn immediately before entering more data or submitting

Attached is a custom module that piggybacks on Unique Field and steals most of its other code from username_checkUsername Check.

Commit message: "Working Unique Field AJAX enhancement for node titles. Pretty sweet. It doesn't take away the duplicate warning when you change the title to not be duplicate, but it does change to a green checkmark (courtesy of the username_check module from which I also stole most of the code)."

Below, tales from

See all path aliases for a node

Now a module! http://drupal.org/project/showaliases

drupal show all paths
drupal show all paths for a node
show alias
aliases
paths
drupal module list aliases

Show path aliases to nodes in other languages
http://groups.drupal.org/node/24171

Clean up and rationalize Drupal core Taxonomy Term Add and Edit form

I can't believe no one has done this!

Simplify the taxonomy interface for administrators by removing the taxonomy related terms box...

drupal taxonomy hide related terms
drupal form tweaks remove related terms

The commit message upon completion...

"Clean taxonomy term add / edit form by removing related terms and moving parents from the closed advanced fieldset to the open identification fieldset if the vocabulary has already been made hierarchical."

And the code:

Maintaining a module on Drupal.org with CVS: committing changes

This is for a module where the current version's code is in HEAD and we aren't going to do any branching.

(agc is an agaric-specific helper script.)

agc entreztest NEW
cd drupal/
cd sites/all/modules/
mkdir entrez
export CVSROOT=:pserver:agaric@cvs.drupal.org:/cvs/drupal-contrib
cvs login
cvs co -d entrez contributions/modules/entrez
cd entrez/

Remove page headline for a given content type

To remove the page title (the one that prints in the page itself, not in the browser bar) for a specific node type, use this simple code in your template_preprocess_page() function.

Make sure you wrap the code that outputs the header in page.tpl.php in a conditional if statement, so that if there is no title it does not output the <h1></h1> tags.

This code goes in template.php of a theme named "example":

Syndicate content