Using schema prefixes with PostgreSQL

This page discusses usage of PostgreSQL schemas for prefixes. "Normal" prefixes can be used in the same way as in MySQL, so they won't be discussed here.

PostgreSQL has something called 'schemas' (http://www.postgresql.org/docs/current/static/ddl-schemas.html). They can be very handy sometimes, but if you don't know what they are, you probably don't actually need them and can stop reading here.

Schemas can be used as prefixes within Drupal. That is, with a multisite setup, each site can reside in its own schema, and shared tables can reside in a "shared" schema (or even in the public schema).

There is one annoyance: the upgrade will fail. This is unfortunate, but nothing can be done as the "normal" (not schema) and schema prefixes are just incompatibile. If you are interested in the details, please see http://drupal.org/node/40034.

But, don't worry. This can be easily fixed by changing the update script (update.php and updates.inc) a bit. The problem lies in the CREATE [UNIQUE] INDEX and ALTER TABLE ... DROP/ADD CONSTRAINT statements. When schema prefixes are used, queries like this are executed:

CREATE INDEX prefix.search_total_word_idx ON prefix.search_total(word)
ALTER TABLE prefix.boxes DROP CONSTRAINT prefix.boxes_title_key
ALTER TABLE test.contact ADD CONSTRAINT test.contact_category_key UNIQUE (category)

Customizing the search forms

This info applies to Drupal 6 and 7.

Description

This guide describes how to override the default SEARCH THEME FORM* layout when using phptemplate based themes and the core Search module.

* The SEARCH THEME FORM is the search box that that appears in the page header, when enabled. Refer to the NOTES below for overriding the block search form and main page search form.

Category: structure and classify content

NOTE: The Category module is no longer maintained, see #140911-8: Will this project be continued to Drupal 7?

The Category module allows you to structure your site into a tree-like hierarchy of pages, and to classify your dynamic content, all within one seamless interface. Gone are the days when these two tasks were carried out using separate and incompatible tools: now it's all one and the same. Built upon the solid foundations of the book and taxonomy modules, the category module overcomes the weaknesses of both these tools, to give you more power than ever before in customizing the navigational experience of your Drupal site.

Documentation, announcements, a live demo, and more can be found on the category module web site. If you're interested, also see why the category module documentation is not here on drupal.org.

You can:

  • create and maintain container and category nodes at administer >> categories.
  • administer general category options at administer >> settings >> category.
  • assign content to your categories by configuring containers to allow certain node types, and then selecting categories for your new nodes on the 'create content' form.

Adding next & previous links for node types within taxonomy terms (e.g. Image Galleries)

A better way to do this using Custom Pagers module is detailed in the Image module documentation: http://drupal.org/node/709462

description

The following adds a custom next_prev function to your theme template.php file that allows you to insert NEXT | PREVIOUS type links in your layout.tpl.php files. Where layout might be node.tpl.php, node-image.tpl.php etc.

In the illustrative example snippet below, a simple NEXT | PREVIOUS link is inserted into a custom node-image.tpl.php file linking to the next and previous image within that gallery (taxonomy term).

step 1 of 2

Add the custom next_prev function to your template.php file.

  1. In a text editor like notepad.exe or equivalent, create/edit a template.php file and paste the following snippet
  2. Save your new/edited template.php file and upload it to your active theme folder

function next_prev for Drupal 5


<?php
function next_prev($current_nid, $type, $button_type, $label, $class) {
$tid = db_result(db_query(db_rewrite_sql("SELECT tid FROM {term_node} WHERE nid = $current_nid;")));
if (empty($tid)){ //validate that the image 'does' have a tid
return '';
}

switch ($button_type) {
case 'next':
$sort= 'ASC';
$case = '> ';

Inserting Taxonomy Images into nodes

description

These snippets allow you to insert Taxonomy images into your nodes, when using the taxonomy_image.module.

Before doing a lot of extra work for yourself, there are several Taxonomy Image add-ons distributed with the package and that virtually eliminate all this extra work.

usage

  1. Requires the taxonomy_image.module to be installed and enabled
  2. Use a text editor like notepad.exe or equivalent to copy and paste the snippets below into your template.php file and node.tpl.php (or node-type.tpl.php) files respectively
  3. Upload your edited your template.php file and node.tpl.php (or node-type.tpl.php) files to your active theme folder.

step 1 of 2

To override the default taxonomy_image layout copy the following snippet, using an editor like notepad.exe, name it TEMPLATE.PHP and upload it to your active theme folder.

If you already have a TEMPLATE.PHP file in your active theme folder, simply add the above to the existing TEMPLATE.PHP file and upload it.

NOTE: This is not to be confused with the template.php file in the /THEMES/ENGINES/PHPTEMPLATE folder. themes/engines/phpTemplate.


<?php
function _phptemplate_variables($hook, $vars) {

Invite: send invitations to join your site

Invitations are important to create network effects and exponential growth of a community of interest. The Invite module adds an 'Invite a friend' feature that allows your users to send and track invitations to join your site.

Invite also adds a new registration mode called New user registration by invitation only that allows you to maintain a semi-private site.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 6.x