Filters allow plugin developers to modify the output of Koken. Filters can be applied to API responses, or the rendering of the published site.
API filters
api.album
This filter is fired before an album object is output in the API. The filter is passed the current data array for the album and your filter must return a data array once your transformation is complete.
api.content
This filter is fired before a content object is output in the API. The filter is passed the current data array for the content and your filter must return a data array once your transformation is complete.
api.content.create
This filter is fired before a content object is saved by the API. The filter is passed the input data array for the content and your filter must return a data array once your transformation is complete. The array also includes a 'file' parameter which contains the path to the original file for the content.
api.content.update
This filter is fired before a content object is updated by the API. The filter is passed the input data array for the content and your filter must return a data array once your transformation is complete. The array also includes a 'file' parameter which contains the path to the original file for the content.
api.content.update_with_upload
This filter is fired before a content object is updated by the API with a new file. The filter is passed the input data array for the content and your filter must return a data array once your transformation is complete. The array also includes a 'file' parameter which contains the path to the original file for the content.
api.text
This filter is fired before a text (page or essay) object is output in the API. The filter is passed the current data array for the page or album and your filter must return a data array once your transformation is complete.