Remove unwanted tabs from pages

Both Drupal core as well as various modules add tabs to pages that are not needed for general users, or not needed at all. You may wish to link to the page in a different way, as some users don't understand that they can click on the tab above a node.

Method for Drupal 4.7.x and Drupal 5

In versions of Drupal prior to 6, there was not a way to alter the hook_menu() generated tabs from code, so the function illustrated on this page will find and strip out a tab based on its name. As of Drupal 6, there is now the hook_menu_alter() function, which allows you to alter various properties of menu items that are set by core or other modules. If you are using Drupal 6, you should consider using hook_menu_alter instead, which is more exact, and is simpler/more efficient. One thing that hook_menu_alter cannot do that this page's method can is remove the "View" tab (if you have reason to remove the View tab, you can do so with this technique, and use hook_menu_alter for the rest of your tab removals).

Step 1 of 2

Locate your theme's template.php file. If one doesn't exist, create an empty one. This is where you can place customization PHP code.

Step 2 of 2

Showing the child items of primary links / Turning primary links into "primary menu"

Edit your page.tpl.php

Edit the section where the primary_links are printed to show the whole primary links menu instead of only showing the first level links of your primary links menu.

Migrating from Xoops

Here are some queries that I used in a recent migration from Xoops 2.0.13 to Drupal 4.7.0. This was my first real life experience using SQL so be warned. You might consider adapting the Xoops Migration Module for use with 4.7 instead.

Make database backups at every stage using mysqldump or phpmyadmin.

mysqlump --opt -u user -p database > backup.sql

You will need to have your xoops and Drupal tables in the same database for these to work. The whole transfer took me about 10 hours but I was learning as I went. This is not a complete migration solution but hopefully these will save you some time.

In each case change the drupal_users and xoops_users to reflect your table prefixes.

Users

Change the '-28800' to reflect the timezone of your users.

INSERT INTO drupal_users (uid, name, pass, mail, signature, 
  status, init, created, timezone, access, timezone_name, language) 
SELECT uid, uname, pass, email, user_sig,
  '1', email,  user_regdate, '-28800', last_login, 'America/Argentina/Buenos_Aires', 'en'
FROM xoops_users WHERE uid > 1;

If you want to transfer Occupation and User From then you'll need to setup fields in the profile.module and transfer these separately. Drupal supports user avatars but I didn't transfer these.

Stories from News 1.4

Working with content types and fields (Drupal 6 and earlier)

The Content Construction Kit allows you to add custom fields to custom content types using a web interface. In Drupal 5.x, custom content types can be created in Drupal core, and the Content Construction Kit allows you to add custom fields to any content type. In Drupal 7 and later, most of the functionality of CCK has been absorbed into Drupal core. For more information on fields in core, see Working with Fields (Drupal 7 and later)

LDAP: Integration with enterprise authentication systems

This LDAP integration module allows users to authenticate against a configurable Lightweight Directory Access Protocol directory. This is useful for organizations which have an existing organizational directory with usernames and passwords, and want Drupal to be able to authenticate against it.

Users can read and modify their LDAP entries, and the administrator is able to limit configuration.

LDAP Integration Module (starting with 6.x-1.0-beta3) in reality, is a set of five modules:

Authentication (ldapauth.module)
Required module. It implements basic LDAP integration and sets up the environment for the other optional modules.
Groups (ldapgroups.module)
Optional. Extends the basic functionality and integrates LDAP Groups into Drupal Roles.
Data (ldapdata.module)
Optional. Extends the basic functionality and allows for the management of LDAP Attributes from within Drupal.
Requires the profile or content profile modules to be installed.
Sync (ldapsync.module)

Create block id attributes based on block title

Description

Change block #id tags using the "Block title" field. This provides easy and portable styling, "id=address" instead of "id=block-block-24".

Step 1 of 2

Set up a variable using a preprocess function and ensure that it is correctly formatted for #id attributes.

template.php

<?php
/**
* Override or insert PHPTemplate variables into BLOCK templates.
*
* @param $vars
* A sequential array of variables to pass to the theme template.
* @param $hook
* The name of the theme function being called ("block" in this case.)
*/
function mytheme_preprocess_block(&$vars, $hook) { //change mytheme to your theme name
$block = $vars['block'];

// Create css id attribute based on 'Block title' when available.
if (!empty($block->title)) {
// Create the variable and ensure that it is correctly formatted with mytheme_id_safe function
$cssid = mytheme_id_safe($block->title);
}
else {
// If no "Block title", create css id attribute the traditional way.
$cssid = "block-$block->module-$block->delta";
}
$vars['block_cssid'] = $cssid;
}
/**
* Converts a string to a suitable html ID attribute.
*
* - Preceeds initial numeric with 'n' character.
* - Replaces space and underscore with dash.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 6.x