Installation and updating

5.x and greater

Create a directory called biblio in the sites/all/modules directory, then place all of the files packaged with this module in that directory.

This module will auto-install the required database tables the first time you enable it on the admin/modules page. This will also setup a number of pre-defined publication types. These types can be changed or deleted on the admin/settings/biblio/types page (see advanced use).

Updating

  • First of all, back up your data. If something goes wrong, you will be able to roll back without losing anything.
    IMPORTANT! If you are upgrading from one of the beta releases or RC1 to the latest version in the 6.x series, you should follow these instructions.
  • If you have any custom style in the biblio folder, remember to copy it to somewhere safe.
  • Remove completely the directory with the previous version. If you keep both directories in the modules folder, Drupal will get confused.
  • Unpack the new version of the module in your modules installation directory. Copy back any custom style to the module folder.
  • Finally, run update.php.

Drupal 4.7

Biblio: manage lists of scholarly publications

The Bibliography module allows you to create and maintain bibliographic lists of publications. The full (HTML) text of the publication can be included if so desired. Other files such as PDF or Word documents can be attached using the upload module.

Nginx, Fastcgi, PHP, rewrite config for Drupal

Afternoon.

So I've been getting stuck into making Drupal 4.7 (and 5.0) work with Nginx, which is a bit like Lighttpd except without the firehose-esque memory leaks you get with Lighty and actual web traffic busier than a trickle.

Insert an image instead of text in a menu item.

Description

To insert an image instead of text in a menu item you may rewrite theme_menu_item_link().

Drupal 6 version

See here for a functional Drupal 6-tested version.

Step 1 of 2

Put this code into your template.php inside your themes directory:

function phptemplate_menu_item_link($item, $link_item) {
	/* Allow HTML if the menu text is an image tag: call l() with 7th argument set to TRUE
	 * See http://api.drupal.org/api/4.7/function/l
	 */
	if( strpos($item['title'], '<img') === 0) {
	  return l($item['title'], $link_item['path'], !empty($item['description']) ? array('title' => $item['description']) : array(), NULL, NULL, FALSE, TRUE);
	}
	
  return l($item['title'], $link_item['path'], !empty($item['description']) ? array('title' => $item['description']) : array());
}

Here we just look for the menu title starting with the HTML tag <img and if true call l() with the 7th argument set to TRUE. This will allow HTML inside the menu text. See http://api.drupal.org/api/4.7/function/l.

Step 2 of 2

Services: An API for remote applications

Services is a standardized API for Drupal that allows you to create "services", or a collection of methods, intended for consumption by remote applications. Several "servers", or protocols, provide different ways to call these methods from a remote site. It works similar to the existing XMLRPC capabilities of Drupal, but provides additional functionality like:

  • Pluggable "server" modules allowing for protocols other than XMLRPC (like SOAP, REST, AMF)
  • Pluggable "service" modules allowing developers to add additional remote services
  • Pluggable authentication mechanisms
  • A number of included service modules which interact with existing Drupal modules like node, taxonomy, user, views, and system

Who might be interested in Services?

  • Flash/Flex or JavaScript developers looking for the best backend CMS system.
  • Mobile developers wanting to integrate Drupal with an Android or iPhone application.
  • Anyone else looking to integrate external applications with Drupal.

Related projects

Inheritance rules

Before diving into the various callbacks, we shall learn the simple but very powerful inheritance rules. We use the parents of a given path for this. For example, the parents of node/%/view are:
node/%
node

If a page callback is not defined for a path, then we look at the closest parent that has one and use it. If the page callback is inherited from a parent, then the page arguments, the file and the file path are inherited from the parent as a whole, but can be overridden. Most of the time it is only required to overwrite the page arguments and nothing else.

If the page callback is defined for a given path, then nothing is inherited and the page arguments, file, and file path must be defined if they are required.

For example:

  $items['admin/user/roles'] = array(
    'title' => 'Roles',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('user_admin_new_role'),
    'file' => 'user.admin.inc'
  );
  $items['admin/user/roles/edit'] = array(
    'title' => 'Edit role',
    'page arguments' => array('user_admin_role'),
  );

The above is shorthand for:
<?php
$items['admin/user/roles'] = array(
'title' => 'Roles',
'page callback' => 'drupal_get_form',
'page arguments' => array('user_admin_new_role'),
'file' => 'user.admin.inc'
);

Pages

Subscribe with RSS Subscribe to RSS - Drupal 6.x