Only works if view is built off content

Created on 3 June 2022, about 2 years ago
Updated 14 July 2023, 12 months ago

Problem/Motivation

If the view is built off block type natural sort doesn't seem to apply

✨ Feature request
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States smustgrave

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States generalredneck

    I'm pretty sure this is working as expected.

    Any of the following fields are valid candidates:

    Given that, You are more than welcome to add support to suite your needs. To get it working, you just need to implement a couple of hooks. Specifically you could do something like what's mentioned in views_natural_sort.api.php and do

    function custom_views_natural_sort_supported_properties_alter(array &$supported_properties) {
      // Allow the vns_field value to be naturally sorted.
      $supported_properties['block_content']['type'] = [
        'base_table' => 'block_content_field_data',
        'schema_field' => 'type',
      ];
    }
    

    This should allow to override that behavior.

Production build 0.69.0 2024