xref: /webtrees/resources/views/modules/sitemap/config.phtml (revision 1821c9e596679be8717c51394b448df204b1f577)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
6use Fisharebest\Webtrees\Http\RequestHandlers\ModulesAllPage;
7use Fisharebest\Webtrees\I18N;
8use Fisharebest\Webtrees\Tree;
9use Illuminate\Support\Collection;
10
11/**
12 * @var Collection<int,Tree> $all_trees
13 * @var string               $sitemap_url
14 * @var array<string,string> $submit_urls
15 * @var string               $title
16 */
17
18?>
19
20<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ModulesAllPage::class) => I18N::translate('Modules'), $title]]) ?>
21
22<h1><?= $title ?></h1>
23
24<p>
25    <?= /* I18N: The www.sitemaps.org site is translated into many languages (e.g. https://www.sitemaps.org/fr/) - choose an appropriate URL. */ I18N::translate('Sitemaps are a way for webmasters to tell search engines about the pages on a website that are available for crawling. All major search engines support sitemaps. For more information, see <a href="https://www.sitemaps.org/">www.sitemaps.org</a>.') ?>
26</p>
27
28<p>
29    <?= /* I18N: Label for a configuration option */ I18N::translate('Which family trees should be included in the sitemaps') ?>
30</p>
31
32<form method="post" action="<?= e(route('module', ['module' => 'sitemap', 'action' => 'Admin'])) ?>">
33    <?php foreach ($all_trees as $tree) : ?>
34        <?= view('components/checkbox', ['label' => e($tree->title()), 'name' => 'sitemap' . $tree->id(), 'checked' => (bool) $tree->getPreference('include_in_sitemap')]) ?>
35    <?php endforeach ?>
36
37    <button type="submit" class="btn btn-primary">
38        <?= I18N::translate('save') ?>
39    </button>
40
41    <?= csrf_field() ?>
42</form>
43
44<hr>
45
46<p>
47    <?= I18N::translate('URL') ?> — <a href="<?= e($sitemap_url) ?>"><?= e($sitemap_url) ?></a>
48</p>
49
50<p>
51    <?= I18N::translate('To tell search engines that sitemaps are available, you can use the following links.') ?>
52</p>
53
54<ul>
55    <?php foreach ($submit_urls as $search_engine => $url) : ?>
56    <li>
57        <a href="<?= e($url) ?>">
58            <?= e($search_engine) ?>
59        </a>
60    </li>
61    <?php endforeach ?>
62</ul>
63