diff options
author | Kevin Chabowski <kevin@kch42.de> | 2012-01-08 16:25:46 +0100 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2012-01-08 16:25:46 +0100 |
commit | 8582fb2a50c268d84e0726457cad83320eb52c7c (patch) | |
tree | 6fac6c787dd417ba17202fcc01ae7f4c1b1c634d /ratatoeskr | |
parent | 5fc635f7bba37e47054faa2ecc2cc246d7d16f6a (diff) | |
download | ratatoeskr-cms-8582fb2a50c268d84e0726457cad83320eb52c7c.tar.gz ratatoeskr-cms-8582fb2a50c268d84e0726457cad83320eb52c7c.tar.bz2 ratatoeskr-cms-8582fb2a50c268d84e0726457cad83320eb52c7c.zip |
Changed ste:title behaviour and added docu for it.
Diffstat (limited to 'ratatoeskr')
-rw-r--r-- | ratatoeskr/frontend.php | 16 |
1 files 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 "<title>" . htmlesc($ste->vars["current"]["article"]["title"]) . " – $pagetitle" . "</title>"; if(isset($ste->vars["current"]["section"])) - return $ste->vars["current"]["section"]["title"] . " – $pagetitle"; - return $pagetitle; + return "<title>" . htmlesc($ste->vars["current"]["section"]["title"]) . " – $pagetitle" . "</title>"; + return "<title>$pagetitle</title>"; }); /* |