The listing of themes in the Dropdown seems to be sorted in a bit of a random way. Ideally the themes would be sorted alphabetically.

Comments

jwilson3 created an issue. See original summary.

jwilson3’s picture

Priority: Normal » Minor
Kavya_akhil’s picture

StatusFileSize
new661 bytes

@jwilson3, Here is the patch to sort the drop down in alphabetical order

Kavya_akhil’s picture

Status: Active » Needs review
vuil’s picture

Status: Needs review » Reviewed & tested by the community
jwilson3’s picture

Hi, I think it would be much clearer for end users to have the list sorted by theme name instead of the theme key (machine name) using a natural language sort.

Need to build a multi-dimensional associative array of theme_name => theme_machine_name and then sort it with either array_multisort($array, SORT_NATURAL); or natsort(). I'm not sure how natural sorts work with associative arrays so this needs some experimentation.

jwilson3’s picture

Status: Reviewed & tested by the community » Needs work
rishabhthakur’s picture

Assigned: Unassigned » rishabhthakur
rishabhthakur’s picture

Assigned: rishabhthakur » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.07 KB
new1.13 KB

Hi @jwilson3 , Modify #3 patch for sorting theme array with labels not by theme_machine_name,
but as per code base of theme array are object and nasort, array_multisort will work on identical key, value array type.
so I have modify theme options array & then apply sorting by label, theme_name.

Please review & confirm

divya.sejekan’s picture

Assigned: Unassigned » divya.sejekan
divya.sejekan’s picture

Assigned: divya.sejekan » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new81.1 KB
new75.12 KB

Observation :
Theme list is arranged in alphabetical order.

Testing steps:
1. Install module , apply the patch
Applied patch " Alphabetical-listing-by-label-3033403-9.patch "
2. Create a new content type , with theme field
3. While creating node , check the theme field for Alphabetical ordered theme list.

jwilson3’s picture

@rishabhthakur good job — your change is exactly what I was expecting to see. Thanks. RTBC++

  • jwilson3 committed cdd5c72 on 8.x-1.x
    Issue #3033403 by rishabhthakur, Kavya_akhil, divya.sejekan, jwilson3:...
jwilson3’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.