This website is composed of information connected through taxonomy. It is simultaneously a proof-of-concept and a means to allow Agaric to share and store information both within the collective and the world as part of our open documentation philosophy.

User login

This website is composed of information connected through taxonomy. It is simultaneously a proof-of-concept and a means to allow Agaric to share and store information both within the collective and the world as part of our open documentation philosophy.

Disabling Drupal's default notifications to the administrator when a user registers

This is not tested, but running this code (in an update hook, via Drush php-eval, however) should prevent Drupal from sending its notifications to the site e-mail address when a new, pending approval user registers:

Include a file nested within a module directory wit Drupal 7's module_load_include

The documentation for module_load_include doesn't mention it, but if a file is in a subdirectory in its module folder, or even nested several levels deeper, this module-relative path should be included with the file name in the third parameter.

Have menu local tasks (view, edit, etc. tabs) show menu item description as tooltip

Most menu items in Drupal 7 show a link tool-tip, or title, but local tasks (the tabs you are most used to seeing as the edit link tab on full node pages sadly do not follow this sensible pattern.

Until Drupal core is fixed so that menu item "description" is applied to title attribute of menu tab links", here is a fix for Drupal 7. Change this to your custom theme's name (replace 'example') and drop into your theme's template.php file:

Google Web Versus Google AJAX API Search Results

Google search results via their API vary greatly versus the results from the web interface (as an anonymous, not-logged-in user). This has been reported by others, but here is a direct test performed by me. We are fortunate in this example that the first two results are the same (albeit in reverse order). However the next results bear no resemblance to each other whatsoever.

The default Web UI returns 10 results at a time (on a page).

The default AJAX API returns 4 results at a time, and so was repeated twice advancing by four for the second result set.

Beware of transactions in Drupal 7

Drupal 7's database layer makes use of transactions in several places. Be careful when you expect to see the results of node_save() outside of the scope of the current request. If someone accesses your website data before the transaction has been committed, the results of queries executed within are not visible. Either all queries succeed or nothing happens at all in a database transactions.

The Web site model and the Web app model

From http://www.sthlmconnection.se/en/blog/appification-web

Choose the Classic model if:

The product is mostly page/document based.
Accessibility for people with disabilities and SEO is non-negotiable.
Your project scope is large and the budget is limited.

Choose the App model if:

Wrapping a link around a renderable array for images in Drupal 7

I was asked a question about theming linked images and gave the wrong answer, that it was a known pain point, but it kept bugging me because i was pretty sure i was not remembering something. The failure of link render arrays i was thinking of is their use in item_list, but in fact there is a secret theme function that can be used to put linked images in a render array properly.

Thanks to the amazing Morbus Iff for documenting using theme_image_formatter in a render array:

Removing Redundant Templates from a Subtheme using a Diff command

in

In Drupal 7, templates in a base theme will be used if an active subtheme does not have that template. This means that there is never a reason to have a template that is identical to what is already in the base theme.

Best Way to See Identical Files

diff --recursive --brief -s issybase issymobile

The -s flag makes diff mention identical files as well as modified ones.

Even better:

diff --recursive --brief -s issybase issymobile | grep identical