mirror of
https://github.com/jbcr/core.git
synced 2026-03-30 04:42:25 +02:00
Merge pull request #1866 from bolt/feature/homepage-without-record
Configure homepage without a record or listing
This commit is contained in:
@@ -22,6 +22,12 @@ class HomepageController extends TwigAwareController implements FrontendZoneInte
|
||||
public function homepage(ContentRepository $contentRepository): Response
|
||||
{
|
||||
$homepage = $this->config->get('theme/homepage') ?: $this->config->get('general/homepage');
|
||||
$templates = $this->templateChooser->forHomepage();
|
||||
|
||||
if ($homepage === null) {
|
||||
return $this->render($templates);
|
||||
}
|
||||
|
||||
$homepageTokens = explode('/', $homepage);
|
||||
$contentType = $this->config->get('contenttypes/' . $homepageTokens[0]);
|
||||
|
||||
@@ -47,8 +53,6 @@ class HomepageController extends TwigAwareController implements FrontendZoneInte
|
||||
$record = $contentRepository->findOneBy(['contentType' => $homepageTokens[0]]);
|
||||
}
|
||||
|
||||
$templates = $this->templateChooser->forHomepage();
|
||||
|
||||
return $this->renderSingle($record, false, $templates);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user