# Frontend Controller, aber keine Kategorie-Leiste (nav-main)

**URL:** https://forum.shopware.com/t/frontend-controller-aber-keine-kategorie-leiste-nav-main/105527
**Category:** Shopware 6 (German)
**Created:** [16. Oktober 2024 um 08:04 UTC](https://forum.shopware.com/t/frontend-controller-aber-keine-kategorie-leiste-nav-main/105527 "2024-10-16T08:04:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)
#### Post date: [16. Oktober 2024 um 08:04 UTC](https://forum.shopware.com/t/frontend-controller-aber-keine-kategorie-leiste-nav-main/105527/1 "2024-10-16T08:04:46Z")

</div>

Ich habe einen Controller für Account hinzugefügt.  
Es funktioniert so wie alle anderen Account-Menus, aber nur bei diesem wird nur „Home“ aber nicht der Rest der Kategorie-Liste geladen.

Controller:

```auto
<?php declare(strict_types=1);

namespace XXXTheme\Storefront\Controller;

use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Shopware\Storefront\Controller\StorefrontController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

#[Route(defaults: ['_routeScope' => ['storefront']])]
class AccountBacklogController extends StorefrontController
{
    private EntityRepository $orderRepository;
    private EntityRepository $customerRepository;
    private EntityRepository $orderLineItemRepository; // OrderLineItemRepository hinzuf gen
    private string $allowedSalesChannelId;

    public function __construct(
        EntityRepository $orderRepository, 
        EntityRepository $customerRepository, 
        EntityRepository $orderLineItemRepository, // OrderLineItemRepository injizieren
        string $allowedSalesChannelId
    ) {
        $this->orderRepository = $orderRepository;
        $this->customerRepository = $customerRepository;
        $this->orderLineItemRepository = $orderLineItemRepository; // Zuweisung
        $this->allowedSalesChannelId = $allowedSalesChannelId;
    }

    #[Route(path: '/account/backlog', name: 'frontend.account.backlog', methods: ['GET'], defaults: ['_routeScope' => ['storefront']])]
    public function showBacklog(SalesChannelContext $context): Response
    {
        // Pr fen, ob der aktuelle SalesChannel der erlaubte ist
        if ($context->getSalesChannel()->getId() !== $this->allowedSalesChannelId) {
            throw $this->createNotFoundException('This route is not available for this sales channel.');
        }

        // Kunden-ID aus dem SalesChannelContext
        $customerId = $context->getCustomer()->getId();

        // Lade Kundendaten
        $customerCriteria = new Criteria([$customerId]);
        $customer = $this->customerRepository->search($customerCriteria, $context->getContext())->first();

        // Lade Bestellungen
        $orderCriteria = new Criteria();
        $orderCriteria->addFilter(new EqualsFilter('order.orderCustomer.customerId', $customerId));
        $orderCriteria->addAssociation('order.orderCustomer');
        $orderCriteria->addAssociation('lineItems.product');
        $orders = $this->orderRepository->search($orderCriteria, $context->getContext());

        return $this->renderStorefront('@XXXTheme/storefront/page/account/backlog.html.twig', [
            'customer' => $customer,
            'orders' => $orders
        ]);
    }
}

```

Mit Menü  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/3X/d/2/d203647ab4b57c1e6833ebbbe74eca3270b105a8.png)

Kein Menü  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/3X/b/7/b77aea7ad30fe594868b2347283f617e77ddda27.png)

Hat jemand eine Idee?  
Danke und Gruss
