Make subject page work count a link to search results #6176
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This minor change addresses the underlying complaint in issue #2375 — that the subject page is a dead-end from which it isn't possible to get to a list of all the works that match the subject (/time/place/person/etc), which is kind of what you expect the subject page to do. I'll let someone else decide whether it actually closes the issue.
Technical
This fix adds a link to the text "N works" next to the subject title; the link performs a work search for that subject.
I would have liked to have formed the search URL based on the subject term slug in the page URL, but that value isn't trivially available in the environment, so I copied the behavior elsewhere on the template of using a minimally-encoded page name string.
Testing
Visit a variety of subject pages and see if the search link works as expected.
Stakeholders
@mheiman @mekarpeles
Attribution Disclaimer: By proposing this pull request, I affirm to have made a best-effort and exercised my discretion to make sure relevant sections of this code which substantially leverage code suggestions, code generation, or code snippets from sources (e.g. Stack Overflow, GitHub) have been annotated with basic attribution so reviewers & contributors may have confidence and access to the correct context to evaluate and use this code.