Input/output filters to store/restore paths using either stream wrapper notation or a managed file ID token. This module does two things:
- when content is saved, it will store URLs in text fields in a portable fashion.
- when content is rendered, the input filter will replace the stream wrapper URL or file ID token with a relative URL.
This can be easily used with the Insert module which inserts an absolute or relative URL. On save of the content, this module will replace the URL with a path using stream wrapper notation or a file ID token.
The motivation behind this is to store URLs in text fields (e.g. node body) in a portable fashion so that a database can be ported across environments and domains. For example, if the environment consists of development, stage, and production URLs like:
- foo-dev.example.com
- foo-stage.example.com
- foo.example.com
with files stored in the public files directory which may be named the same as the domain like:
- sites/foo-dev.example.com/image
- sites/foo-stage.example.com/image
- sites/foo.example.com/image
This would be a typical setup using a provisioning system like Aegir which, during site creation, allows for specification of the domain name but not the directory name.