diff options
-rw-r--r-- | application/front/controller/visitor/ShaarliVisitorController.php | 4 | ||||
-rw-r--r-- | tests/front/controller/visitor/ShaarliVisitorControllerTest.php | 3 | ||||
-rw-r--r-- | tpl/default/includes.html | 2 | ||||
-rw-r--r-- | tpl/vintage/includes.html | 2 |
4 files changed, 9 insertions, 2 deletions
diff --git a/application/front/controller/visitor/ShaarliVisitorController.php b/application/front/controller/visitor/ShaarliVisitorController.php index ae946c59..d3f28f2f 100644 --- a/application/front/controller/visitor/ShaarliVisitorController.php +++ b/application/front/controller/visitor/ShaarliVisitorController.php | |||
@@ -56,6 +56,10 @@ abstract class ShaarliVisitorController | |||
56 | 56 | ||
57 | protected function render(string $template): string | 57 | protected function render(string $template): string |
58 | { | 58 | { |
59 | // Legacy key that used to be injected by PluginManager | ||
60 | $this->assignView('_PAGE_', $template); | ||
61 | $this->assignView('template', $template); | ||
62 | |||
59 | $this->assignView('linkcount', $this->container->bookmarkService->count(BookmarkFilter::$ALL)); | 63 | $this->assignView('linkcount', $this->container->bookmarkService->count(BookmarkFilter::$ALL)); |
60 | $this->assignView('privateLinkcount', $this->container->bookmarkService->count(BookmarkFilter::$PRIVATE)); | 64 | $this->assignView('privateLinkcount', $this->container->bookmarkService->count(BookmarkFilter::$PRIVATE)); |
61 | 65 | ||
diff --git a/tests/front/controller/visitor/ShaarliVisitorControllerTest.php b/tests/front/controller/visitor/ShaarliVisitorControllerTest.php index 935ec24e..7676f14d 100644 --- a/tests/front/controller/visitor/ShaarliVisitorControllerTest.php +++ b/tests/front/controller/visitor/ShaarliVisitorControllerTest.php | |||
@@ -93,6 +93,9 @@ class ShaarliVisitorControllerTest extends TestCase | |||
93 | 93 | ||
94 | static::assertSame('templateName', $render); | 94 | static::assertSame('templateName', $render); |
95 | 95 | ||
96 | static::assertSame('templateName', $this->assignedValues['_PAGE_']); | ||
97 | static::assertSame('templateName', $this->assignedValues['template']); | ||
98 | |||
96 | static::assertSame(10, $this->assignedValues['linkcount']); | 99 | static::assertSame(10, $this->assignedValues['linkcount']); |
97 | static::assertSame(5, $this->assignedValues['privateLinkcount']); | 100 | static::assertSame(5, $this->assignedValues['privateLinkcount']); |
98 | static::assertSame(['error'], $this->assignedValues['plugin_errors']); | 101 | static::assertSame(['error'], $this->assignedValues['plugin_errors']); |
diff --git a/tpl/default/includes.html b/tpl/default/includes.html index 3e3fb664..6be2a2ea 100644 --- a/tpl/default/includes.html +++ b/tpl/default/includes.html | |||
@@ -19,7 +19,7 @@ | |||
19 | {/if} | 19 | {/if} |
20 | <link rel="search" type="application/opensearchdescription+xml" href="{$base_path}/open-search#" | 20 | <link rel="search" type="application/opensearchdescription+xml" href="{$base_path}/open-search#" |
21 | title="Shaarli search - {$shaarlititle}" /> | 21 | title="Shaarli search - {$shaarlititle}" /> |
22 | {if="! empty($links) && count($links) === 1"} | 22 | {if="$template === 'linklist' && ! empty($links) && count($links) === 1"} |
23 | {$link=reset($links)} | 23 | {$link=reset($links)} |
24 | <meta property="og:title" content="{$link.title}" /> | 24 | <meta property="og:title" content="{$link.title}" /> |
25 | <meta property="og:type" content="article" /> | 25 | <meta property="og:type" content="article" /> |
diff --git a/tpl/vintage/includes.html b/tpl/vintage/includes.html index 2ce9da42..4fd78467 100644 --- a/tpl/vintage/includes.html +++ b/tpl/vintage/includes.html | |||
@@ -16,7 +16,7 @@ | |||
16 | {if="is_file('data/user.css')"}<link type="text/css" rel="stylesheet" href="{$base_path}/data/user.css#" />{/if} | 16 | {if="is_file('data/user.css')"}<link type="text/css" rel="stylesheet" href="{$base_path}/data/user.css#" />{/if} |
17 | <link rel="search" type="application/opensearchdescription+xml" href="{$base_path}/open-search#" | 17 | <link rel="search" type="application/opensearchdescription+xml" href="{$base_path}/open-search#" |
18 | title="Shaarli search - {$shaarlititle|htmlspecialchars}" /> | 18 | title="Shaarli search - {$shaarlititle|htmlspecialchars}" /> |
19 | {if="! empty($links) && count($links) === 1"} | 19 | {if="$template === 'linklist' && ! empty($links) && count($links) === 1"} |
20 | {$link=reset($links)} | 20 | {$link=reset($links)} |
21 | <meta property="og:title" content="{$link.title}" /> | 21 | <meta property="og:title" content="{$link.title}" /> |
22 | <meta property="og:type" content="article" /> | 22 | <meta property="og:type" content="article" /> |