Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291521

Views do not add the "active" class anymore

$
0
0

Problem/Motivation

In Drupal 7, thanks to the implementation of l(), an "active" class was automatically added when generating node listing with views, and when the linked entity's URI was the same as the one listed.

With #1979468: ".active" from linkGenerator(), l() and theme_links() forces an upper limit of per-page caching for all content containing links, this is not the case any more and it's been reported to not be not easily alterable.

Proposed resolution

Re add the feature as optional, via means of adding a new checkbox form field to control whether or not the active class on links will be enabled. Adding of the actual CSS class is performed via JS.

Remaining tasks

  1. Write the patch
  2. Review it
  3. Add test coverage for the new feature.
  4. Write upgrade path to update existing views on sites.
  5. Write upgrade path test to verify it works.

User interface changes

New Set the active class on links checkbox on views field options. Description: If checked, if the fields link to the current page, an "is-active" class will be added on active links.

Views style settings

API changes

New set_active_class boolean on views.row.schema

Data model changes

N/A

Release notes snippet

Views can now optionally add the "active" css class.

Original description

In Drupal 7, thanks to the implementation of l(), an "active" class was automatically added when generating node listing with views, and when the linked entity's URI was the same as the one listed.

With #1979468: ".active" from linkGenerator(), l() and theme_links() forces an upper limit of per-page caching for all content containing links, this is not the case anymore and it seem's not easily alterable (I can't my way through).

Is there a way to change this behaviour. Are we missing something in core to let us alter that ?


Viewing all articles
Browse latest Browse all 291521

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>