Document recent changes

fallback chain changes, preview fixes, getFile function in plugin api,
frontend-param in smarty {getFile}
This commit is contained in:
onli 2016-09-09 15:12:13 +02:00
parent acef784f41
commit f15cb17755
2 changed files with 21 additions and 2 deletions

View File

@ -1,6 +1,24 @@
Version 2.1-beta1 (June 8th, 2016)
------------------------------------------------------------------------
* Introduce new plugin api function
$plugin->getFile($filename, $key = 'serendipityPath'). Other
than parseTemplate($filename) it will not parse the found file
via smarty, and it allows directories inside $filename. Intended
use is finding files like images via the fallback chain, giving
themes the chance to serve custom versions instead.
* Give theme authors the option to force using a template file from
the frontend, {getFile file=... frontend=true}
* Fix entry preview by making sure it always uses the correct
template files to generate preview, replacing internal magic
with direct parameters
* Rewrite and simplification of the file fallback chain in
serendipity_getTemplateFile. Removes templates/default/ from
from the chain, as it was replaced by templates/2k11/
* Added new theme "Timeline". Timeline is a fully responsive,
mobile first HTML5/CSS3 theme built on the Bootstrap
framework.

View File

@ -72,12 +72,13 @@ function serendipity_smarty_html5time($timestamp) {
* @param string The name of the block to parse data into ("COMMENTS" - virtual variable like {$COMMENTS})
* @param string The name of the template file to fetch. Only filename, the path is auto-detected
* @param boolean If true, the output of the smarty parser will be echoed instead of invisibly treated
* @param boolean If true, always use a tpl file from the frontend fallback chain (used for the preview)
* @return string The parsed HTML code
*/
function &serendipity_smarty_fetch($block, $file, $echo = false, $preview = false) {
function &serendipity_smarty_fetch($block, $file, $echo = false, $force_frontend = false) {
global $serendipity;
$output = $serendipity['smarty']->fetch('file:'. serendipity_getTemplateFile($file, 'serendipityPath', $preview), null, null, null, ($echo === true && $serendipity['smarty_raw_mode']));
$output = $serendipity['smarty']->fetch('file:'. serendipity_getTemplateFile($file, 'serendipityPath', $force_frontend), null, null, null, ($echo === true && $serendipity['smarty_raw_mode']));
$serendipity['smarty']->assignByRef($block, $output);