Closed (fixed)
Project:
Theme Field
Version:
8.x-1.x-dev
Component:
User interface
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Feb 2019 at 18:16 UTC
Updated:
17 Jul 2020 at 18:59 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jwilson3Comment #3
Kavya_akhil commented@jwilson3, Here is the patch to sort the drop down in alphabetical order
Comment #4
Kavya_akhil commentedComment #5
vuilComment #6
jwilson3Hi, 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);ornatsort(). I'm not sure how natural sorts work with associative arrays so this needs some experimentation.Comment #7
jwilson3Comment #8
rishabhthakur commentedComment #9
rishabhthakur commentedHi @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
Comment #10
divya.sejekan commentedComment #11
divya.sejekan commentedObservation :
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.
Comment #12
jwilson3@rishabhthakur good job — your change is exactly what I was expecting to see. Thanks. RTBC++
Comment #14
jwilson3