Drupal Articles » Creating a CCK and Views powered Drupal site » Creating a custom Content Type with CCK » Configure Pathauto and Custom Breadcrumbs
Understanding Drupal Paths
Before continuing, it will help you to understand a bit about "how" URL paths in Drupal work, and how that applies to what you're trying to accomplish in following this gude. The terms URL, path, and alias are often used interchangeably in Drupal.
Our goal in this guide is to set up URL paths like this:
example.com/articles
This will be for the index/listing of all the articles, and will be handled by the Views module, covered in a later section of this guide.
example.com/articles/name-of-article
This is the path for the pages (nodes) created for the "Article" Content type. Nodes receive their URL paths through the Path or Pathauto module. Path is a module that comes with Drupal by default and lets you manually make up URLs for pages as you create them, while Pathauto is an add-on module which automates this process, following pre-determined settings which you customize ahead of time before creating the content. In this lesson the Pathauto module will be used.
Although they appear "connected" (similar to how files are placed inside a folder), the example.com/articles path made by Views module and the example.com/articles/name-of-article paths for content are not actually connected to each other internally (however, so long as they're set up correctly, they will "appear" and function as if seamlessly connected to each other).
Think of it along the lines of the "files inside a folder" analogy. The files are the Article content/nodes you create, and the folder is the index or listing of those Articles (articles/), which is created separately by the Views module. This isn't how it actually functions beneath the surface (files and folders), but should help you understand the structure of the URL path.
Customize your Paths with Pathauto
After you've created a Content Type (and before you create any content for it), the first stop you should make is Pathauto. In Drupal 6, the settings for Pathauto have been joined into the URL aliases setting page, and are located at Administer > Site building > URL aliases > Automated alias settings (admin/build/path/pathauto). In Drupal 5, Pathauto's settings can be found at Administer > Site configuration > Pathauto
(admin/settings/pathauto).
In case you're wondering why it's best to set up Pathauto "before" making content, it's because the creation of content adds a URL alias to Drupal - if you haven't customized how the alias should be set up, Drupal (or Pathauto if installed) uses the default settings (e.g. Drupal makes node/# and if Pathauto is installed, it instead makes content/page-title). Once an alias is made, it has to be deleted in order for Pathauto to "remake" it the way you prefer.
Note: In case you do have pre-existing URL aliases which were made before installing Pathauto and/or before reading this, then it's simple to clear the old ones out and automatically generate the new customized ones. If you do not have "custom" aliases that you wish to keep (e.g. written by hand), you can simply click on the "Delete aliases" link at the top of the URL aliases page (admin/build/path/delete_bulk). From here you can check the content checkbox and press the "Delete aliases now!" button. Don't worry - in the next step with Pathauto you'll be able to regenerate aliases for every page on the site, according to your exact settings, with the click of a button. If you happen to have hand-written custom URL aliases and can't delete them all like this, consider switching to allow Pathauto to handle all of your paths to make things easier for yourself - if not you can still delete aliases on a case by case basis from the List view of "URL aliases".
Set up the URL path for Article pages
- Head over to Administer > Site building > URL aliases > Automated alias settings (admin/build/path/pathauto).
- First, expand the "Strings to Remove" fieldset. These are words that Pathauto will skip when making URLs for your pages. Add or remove any words you prefer to this list, or if you'd like, simply delete the whole list (which is my recommendation, since I prefer paths to "make sense" to people who see them, and removing these words makes them less legible/memorable).
- Next expand the "Node path settings" fieldset, which is where the path settings for all Content Types (besides Blog, which is a special case) are found. Locate the Pattern for all Article paths field and enter
articles/[title-raw]Note: This is where what was explained earlier on this page in "Understanding Drupal Paths" comes into play - the articles/ part of the path here is just a placeholder for the View, making the article both appear and function as if it were "within" the articles/ listing page ("folder"). In this way, the paths will also behave logically the way a site visitor would expect them to (like files inside a folder), allowing them to remove the end of an article's path and arrive at the index/listing of all the articles.
- If you'd like to adjust the settings for Default path pattern and any other Content Types while you are on the settings page, feel free to do so now. You can expand the "Replacement patterns" fieldset to see all of the Tokens available for you to include.
- Check the
Bulk generate aliases for nodes that are not aliasedoption. - Scroll to the bottom of the page and click the "Save configuration" button. If there were any aliases to generate for pre-existing content, then a message will appear near the top of the following screen to inform you.
Since Path and Pathauto module create "aliases" to content on your site, the original paths to those pages such as node/2 still exist as well (an alias is just a "mask" of sorts that covers up the original URL with a more friendly one. If you are concerned about possible penalties from search engines due to duplicate content (e.g. two different URLs with the same content) then you should install the Global Redirect module. What it does is ensures that all other URLs that lead to a piece of content get forwarded to your friendly Pathauto URLs.
Set up Custom Breadcrumbs
Breadcrumbs are a valuable and well-understood way to improve navigation on a website. Breadcrumbs allow you to "leave a trail" from the page you are currently on (e.g. an Article), up the structure of your site and back to the home page. You can see an example of them in action on this site even (have a look at the top of the page below the logo).
If your theme has included them (as most do - if not, you should add <?php print $breadcrumb; ?> to your page.tpl.php file), Article content that you create will already show breadcrumbs. However by default they will show only as "Home" (which is not all that helpful). The Custom Breadcrumbs module will allow you to customize this so that a link to the "Articles" listing page will be included: "Home › Articles" (in both cases the Name of the Article is shown below as the page title/heading). The breadcrumbs are not limited to a single level either (if you have a reason to, you could include as many levels of links as you'd like).
- Begin by going to Administer > Site building > Custom Breadcrumbs > Add custom breadcrumb (admin/build/custom_breadcrumbs/add).
- Select
Articlefrom the Node type drop down menu. - As with many settings/configuration forms in the Drupal administration section, if you have a WYSIWYG editor installed, depending on its settings it can potentially get in the way if it is loaded on the configuration page for Custom Breadcrumbs. If your WYSIWYG editor appears here, please disable it for this page before continuing (learn how to selectively disable your WYSIWYG editor).
- In the Titles field, enter
Articles, and in the Paths field, enterarticles. Leave the Breadcrumb visibility field empty. Press the "Submit" button to proceed.

David, I think your link about disabling WYSIWYG in point 3 of "Set up Custom Breadcrumbs" may be incorrect.
(And thanks for all the Drupal tips.)
This was exactly what I was looking to complete my custom Blog "view". Thanks!
Hi David:
I have a view created to show all bookmarks and in the view the page path is "corporate/bookmark". I added the view to the Primary Links menu. I have Path and Pathauto modules enabled. Then in Custom Breadcrumbs I selected the Bookmarks content type and did the following:
Title
Bookmarks
Path
corporate/bookmark
The Breadcrumb visibility field is empty. When I navigate to that page the breadcrumb only shows "Home". What am I doing wrong? Thanks.