Skip to content

Commit

Permalink
The method of displaying meta tags in the admin panel has been replaced.
Browse files Browse the repository at this point in the history
  • Loading branch information
simba77 committed Sep 18, 2021
1 parent 01b730b commit c3b64ff
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
1 change: 1 addition & 0 deletions system/src/View/AdminRenderEngineFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function __invoke(ContainerInterface $container): Render
'user' => $container->get(User::class),
'tools' => $container->get(Tools::class),
'csrf_token' => $container->get(Csrf::class)->getToken(),
'metaTags' => $container->get(MetaTagManager::class),
]
);

Expand Down
33 changes: 14 additions & 19 deletions themes/admin/templates/system/layout/default.phtml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?php
/**
* @var string $locale
* @var Johncms\System\Users\User $user
* @var Johncms\Users\User $user
* @var Johncms\Counters $counters
* @var Johncms\Ads $ads
*
* @var Johncms\View\MetaTagManager $metaTags
*/

$counters = $container->get('counters');
Expand All @@ -21,32 +23,25 @@ $analytics = $counters->counters();
<meta content="yes" name="apple-mobile-web-app-capable">
<meta name="Generator" content="JohnCMS, https://johncms.com">
<?= $this->section('meta', '') ?>
<?php
if (! empty($keywords)): ?>
<meta name="keywords" content="<?= $this->e($keywords) ?>">
<?php
endif ?>
<?php
if (! empty($description)): ?>
<meta name="description" content="<?= $this->e($description) ?>">
<?php
endif ?>
<?php
if (! empty($canonical)): ?>
<link rel="canonical" href="<?= $canonical ?>">
<?php
endif ?>
<?php if (! empty($metaTags->getKeywords())): ?>
<meta name="keywords" content="<?= $this->e($metaTags->getKeywords()) ?>">
<?php endif ?>
<?php if (! empty($metaTags->getDescription())): ?>
<meta name="description" content="<?= $this->e($metaTags->getDescription()) ?>">
<?php endif ?>
<?php if (! empty($metaTags->getCanonical())): ?>
<link rel="canonical" href="<?= $metaTags->getCanonical() ?>">
<?php endif ?>
<meta name="theme-color" content="#586776">
<?php if($locale === 'ar'): ?>
<?php if ($locale === 'ar'): ?>
<link rel="stylesheet" href="<?= $this->asset('css/app.rtl.css', true) ?>">
<?php else: ?>
<link rel="stylesheet" href="<?= $this->asset('css/app.css', true) ?>">
<?php endif; ?>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700,700i&display=swap">
<link rel="shortcut icon" href="<?= $this->asset('images/favicon.ico') ?>">
<?= $this->section('styles', '') ?>
<link rel="alternate" type="application/rss+xml" title="RSS News" href="<?= $config['homeurl'] ?>/rss/">
<title><?= (isset($title) ? $this->e($title) : $config['copyright']) ?></title>
<title><?= $this->e($metaTags->getTitle()) ?></title>
</head>
<body>
<div class="wrapper min-vh-100 d-flex flex-column justify-content-between" id="app">
Expand Down
13 changes: 12 additions & 1 deletion themes/admin/templates/system/layout/guest.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/**
* @var string $locale
* @var Johncms\Counters $counters
*
* @var Johncms\View\MetaTagManager $metaTags
*/

?>
Expand All @@ -16,6 +18,15 @@
<meta content="yes" name="apple-mobile-web-app-capable">
<meta name="Generator" content="JohnCMS, https://johncms.com">
<?= $this->section('meta', '') ?>
<?php if (! empty($metaTags->getKeywords())): ?>
<meta name="keywords" content="<?= $this->e($metaTags->getKeywords()) ?>">
<?php endif ?>
<?php if (! empty($metaTags->getDescription())): ?>
<meta name="description" content="<?= $this->e($metaTags->getDescription()) ?>">
<?php endif ?>
<?php if (! empty($metaTags->getCanonical())): ?>
<link rel="canonical" href="<?= $metaTags->getCanonical() ?>">
<?php endif ?>
<meta name="theme-color" content="#586776">
<?php if ($locale === 'ar'): ?>
<link rel="stylesheet" href="<?= $this->asset('css/app.rtl.css', true) ?>">
Expand All @@ -25,7 +36,7 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700,700i&display=swap">
<link rel="shortcut icon" href="<?= $this->asset('images/favicon.ico') ?>">
<?= $this->section('styles', '') ?>
<title><?= (isset($title) ? $this->e($title) : $config['copyright']) ?></title>
<title><?= $this->e($metaTags->getTitle()) ?></title>
</head>
<body>
<div class="wrapper bg-light">
Expand Down

0 comments on commit c3b64ff

Please sign in to comment.