Problem/Motivation

The Module page (admin/modules) can get very long, with long lists of dependencies. If I search the page for "Field", I will find many modules that require the Field module (or Field SQL Storage) before I get to the entry for Field itself.

Proposed resolution

Add a page anchor, such as id="module-page-field", to the row for each module. Make each entry in a requires/required-by list a link to the appropriate anchor.

Remaining tasks

Consider changing id="module-page-<module>" to id="admin-<module>" or similar.
Consider changing drupal_clean_css_identifier() to drupal_html_class().

User interface changes

This will change the Module page (admin/modules).

API changes

None

I first suggested this change as part of #1790280: Module page redesign 2.0, but I was encouraged to open a new issue for this proposal. Now that the module page has been overhauled, we can consider this follow-up suggestion.

When jumping to the same-page anchor, the entry is partially obscured by the table header and the admin toolbar. See the screen shot in #4 and #1440628: [Meta] javascript toolbar/tableheader with url fragment mess. Based on the comment in #6, I am postponing this issue until that is resolved.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

benjifisher’s picture

Status: Active » Needs review
FileSize
95.99 KB
3.88 KB

The attached patch implements the suggestion. While we wait for #1790280: Module page redesign 2.0 to be completed and committed, perhaps this can be a candidate for back-porting to Drupal 7.x. Here is a screen shot; note that part of the row for File is obscured by the table header, and also note the URL:


benjifisher’s picture

Here is a screen shot using the Stark theme.


 module page with links

Bojhan’s picture

You really don't have to add screenshots of Stark :D.

It looks good to me, its a bit messy with all the disabled things. But we fix that in the other issue, I think this is good though.

benjifisher’s picture

I have updated the patch now that #1790280: Module page redesign 2.0 has been committed.

One problem: when you jump to an in-page anchor, the desired section is partially obscured by both the table header and the new admin toolbar. We already noticed this in the "Module Page 2.0" issue, comments #174 and #179. I will add #1440628: [Meta] javascript toolbar/tableheader with url fragment mess to the issue summary.

Screen shot (Seven theme): note the URL, that part of the "Field SQL Storage" section is obscured, and that every module in the Requires list and the Required by list is a link.


screen shot of modules page with every module name a link
I did not see any discussion of this in #1790280: Module page redesign 2.0, but I see many uses of t() that look very odd to me. For example,
          $extra['required_by'][] = t('@module (<span class="admin-disabled">disabled</span>)', array('@module' => $files[$required_by]->info['name']));

My version of this line is

          $extra['required_by'][] = '<a href="#' . $page_anchor . '" class="admin-disabled">' . t('@module', array('@module' => $files[$required_by]->info['name'])) . '</a> (<span class="admin-disabled">' . t('disabled') . '</span>)';

I will be happy to rewrite the patch to use the previous style, or to eliminate t() entirely on this line.

Note also that I add the CSS class admin-enabled or admin-disabled (as above) to the links. I do not add any CSS to make use of this, but that can be done at the theme level. The CSS rules in system.admin.css refer to span.admin-enabled and span.admin-disabled, so there should not be any problem with styling the anchors and the "(disabled)" text separately.

benjifisher’s picture

Issue summary: View changes

Added another link under "Remaining tasks".

benjifisher’s picture

I should probably use drupal_html_class() instead of drupal_clean_css_identifier().

Barnettech’s picture

Status: Needs review » Needs work

I'm seeing that if I click on "aggregator" on the extend page which shows up as a dependency for "file" it brings me toward the top of the page but as you mentioned it confusedly never shows me the aggregator module because it's obscured I think by the admin menu. This can't be approved without a fix for this.

But otherwise very cool feature folks will appreciate for sure.

Barnettech’s picture

Issue summary: View changes

Update summary now that #1790280 has been committed.

benjifisher’s picture

Status: Needs work » Postponed

If you think the problem of entries being obscured by the admin toolbar and the table header (see the screen shot in #4) is bad enough, then I think a more appropriate status is "postponed". I have noted in the issue summary that #1440628: [Meta] javascript toolbar/tableheader with url fragment mess is blocking this issue.

Barnettech’s picture

Yes I agree it would be nice to postpone approval to actually see it working nicely ... and we cannot until #1440628: [Meta] the big javascript toolbar/tableheader/overlay/fragment mess is fixed. But otherwise I think this looks like a nice addition to Drupal 8 -- from my looking at the code and testing it out. Feel free to ping me when the other is resolved and I will gladly review this one again.

Barnettech’s picture

Issue summary: View changes

Postpone this issue until the #1440628 is resolved.

TR’s picture

Status: Postponed » Closed (fixed)

This is no longer an issue in 8.x. The module page now has a search box which searches the module name, machine name, and description but NOT the dependencies. The module list is filtered by the search and only the modules matching the search are shown. Specifically, searching for "Field" brings up only a few modules, and all those are core Field modules or contrib modules which provide a field type - exactly as you would expect.

Marking this as "Closed (fixed)" because, well, it was fixed at some point...