KnpLabs / KnpLabs/KnpMenu

Rendering a breadcrumb with menu in Twig

Open
#253 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
1.4k
Forks
189
PR merge metrics
No merged PRs in 30d

Description

Hi,

I am trying the render the following in twig and I wanted to get some feedback on what would make most sense.

A breadcrumb needs to be rendered and the last item (current) is a dropdown toggle which opens a list of the parents children.

What I do right now is render a custom breadcrumb and call a knp menu at the end item but it maybe the cleaner to do this all in one template? Does anyone have any recommendations of how I could do this in one template?

The menu tree:
```html
Root
|- Item 1
|- SubItem 1
|- SubItem 2
|- 2ndSubItem 1
|- 2ndSubItem 2
|- SubItem 3
|- Item 2
|- Item 3
|- Item 4
```

Output (when at SubItem 1):
```html


```

Output (when at 2ndSubItem 1):
```html


```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the Twig rendering approach described in the issue, including the menu tree and both requested HTML outputs. Determine whether KnpMenu can represent a breadcrumb whose current item opens its siblings or children, and define the desired template behavior before attempting an implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.