This is a follow up of #2542742: Open for contribution?.

The attached patch aims to provide the following enhancements:

  • Consolidate admin tabs and links (manage fields / manage display) to appear where you would expect them
  • Add comments to entity--menu-fields.tpl.php
  • Allow template override also by display mode
  • Views integration: Expose some columns of the menu_links table to views
  • Views integration: Provide a contextual filter for the current menu link
  • Views integration: Provide a relationship handler for the node that a menu link refers to (only for node links)

The patch is rather big. I would have preferred to provide individual patches for the different topics but along the way I have found that they overlap quite considerably and this way was faster.

Please see what you can do with it. If absolutely necessary I will see that I split the patch up into separate chunks.

Some features that the proposed patch allows:

  • Create views of menu links with additional field data, e.g. slide shows of menu items
  • List menu links in views, dependent on the menu link of the current page, e.g. show only the child links

This is still work in progress and will probably break other menu related modules at the moment. The main intention here is to show the direction that this could take.

Comments

berliner created an issue. See original summary.

berliner’s picture

StatusFileSize
new27.71 KB
new16.7 KB

Still work in progress. This version should remove a lot of the errors of the previous patch. For easier review I have split the patch into two parts:

1. Everything related to the entity logic, description from above still applies

The generated markup has been fixed. It's now more what you would expect. So no double stacked list elements anymore. I have removed errors that arose from bugs like #1697570: _menu_load_objects() is not always called when building menu trees and refactored the entity_view logic to assure the correct attributes for the markup, e.g. the correct active and active-trail classes. This is actually functional now!

2. The views integration

I haven't change anything here for the moment, but for the sake of completeness I'll still post the patch.

I would really love to get some feedback on this.

demonde’s picture

Thanks for this great contribution. I think it improves the module a lot.

I tested the patch and it works. The improvement for the entity template is very important, because otherwise you cannot control the output sufficient.

The only part not working well yet is the views relationships.

berliner’s picture

@demonde: Thanks for the feedback! I'm currently working on the relationship issues. I'll see to post an updated patch soon.

Any feedback from the maintainers? I know the size of these patches is daunting, sorry for that. I'd be already interested in getting a thumbs up/down regarding the direction this is taking.

donutdan4114’s picture

Berliner, thanks for taking the time to submit such an intricate patch. I will try to review this soon and provide feedback.
If all is well, I don't see why we couldn't commit this.

It might be easier to keep track of everything if you create a separate issue for the Views enhancements/patch. You can reference this issue as a parent if it's dependent.
Will help us keep things more organized.

Thanks!

donutdan4114’s picture

Status: Active » Needs review

Entity enhancements have been added to the latest dev release.
I would like to get some additional feedback and ensure things are working for other users.

The last submitted patch, 2: 2557199-menu-fields-entity-enhancements-1.patch, failed testing.

The last submitted patch, 2: 2557199-menu-fields-views-integration-1.patch, failed testing.

demonde’s picture

II confirm the patch is working and tested it on a project.

donutdan4114’s picture

Status: Needs review » Fixed

Added to alpha2 release.

sgurlt’s picture

How can i print out the actually menu link within my view? I just can see my menu fields in the field list, but not the link itself.

berliner’s picture

Add "Menu fields: Menu item title" to your view and check the box saying "Link this field to the linked content". That should do it.

berliner’s picture

@donutdan4114 As requested in #5 I have created a separate issue for the views integration here: #2628876: Views integration

sgurlt’s picture

Hmm the problem is that I do not have this field in my field list, here is view.

berliner’s picture

Ok, I see. That's probably because you didn't apply the patch 2557199-menu-fields-views-integration-1.patch.

Let us switch this discussion over to #2628876: Views integration.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.