cTemplate Publications

When a cTemplate is processed in the context of a publication, such as during a publish or preview, publication-specific global variables are available and the behavior of #LINK() and #OUTPUT() can be customized.

Global Publication Variables

For information about the global publication variables, see cTemplate Global Variables.

URL Processor

If the Publication defines a URL processor, it will be called each time #LINK() and #OUTPUT() are called to process and potentially modify the resulting URL.

The URL Processor is a fully qualified (namespaced) PHP class that can be loaded by the auto-loader.  For example, \com_example_www\url_processor.

TODO: A PHP interface should be defined and the class should be required to implement that interface to formalize the following.

The following methods may be implemented in the class to override the default URLs produced by #LINK() and #OUTPUT().

  • process_absolute($state, $shared, $path) - Return a string with the absolute URL.
  • process_relative($state, $shared, $path) - Return a string with the relative URL.
  • process_root($state, $shared, $path) - Return a string with the rooted URL.