I'm working for a project where the menu bar needs to be a dynamic menu interacting with the roles defined for the users. It works with the Symfony 3.3.
The concept should be like this: '1' user have 'n' roles and each role should see 'm' options in the menu bar. And also, different roles can have the same option menu available. So the result shouldn't show the same option twice.
I've been exploring the different kinds of menus in the list of bundles availables and no one seems to match to this idea.
I know how to do it by myself but I wonder if anyone knows if exist any bundle who have this functionality or very similar to be able to use it or modify it easily to be able to use it.
The one I saw but it's not all I need is the most used for menus but I don't think can manage the role concept. If I'm wrong tell me plx.
What you suggest to do?
Thank you very much for your help!
Follow this symfony documentation knpMenuBundle
Related
I'm learning Symfony2 and I'm trying
to find a solution for my problem ,
What's the best solution for having standard menu functionality, like in CMSes (WordPress, Drupal, )? The solution that will allow admin to edit the menu and adding images , articles , alerts .. from the back end and push it to the front end ,
The solution that will work with Sonata or some other admin bundle.
I'd say the KNP menu bundle is the closest you will get to a general purpose menu builder, it's what is already used in Sonata Admin if memory serves correct.
You'd still need to cookup an admin for the definitions and compiler for generating the menu's however.
The short answer is that, if you are needing menu builders in your solution, Symfony might not be the best bit of code to build on. Look up Symfony Content Management Framework if you're determined to use Symfony
Symfony is about putting together a custom solution
Is it possible to obtain menu items from multiple bundles with the KnpMenuBundle?
As for now I've been working with the service but that's overwritten if you declare it in multiple bundles. I read something about the custom providers https://github.com/KnpLabs/KnpMenuBundle/blob/master/Resources/doc/custom_provider.md but I'm not quite sure if that is what I'm looking for.
Just to sketch the / a situation: 2 bundles with their own menu items which need to be loaded in the same menu.
I facing the same problem. After reading in in that matter i guess using events is the way to go.
see http://symfony.com/doc/current/bundles/KnpMenuBundle/events.html for detail information.
(sorry, way to much information to provide it directly in the answer.)
I'm building a drupal site right now where I'd prefer to use views_bulk_operations to administer the standard content overview (admin/content) and user overview pages (admin/people). My trouble is that I also want to use the toolbar module (or something like it) to give my site admins the ability to easily browse to the pages generated by views_bulk_operations (admin/content2 and admin/people2). It doesn't seem possible right now. The toolbar module automatically adds pre-defined links based on a users permissions, and there doesn't appear to be a way to make any changes to those links.
Any ideas? Or, perhaps, any alternatives to the core toolbar module? Thanks!
(I asked the same question here, but thought I'd have a better chance here on stackoverflow.)
I just figured out that I can use the quickbar module to accomplish what I want.
i have this situation: i have to build a menu with datasource from the db, because i have to filter them among the user that is loged in. i have tried building a menu using repeater, and all this works fine till i realized that i wanted the menu with more than two levels. i have also tried with treeview, but i really don't want this solution (problem with the style and the treeview doesn't have a pretty view).
Could anyone give me just the idea ?
thnx in advance.
If you are securing your pages in the conventional sense (ie--using ASP.NET's builtin permissions system), you can just use the normal SiteMapProviders as they will security trim menus for you.
If you need to do custom, try making a class that implements IHeirarchicalDataSource and then bind anything appropriate (eg--ASP.BulletedList) to that.
I'm unable to display any of the User Relationships' auto-created blocks in any of my sidebars. I have tried enabling all modules and permissions I can think of, with no success. The block I'm most interested in is the block that would allow users to be invited to an existing relationship (e.g. Friend), but as I say this nor any of the other blocks display. Other Drupal blocks and custom blocks display just fine. The blocks do show up in the blocks listing, and I've tried different ways of configuring them. Any help, or even confirmation that someone has been able to do this with the latest stable versions of Drupal and the User Relationships module, would be appreciated. Thank you.
Sorry to trouble you, but I think I found the problem: me! I had the incorrect notion (actually hope) that the "add someone to a relationship" block would display without allowing users access to the overall user list. It turns out that the block does display if a user can select another user from the list of users. I'm sure I'm missing something, but this seems to me like a weakness of the User Relationships module. Would anyone know if the Friendslist module works similarly? Thanks again.