Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sitemap für einzelne Sprachen und / oder Domains #548

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,11 @@

if ('sitemap' == rex_request('rex_yrewrite_func', 'string')) {
rex_extension::register('PACKAGES_INCLUDED', static function ($params) {
$domain = rex_request('rex_yrewrite_param_domain', 'string', '');
$lang = rex_request('rex_yrewrite_param_clang', 'integer', 0);

$sitemap = new rex_yrewrite_seo();
$sitemap->sendSitemap();
$sitemap->sendSitemap($domain, $lang);
}, rex_extension::LATE);
}

Expand Down
6 changes: 3 additions & 3 deletions lib/yrewrite/seo.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public function sendRobotsTxt($domain = '')
exit;
}

public function sendSitemap($domain = '')
public function sendSitemap($domain = '', $clang = 0)
{
$domains = rex_yrewrite::getDomains();

Expand All @@ -273,7 +273,7 @@ public function sendSitemap($domain = '')

foreach (rex_yrewrite::getPathsByDomain($domain->getName()) as $article_id => $path) {
foreach ($domain->getClangs() as $clang_id) {
if (!isset($path[$clang_id]) || !rex_clang::get($clang_id)->isOnline()) {
if (!isset($path[$clang_id]) || !rex_clang::get($clang_id)->isOnline() || ($clang > 0 && $clang != $clang_id)) {
continue;
}

Expand Down Expand Up @@ -325,7 +325,7 @@ public function sendSitemap($domain = '')
}
}
}
$sitemap = rex_extension::registerPoint(new rex_extension_point('YREWRITE_DOMAIN_SITEMAP', $sitemap, ['domain' => $domain]));
$sitemap = rex_extension::registerPoint(new rex_extension_point('YREWRITE_DOMAIN_SITEMAP', $sitemap, ['domain' => $domain, 'clang' => $clang]));
}
$sitemap = rex_extension::registerPoint(new rex_extension_point('YREWRITE_SITEMAP', $sitemap));

Expand Down