Problem/Motivation

Search engine crawlers can use the sort links provided in views table display headers.

This may not be a desired behavior because it adds useless pages to index.

Proposed resolution

Add option per field in views table format options, if the field/column is sortable, display an additional checkbox to allow to add an attribute 'rel="nofollow"' to sort link.

OR

Force this attribute on all sortable columns during the preparation of those links.

Remaining tasks

  1. Decide of a solution
  2. Make a patch
  3. Make tests

User interface changes

Additional option in views table format options.

API changes

None.

Data model changes

Update views table format config schema.

Release notes snippet

Comments

Grimreaper created an issue. See original summary.

lendude’s picture

I'm not a fan of adding more settings to the UI, especially to the table style settings dialog which is already way too crowded.

Is this really something that you would need to control at the view level? Wouldn't it be easier to just add it to a custom views-view-table.html.twig so that it is set for all your views?

Since SEO is so bound to Google's whims, I'm loath to add something like this that could lose its relevancy quickly (@see rel=prev/next), while we would be forced to maintain it moving forward (adding stuff is easy, maintaining and removing stuff is hard).

grimreaper’s picture

Hello,

Thanks @Lendude for your feedbacks.

Yes it can be made in a custom twig template, but the idea was to have something generic and make a contribution in core so anyone can benefit from that.

I understand your concerns and if you are not ok with this feature request, no problem to close it and I will make the code in my custom project.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

grimreaper’s picture

Status: Active » Closed (duplicate)
Related issues: +#2999696: Add rel="nofollow" to table sort headers

Hello,

I guess that this issue is no more relevant due to https://www.drupal.org/node/3092185 and #2999696: Add rel="nofollow" to table sort headers.