Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Currently views renders status, sticky as well as promoted as "On/off" by default.
Proposed resolution
Status should say "Published"/"Unpublished", promote should say "Promoted"/"Not promoted", and sticky should say "Sticky"/Not sticky.
In order to do that you can use NodeViewsData and provide default_formatter_settings for 'node_field_data][status][field' etc.
Comments
Comment #1
dawehnerComment #2
Dom. CreditAttribution: Dom. commentedFew questions :
Comment #3
dawehnerHi Dom! Well, I just think that we cannot add new entries there easily ... but I think defaulting it to the proper value using the custom option is probably the best idea at the moment.
Yeah the idea is to use the custom output formatter by default, and set it to Promote / unpromote for example by default.
in
core/modules/file/src/FileViewsData.php:63
shows how to do that.Comment #4
Dom. CreditAttribution: Dom. commentedHi ! Thanks a lot for the tips. Here is a try patch for this issue.
Comment #6
Dom. CreditAttribution: Dom. commentedWas not expecting that !!
Here is attached the fix patch (patch #4 + fix tests) and the tests-only patch (which is thus the interdiff with #4).
Comment #9
Dom. CreditAttribution: Dom. commentedComment #10
Dom. CreditAttribution: Dom. commentedRe-upload same patch.
Comment #22
smustgrave CreditAttribution: smustgrave at Mobomo commentedWondering if this is still needed in 9.5?
Would it need core maintainer review to see if we should implement?