Version: 1.3 Author: Alistair Kearney ([email protected]) Build Date: 30th July 2009 Requirements: Symphony 2.0.6 or greater
Allows more control over Frontend page content type mappings. Each mapping is stored in the Symphony config file, and page type is matched against these mappings.
[INSTALLATION]
* You must be running the latest Symphony code from the git Integration branch *
1. Enable the extension
2. Add content type mappings to your /manifest/config.php file with
the format 'TYPE' => 'CONTENT-TYPE', E.G.:
###### CONTENT-TYPE-MAPPINGS ######
'content-type-mappings' => array(
'xml' => 'text/xml; charset=utf-8',
'text' => 'text/plain; charset=utf-8',
),
########
3. If a page uses a type listed in the config, that appropriate content type will
be set. Should more than one match be found, the last one encountered will be
used.
[CONTENT DISPOSITION] To force download of a page (by setting the Content-Disposition header), give it a page type that begins with a '.'. The page will be downloaded with a filename = $page-handle.$type. For instance, a page with handle 'form-data' and a page type of '.csv' will be downloaded as 'form-data.csv'.
Depending on the Content Type you map to a page type, it may not be necessary to add this
Content-Disposition header in order to cause the page to download.
[CHANGE LOG]
1.3 - Using new Symphony delegate, FrontendPreRenderHeaders. Old delegate was triggering after headers were rendered.
1.2 - Fixed to work properly with Page::addHeaderToPage()
1.1 - Symphony 2.0.5 compatibility upgrade
- Force download option (thanks to ashooner)