Path Filter takes internal Drupal paths in single or double quotes, written as e.g. "internal:node/99", and replaces them with the appropriate absolute HTTP URL or path using Drupal's url() function. It also works for files in your files directory using Drupal's file_create_url() function. It works with clean URLs enabled or disabled as well as working equally well for single site or multisite installations.
The motivation for this filter was to provide a robust way of linking to internal URLs from within content, so that your links do not break if you move your site to a different path (e.g. from a development site at http://example.com/dev/ to a production site at http://example.com/).
Nodes and system paths (internal:)
internal: for nodes and system paths.
Suppose your site is located at 'http://example.com', clean URLs are enabled, and 'node/99' has a URL alias of 'news/latest'. The following are some examples of the replacements performed by the 'internal:' filter.
"internal:admin/user" -> "http://example.com/admin/user"
"internal:node/23" -> "http://example.com/node/23"
"internal:node/99" -> "http://example.com/news/latest"
"internal:node/99?page=1#section2" -> "http://example.com/news/latest?page=1#section2"
Files in your site's files directory (files:)
files: for in your site's files directory.
As of version 2, Path Filter allows you to reference files in your site's files directory in a consistent manor, helping to alleviate any problems down the line if you decide to move your files directory (for example, when moving to or from a multisite setup). The following are some examples of the replacements performed by the 'files:' filter.
"files:image1.jpg" -> "http://example.com/sites/example.com/files/image1.jpg"
"files:images/image2.jpg" -> "http://example.com/sites/example.com/files/images/image2.jpg"
Automatic conversion
Path Filter can do the job of adding 'internal:' or 'files:' for you, relieving you of the task, but ensuring that your links still get saved in the proper format.
Note: This module used to be named URL Alias Filter, but has been merged with work done by Ray Zimmerman.
Downloads
Recommended releases
| Version | Downloads | Date | Links |
|---|---|---|---|
| 6.x-1.0 | tar.gz (8.96 KB) | zip (10.62 KB) | 2008-Feb-19 | Notes |
| 5.x-1.0 | tar.gz (8.93 KB) | zip (10.58 KB) | 2008-Feb-19 | Notes |
| 4.7.x-1.1 | tar.gz (8.28 KB) | zip (9.09 KB) | 2008-Feb-19 | Notes |
Other releases
| Version | Downloads | Date | Links |
|---|---|---|---|
| 6.x-2.0-beta3 | tar.gz (14.7 KB) | zip (18.11 KB) | 2009-Oct-17 | Notes |
| 5.x-2.0-beta1 | tar.gz (12.23 KB) | zip (14.27 KB) | 2009-Oct-17 | Notes |
Development releases
| Version | Downloads | Date | Links |
|---|---|---|---|
| 6.x-2.x-dev | tar.gz (13.22 KB) | zip (15.02 KB) | 2011-May-03 | Notes |
Project Information
- Module categories: Filters/Editors
- Maintenance status: Unknown
- Development status: Unknown
- Reported installs: 4750 sites currently report using this module. View usage statistics.
- Downloads: 13,270
- Last modified: March 27, 2010
