Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
Improved page app meta + pageID is now available as a smarty variable
Browse files Browse the repository at this point in the history
  • Loading branch information
kolaente committed Mar 27, 2018
1 parent a9810e8 commit 0f5c7cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions apps/SimplePages/front/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
$page->setResponseCode(200);
$page->setTitle($db->data[0]['title']);
$meta = '';
$meta = [];

//gucken ob das was auszuführren ist
$pos = strpos($db->data[0]['content'], 'EXEC ');
Expand All @@ -22,21 +22,19 @@
} else
{
$page->setContent($db->data[0]['content']);

//Meta
if(isset($db->data[0]['meta_description']) && $db->data[0]['meta_description'] != '') $meta .= ' <meta name="description" content="' . $db->data[0]['meta_description'] . '">' . "\n";
if(isset($db->data[0]['meta_keywords']) && $db->data[0]['meta_keywords'] != '') $meta .= ' <meta name="keywords" content="' . $db->data[0]['meta_keywords'] . '">' . "\n";
}
}
else
{
$page->setContent($db->data[0]['content']);

//Meta
if(isset($db->data[0]['meta_description']) && $db->data[0]['meta_description'] != '') $meta .= ' <meta name="description" content="' . $db->data[0]['meta_description'] . '">' . "\n";
if(isset($db->data[0]['meta_keywords']) && $db->data[0]['meta_keywords'] != '') $meta .= ' <meta name="keywords" content="' . $db->data[0]['meta_keywords'] . '">' . "\n";
}

//Meta
if(isset($db->data[0]['meta_description']) && $db->data[0]['meta_description'] != '')
$meta['description'] = $db->data[0]['meta_description'];
if(isset($db->data[0]['meta_keywords']) && $db->data[0]['meta_keywords'] != '')
$meta['keywords'] = $db->data[0]['meta_keywords'];
$page->assign('meta', $meta, true);
$page->assign('pageID', $db->data[0]['id']);
}
}
Empty file modified content/.system/construction2.txt
100755 → 100644
Empty file.

0 comments on commit 0f5c7cc

Please sign in to comment.