ideas icon indicating copy to clipboard operation
ideas copied to clipboard

Blueprint: disable file `sort` for non-default languages

Open texnixe opened this issue 6 years ago • 3 comments

Currently, it is not easily possible to disable files section sorting in non-default languages. I can use a workaround by defining a sort field in a files blueprint like this:

  sort:
    type: hidden
    translate: false

However, this doesn't disable the sort handles and the default sort order is only restored after reloading the page in the Panel.

It would be great if the sortable property could be set conditionally:

files:
    sortable: "{{ kirby.language.isDefault }}"

This should disable the sort handles in the non-default languages.

texnixe avatar Dec 15 '19 13:12 texnixe

Are there actual use cases where we would have different sort orders between different translations? Wondering if it should not be the default to only have it sortable in the default translation.

distantnative avatar Dec 15 '19 14:12 distantnative

I don't know, maybe that should indeed be the default, however, I don't think we should completely prevent it. Because Kirby doesn't make too many assumptions..., does it?

texnixe avatar Dec 15 '19 14:12 texnixe

My current approach would be to support queries for the sortable option and make kirby.language.isDefault the default value for it.

distantnative avatar May 01 '20 13:05 distantnative