Drupal 6: pathauto missing in Administer -> Site Configuration [SOLVED]

Pathauto is one of my preferred modules for developing blogs using Drupal.

The Pathauto module automatically generates path aliases for various kinds of content (nodes, categories, users) without requiring the user to manually specify the path alias. This allows you to get aliases like /category/my-node-title.html instead of /node/123. The aliases are based upon a “pattern” system which the administrator can control.

If you are a Drupal-5 experienced user you will notice that version 6 lacks of a “Administer – > Site Configuration -> Pathauto” menu link, like the older versions had.

Where (the hell) is this menu? Here is a quick tip:

For 5.x: Administer > Site configuration > Pathauto
For 6.x: Administer > Site building > URL alias > Automated alias settings 

Drupal: Useful modules

If you are new to DRUPAL, it might be useful to know some of the great modules out there:

The following are part of the “Others” modules, stored in directories under sites/all/modules/.

Advanced forum: Enables the look and feel of other popular forum software. Great for styling your forum and make, for instance, a phpBB-looking-like forum.

Author Pane: Gathers information from user related contrib modules into one template (used along with advacedforum).

Content Construction Kit (CCK): The Content Construction Kit allows you to add custom fields to nodes using a web browser.

Feedback2.0: Feedback 2 allows users and visitors of a Drupal site to quickly send feedback messages about the currently displayed page, using a fixed positioned and ajaxified feedback form.

Filter by node type: The core filters system allows an admin to restrict the type of input format available to a user by user role. It does not, however, allow the admin to restrict the available input formats by node type. This module fixes that. It provides a simple checkbox-based interface where an administrator can restrict what input filters are available to what nodes. These rules are applied after the role-based restrictions, so it can never offer more input formats than the default role-based input formats would.

Flat comments: Make all comments replies to the main post, regardless of the reply link used (used along with advacedforum).

ImageAPI: This API is meant to be used in place of the API provided by image.inc. You probably do not need to install this module unless another module are you using requires it. It provides no new features to your Drupal site. It only provides an API other modules can leverage. Currently GD2 and ImageMagick support are distributed with ImageAPI.

Imagecache: ImageCache allows you to setup presets for image processing. If an ImageCache derivative doesn’t exist the web server’s rewrite rules will pass the request to Drupal which in turn hands it off to ImageCache to dynamically generate the file.

Integrated metatags: Integrated Metatags allows you to expose content data in META-tags on full-page node views, with Metatag options stored per content type. Node, taxonomy, and user information are all available out of the box, with an optional CCK module that exposes CCK data. Additionally, if the Token module is enabled you can use tokens in your Metatags. Using all of these different sources for data, you can name your Metatags however you would like, and can even combine like-named Metatags into a single comma-separated tag.

Pathauto: The Pathauto module automatically generates path aliases for various kinds of content (nodes, categories, users) without requiring the user to manually specify the path alias. This allows you to get aliases like /category/my-node-title.html instead of /node/123. The aliases are based upon a “pattern” system which the administrator can control. Support Ticket: The support module provides a basic ticketing system and helpdesk that is native to Drupal, offering complete email integration.

Theme Developer: a Firebug to Drupal theming, it is part of the ** Devel package (for further instructions, refer to the online tutorial video). Needed for custom templating.

Update Status: The Update Status module checks with drupal.org once a day to see if there are new officially released versions of Drupal and any modules that you are running. It requires cron to do its thing, so make sure that you have cron correctly enabled or it won’t be able to know.

Views: this module provides a flexible method for Drupal site designers to control how lists and tables of content (nodes in Views 1, almost anything in Views 2) are presented. Needed for custom templating.

WYSIWYG: Wysiwyg module allows you to use client-side editors (a.k.a. WYSIWYG editors) to edit content in Drupal. It simplifies installation and integration of editors and allows to assign an editor to each input format. Wysiwyg module replaces all other editor integration modules and no other Drupal module is required.

** Devel package‘s content are absolutely useful for developers:
Devel: Various blocks, pages, and functions for developers.
Devel generate: Generate dummy users, nodes, and taxonomy terms.
Devel node access: Developer block and page illustrating relevant node_access records.
Performance Logging: Logs detailed and/or summary page generation time and memory consumption for page requests.
Theme developer: Essential theme API information for theme developers

(Many people asked using contact form for free drupal templates. Take a look at this site.

DRUPAL and WAMP: enable ‘Clean URL’ using mod_rewrite [SOLVED]

When installing DRUPAL, after configuring database name, login, password, host, port and prefix, you will be redirected to another step. In this new installation step you will be asked to Configure Site.

You will have to configure the Server settings section. There you will find the option to make clean urls. If you have installed wamp by default you will not have the chance to enable clean url’s.

How to solve this issue? Just go to your wamp control panel, menu Apache -> Apache modules and click rewrite_module. Now just update your Drupal installation web page and you will be able to enable clean urls.

Hope it helps someone 😉

WAMP and DRUPAL: “Deprecated: Function ereg() is deprecated in C:\wamp\www\includes\file.inc on line 902” [SOLVED]

WAMP is a great tool for developing websites in your localhost.

Suppose you want to install Wampserver 2.0i version and then DRUPAL 6.15. Well, Wampserver 2.0i by default uses php 5.3 and DRUPAL needs a php 5.2 version (or lower).

You will notice some problems if you try to install out-of-box Drupal 6.15 in wampserver2.0i (http://localhost/install.php?profile=default). Your screen will be filled with something like:

Deprecated: Function ereg() is deprecated in C:\wamp\www\includes\file.inc on line 902

Oh, this sucks.

The fix is quite simple:
Download and install the PHP5.2.11 extension for WAMP.

Now go to your Wampserver Control Panel, PHP ->version and select 5.2.11

Reload your DRUPAL install page and… there you go! 😉

Drupal: ‘an image thumbnail was not able to be created’ [SOLVED]

I am using imagecache Drupal module to develop an image gallery. Everything worked fine in my local machine, but when uploading contents to my webserver some errors appeared when creating a new gallery:

an image thumbail was not able to be created

The solution is quite simple:

chmod 0777 /sites/default/files/imagefield_thumbs
chmod 0777 /sites/default/files/imagefield_default_images
chmod 0777 /httpdocs/sites/default/files/imagecache

and also

chmod 0777 /httpdocs/sites/default/files/imagecache/*

Check that your temp directory is writable too.

If the tips above won’t work, make sure you have GD Support enabled in your server (check it using phpinfo())

If you are not able to solve this, check this post.

Drupal: how to add a “share in facebook” link without IE8 crashing

I am developing a Drupal website and my client wants a “Share in facebook” button to appear in his news.

Well, first time I thought about using addthis but I did not want to depend on addthis.

Then I tried to use the facebook share tool, which they claim to be something simple to use, just these lines:

<a name="fb_share" type="button" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

But then, when using Internet Explorer 8, the page was not rendering ok, and this message was shown:

FB.loader is null or not an object.
FB.Share line:15
Code:0 Char:1

And Firebug tells me:

FB.Loader is undefined
FB.Share()FB.Share (line 15)
[Break on this error] FB.Loader.onScriptLoaded(["FB.Share","FB.SharePro"]);

The solution to this problem seems to be easy, as explained in this post, it is supposed to work fine by just adding a call to “FB.Loader” function:

But in my case it still did not work properly, so I decided to use another code to genereate a “Facebook share” button:

I edited my node-story.tpl.php, deleted the following lines:

<a name="fb_share" type="box_count" share_url="<?php echo url("node/".$node->nid,array("absolute"=>true)); ?>" href="http://www.facebook.com/sharer.php?t=<?php echo $node->title; ?>">Compartir</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Loader" type="text/javascript"></script><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>

And added these ones:

                   function fbs_click(){
                         return false;
                   html .fb_share_link { padding:2px 0 0 20px; height:16px; background:url(http://static.ak.facebook.com/images/share/facebook_share_icon.gif?6:26981) no-repeat top left; }
                <a rel="nofollow" href='http://www.facebook.com/share.php?u=<?php echo url("node/".$node->nid,array("absolute"=>true)); ?>' onclick="return fbs_click()" target="_blank" class="fb_share_link">Compartir</a>
                <br />

Easy and no annoying problems 🙂

Drupal: how to change ImageCache Temp Directory [SOLVED]

I just moved my site from a local sandbox onto the server and I was receiving an error message in Status Report page (http://www.yoursite.com/admin/reports/status):

ImageCache Temp Directory c:/wamp/tmp is not writeable by the webserver.

To solve this you must go to Home » Administer » Site configuration - then file system and change the Temp directory to something that exist in your server. For instance, tmp. Make sure that directory is writable by Drupal (chmod 0777 tmp).