Changing the delimiter on primary/secondary links

Note: See http://drupal.org/node/112761 for working with Drupal 5's primary links.

Drupal 6.9

Thanks to dman for a nudge in the right direction via his forum comment.

Copy and paste the theme_links function from theme.inc to your template.php file. change the name of the function to YOURTHEME_links where YOURTHEME is the name of your theme.

Add the following code snippet on the second line of the function, after the "$output=' ';"

<?php
// | delimiter added here.
	if($attributes['class'] == 'links secondary-links') {
    $linklist = array();
    foreach ((array)$links as $key => $link) {
        $linklist[] = l($link['title'], $link['href'], $link);
    }
    // Return the links joined by a '|' character
    return join(' | ', $linklist);
?>
  }

As it is currently setup the secondary links will have the delimiter.

Next go to your page.tpl.php file and insert the following code into where you want the links to show up.

<?php 
if(isset($secondary_links)){
        print YOURTHEME_links($secondary_links, array('class' => 'links secondary-links'));
   }
?>

Drupal 4.7

Locate:
print theme('links', $primary_links)

Comment mover: thread management for forums

The comment mover module allows you to move comments in a thread, move a comment to another thread and move comments to a new thread and vice versa. It can be used should a user post a comment in a wrong topic or posts a comment that should be a new topic.

Comment mover is designed to be integrated into the OG2List mailing list manager, but also works on its own for any Drupal site which has forums and comments. Redirectors to the new positions of the comment or node will be added as appropriate.

Log in while site is off-line for maintenance

Once you have turned your site off-line using admin » settings » site maintenance (admin/settings), you can log back in by visiting:

http://example.com/?q=user

Make sure to note: Use the literal word user, not your username or user id. Do, however, replace example.com with the proper URL parts pointing to your website.

Simple Decision Tree for Drupal Enterprise Scalability

Here's a scaling tree. As you progress up the tree, you will find that time, money, maintenance, headaches will all increase.

This guide assumes that you have multiple fast and beefy Web and DB servers.

  1. Enable MySQL Query Cache
  2. Use a PHP cache
  3. I found that using APC speeds up Drupal by a lot, 3 to 5 times the pages view per second. This was _literally_ a 5 minute install (on FreeBSD) for a 300% to 500% performance improvement. I think at that point it was my dev servers SATA HDDs were the bottle neck. It sits beside me and when I hit it with ab, I can hear the HDDs wrrrrr like crazy.

  4. Use mod_gzip (or ob_compress or whatever it is in php, I prefer mod_gzip, or mod_deflate in Apache2)
  5. The benefits of this are amazing, considering the minimal effort it takes to implement. If doesn't matter if it takes Drupal 0.002 seconds to generate a 40K of html, if it takes like 1 to 2 seconds for a client to download it (more if using a modem). mod_gzip usually gives a 10% to 80% compression depending on the size of pages. Amazing results for 10 minutes of work.

    To enable this feature, put the following code in your .htaccess file, if you are running with Apache 2 and mod_deflate enabled

    # Enable file compression by MIME type

Node object reference

Here is an overview of the node object broken down into Drupal 7, Drupal 6 and Drupal 5.

Plain unstyled HTML output (Theme unavailable)

If your site appears as plain HTML with missing styles and/or images:

Try a view-source and see what the path to the theme CSS in the header is. Does it look correct? Sometimes this can get out of sync when migrating between sites that are almost-but-not-quite identical. Some things to check:

  1. It could be you are trying to use a theme that is not active. This can happen when you have set the default theme in settings.php but that theme has not yet been added or configured. It can also occur if you did not switch back to the default theme before an upgrade. To fix that issue, go to admin > build > themes and select the default theme (Garland in 5.x and Bluemarine in 4.7 and 4.6).
  2. Your $base_url setting (in your settings.php file) may be misconfigured. The $base_url setting is what gets prepended to all paths for extra resources, such as stylesheets, images, javascript includes and form handlers. If the browser can't find those resources on that path, then they will be missing from the rendered HTML you see in your browser.
    Example:

Pages

Subscribe with RSS Subscribe to RSS - Drupal 6.x