Path Filter

mrfelton - April 13, 2006 - 02:53

Path Filter takes internal Drupal paths in double quotes, written as e.g. "internal:node/99", and replaces them with the appropriate absolute HTTP URL using Drupal's url() function. It also works for files in your files directory using Drupal's file_create_url() function.

Suppose your site is located at 'http://example.com/mysite', clean URLs are enabled, and 'node/99' has a URL alias of 'news/latest'. The following are some examples of the replacements performed by this 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"

It even handles things like...

  "internal:node/23?page=1#section2" -> "http://example.com/node/23?page=1#section2"

It works with clean URLs enabled or disabled as well as working equally well for single site or multisite installations.

New in 6.x-2.x
And, as of version 2, it can also work for creating path to files in your files directory ...

  "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"

And, it can do the job of adding 'internal:' for you, relieving you of the task, but ensuring that your links still get saved in the proper format.

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/).

Note: This module used to be named URL Alias Filter, but has been merged with work done by Ray Zimmerman.

Releases

Official releasesDateSizeLinksStatus
6.x-2.0-beta32009-Oct-1714.7 KBSupported for 6.xThis release is supported but is not currently the recommended release for 6.x.
6.x-1.02008-Feb-198.96 KBRecommended for 6.xThis is currently the recommended release for 6.x.
5.x-2.0-beta12009-Oct-1712.23 KBSupported for 5.xThis release is supported but is not currently the recommended release for 5.x.
5.x-1.02008-Feb-198.93 KBRecommended for 5.xThis is currently the recommended release for 5.x.
4.7.x-1.12008-Feb-198.28 KBRecommended for 4.7.xThis is currently the recommended release for 4.7.x.


 
 

Drupal is a registered trademark of Dries Buytaert.