-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BreadCrumb Array with Refactored MenuItem #194
Comments
@stof Can you give me a suggestion on that? Thanks in advance. |
I have this same problem, wiith rendering by php it's easy - you can return from builder array with breadcrumbs:
but if you use twig it returns error - because builder function should return MenuItem object, @stof - how we can get it work again? |
Was this ever resolved? I'm running into similar issues. |
Unfortunatly not, I have not got any feedback from @stof. Meanwhile I have fixed it for me by fixing the versions to
Once I get some feedback I will dig into that end eventually publish some documentation about that. |
@peterrehm Instead of using this hacky constraints (hacky because the resolution will still be done usign the metadata of master but the installer will change the hash when installing from source, while the dist installation would still install the latest master), you should require the 2.0-alpha1 version for now |
well yeah, makes sense. however i would love to fix the actual problem. can you support me on that as well? |
+1 |
did anybody find a nice solution to this? |
I haven't found time to dig into the details so I disabled breadcrumbs totally for now. Once I get any feedback I will definitely have a look. |
I know this is an old post, but I figured I'd throw in my solution for those having problems. $mm = new MenuManipulator();
$item->setAttribute('bchistory', $mm->getBreadcrumbsArray($item, null)); Then, in the Twig template for your breadcrumb rendering: {% block root %}
{% if item.attributes.bchistory %}
<ol class="breadcrumb">
{% for link in item.attributes.bchistory %}
{# continue with your rendering here #} |
This is more an issue of KnpMenu, please see KnpLabs/KnpMenu#161 |
With the refactoring @stof commited yesterday to Knp/Menu the functionality I discussed earlier in here about the breadcrumb is not working any more:
Builder:
Main Template:
Rendering
So since I should use now the MenuManipulator I cannot access the breadcrumbsArray anymore directly in the template. What is the intended best way to get this issue resolved? I am still willing to discuss the best way to handle breadcrumbs and the partial route matching to
add this to the documentation since those were the difficulties for me in the past.
The text was updated successfully, but these errors were encountered: