public function category(string $navigationId, Request $request, SalesChannelContext $context): Response
    {
        if (!$navigationId) {
            throw new MissingRequestParameterException('Parameter navigationId missing');
        }

        $categories = $this->categoryRepository->search(new Criteria([$navigationId]), $context);

        if (!$categories->has($navigationId)) {
            throw new CategoryNotFoundException($navigationId);
        }

        /** @var CategoryEntity $category */
        $category = $categories->get($navigationId);

        if (!$category->getCmsPageId()) {
            throw new PageNotFoundException('');
        }

        $page = $this->load($category->getCmsPageId(), $request, $context, $category->getSlotConfig());

        return $this->renderStorefront('@Storefront/page/content/detail.html.twig', ['cmsPage' => $page]);
    }
public function category(string $navigationId, Request $request, SalesChannelContext $context): Response
    {
        if (!$navigationId) {
            throw new MissingRequestParameterException('Parameter navigationId missing');
        }

        $categories = $this->categoryRepository->search(new Criteria([$navigationId]), $context);

        if (!$categories->has($navigationId)) {
            throw new CategoryNotFoundException($navigationId);
        }

        /** @var CategoryEntity $category */
        $category = $categories->get($navigationId);

        if (!$category->getCmsPageId()) {
            throw new PageNotFoundException('');
        }

        $page = $this->load($category->getCmsPageId(), $request, $context, $category->getSlotConfig());

        return $this->renderStorefront('@Storefront/page/content/detail.html.twig', ['cmsPage' => $page]);
    }
public function category ( string $ navigationId , Request $ request , SalesChannelContext $ context ) : Response { if ( ! $ navigationId ) { throw new MissingRequestParameterException ( 'Parameter navigationId missing' ) ; } $ categories = $ this -> categoryRepository -> search ( new Criteria ( [ $ navigationId ] ) , $ context ) ; if ( ! $ categories -> has ( $ navigationId ) ) { throw new CategoryNotFoundException ( $ navigationId ) ; } /** @var CategoryEntity $category */ $ category = $ categories -> get ( $ navigationId ) ; if ( ! $ category -> getCmsPageId ( ) ) { throw new PageNotFoundException ( '' ) ; } $ page = $ this -> load ( $ category -> getCmsPageId ( ) , $ request , $ context , $ category -> getSlotConfig ( ) ) ; return $ this -> renderStorefront ( '@Storefront/page/content/detail.html.twig' , [ 'cmsPage' => $ page ] ) ; }
Route to load a cms page which assigned to the provided navigation id.
Navigation id is required to load the slot config for the navigation

@Route("/widgets/cms/navigation/{navigationId}", name="widgets.cms.navigation.page", methods={"GET", "POST"}, defaults={"navigationId"=null, "XmlHttpRequest"=true})
Route to load a cms page which assigned to the provided navigation id . Navigation id is required to load the slot config for the navigation