Tag in title of page

This commit is contained in:
dignajar 2016-09-26 00:25:40 -03:00
parent 7c3fab8cbd
commit 185ffda5ca
2 changed files with 14 additions and 0 deletions

View File

@ -18,6 +18,15 @@ class dbTags extends dbJSON
parent::__construct(PATH_DATABASES.'tags.php');
}
public function getTag($slug) {
if( isset($this->db['postsIndex'][$slug]['name']) ) {
return $this->db['postsIndex'][$slug]['name'];
}
return '';
}
// Returns an array with all tags names
public function getAll()
{

View File

@ -59,6 +59,7 @@ class Theme {
global $Url;
global $Post, $Page;
global $Site;
global $dbTags;
$tmp = $title;
@ -70,6 +71,10 @@ class Theme {
elseif( $Url->whereAmI()=='page' ) {
$tmp = $Page->title().' - '.$Site->title();
}
elseif( $Url->whereAmI()=='tag' ) {
$tag = $dbTags->getTag($Url->slug());
$tmp = $tag.' - '.$Site->title();
}
else {
$tmp = $Site->title();
}