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

DocumentRenderer: setCurrentSite to generate correct path of document in static page generator #16644

Merged
merged 1 commit into from May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/Document/Renderer/DocumentRenderer.php
Expand Up @@ -22,6 +22,7 @@
use Pimcore\Http\RequestHelper;
use Pimcore\Localization\LocaleServiceInterface;
use Pimcore\Model\Document;
use Pimcore\Model\Site;
use Pimcore\Routing\Dynamic\DocumentRouteHandler;
use Pimcore\Templating\Renderer\ActionRenderer;
use Pimcore\Tool;
Expand Down Expand Up @@ -92,6 +93,7 @@ public function render(Document\PageSnippet $document, array $attributes = [], a

$host = null;
if($site = Frontend::getSiteForDocument($document)) {
Site::setCurrentSite($site);
$host = $site->getMainDomain();
} elseif($systemMainDomain = Tool::getHostname()) {
$host = $systemMainDomain;
Expand Down