From 8582fb2a50c268d84e0726457cad83320eb52c7c Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Sun, 8 Jan 2012 16:25:46 +0100 Subject: Changed ste:title behaviour and added docu for it. --- ratatoeskr/frontend.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ratatoeskr/frontend.php b/ratatoeskr/frontend.php index 8d2c767..fe38d5e 100644 --- a/ratatoeskr/frontend.php +++ b/ratatoeskr/frontend.php @@ -618,14 +618,24 @@ $ste->register_tag("styles_load", function($ste, $params, $sub) return $output; }); +/* + * STETag: title + * Generate a HTML title tag for your site. + * + * Tag Content: + * The name of your site. + * + * Returns: + * A HTML title tag that describes the current (sub)page. + */ $ste->register_tag("title", function($ste, $params, $sub) { $pagetitle = $sub($ste); if(isset($ste->vars["current"]["article"])) - return $ste->vars["current"]["article"]["title"] . " – $pagetitle"; + return "" . htmlesc($ste->vars["current"]["article"]["title"]) . " – $pagetitle" . ""; if(isset($ste->vars["current"]["section"])) - return $ste->vars["current"]["section"]["title"] . " – $pagetitle"; - return $pagetitle; + return "" . htmlesc($ste->vars["current"]["section"]["title"]) . " – $pagetitle" . ""; + return "$pagetitle"; }); /* -- cgit v1.2.3-70-g09d2