Tag in title of page
This commit is contained in:
parent
7c3fab8cbd
commit
185ffda5ca
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue