Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
NavigationPageLoadedEvent example
throw
new
CategoryNotFoundException
(
$category
->
getId
(
)
)
;
}
$this
->
loadMetaData
(
$category
,
$page
,
$context
->
getSalesChannel
(
)
)
;
$page
->
setNavigationId
(
$category
->
getId
(
)
)
;
if
(
$category
->
getCmsPage
(
)
)
{
$page
->
setCmsPage
(
$category
->
getCmsPage
(
)
)
;
}
$this
->eventDispatcher->
dispatch
(
new
NavigationPageLoadedEvent
(
$page
,
$context
,
$request
)
)
;
if
(
$page
->
getMetaInformation
(
)
)
{
$canonical
=
(
$navigationId
===
$context
->
getSalesChannel
(
)
->
getNavigationCategoryId
(
)
)
?
$this
->seoUrlReplacer->
generate
(
'frontend.home.page'
)
:
$this
->seoUrlReplacer->
generate
(
'frontend.navigation.page',
[
'navigationId' =>
$navigationId
]
)
;
$page
->
getMetaInformation
(
)
->
setCanonical
(
$canonical
)
;
}
return
$page
;
}