-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort special characters #4
Comments
You have to change the line https://github.com/Daniel-KM/Reference/blob/master/views/helpers/Reference.php#L287 with " utf8_roman_ci" (or add an option to manage it cleanly). |
It doesn't seem to work. I get the same list order. |
So you can sort the resulting array via php just after that. |
Hi @Daniel-KM, thank you so much for your tool. We find it very useful! Also, we don't quite understand what you mean by: "or add an option to manage it cleanly" nor with " you can sort the resulting array via php just after that" Thanks in advance for any help you could provide us :) |
The file to edit is the view one : https://github.com/Daniel-KM/Omeka-plugin-Reference/blob/master/views/public/common/reference-list.php. It's hard to resolve, because it's a mix of locale format of the server, of the database and of php. |
MySQL should be handling this sorting fine, whether under the default Omeka collation of utf8_unicode_ci or with utf8_general_ci. I think the issue here is actually happening because of the PHP-side "re-sorting" that happens when the $collator = new Collator('root');
uksort($references, array($collator, 'compare')); But, this would also require a change in the logic for generating headings: it will currently "see" the change from A to Á (and back again to A if the accented word appears in the middle of the list) and output extra headings. |
Thanks, I'll give it a try. |
Hi all, I solve the problem. First, Comment this line: https://github.com/Daniel-KM/Omeka-plugin-Reference/blob/master/views/helpers/Reference.php#L128 Because natcasesort does not support diacritics. Second add this function on top of https://github.com/Daniel-KM/Omeka-plugin-Reference/blob/master/views/public/common/reference-list.php
Third apply this function in reference-list.php in lines 22 & 60, as follows:
Fourth step... enjoy!!! |
Sorry, @rodyoukai, but I've tried your method and don't see any change. |
This solution works very well for me, thanks. I've also changed the headings functions, like this:
Similarly, then, for the references list. |
I've amended my fork, with a config option to add a custom alphabet to be used for skip links headers:
|
Hi Daniel,
Is there a way to sort correctly special characters in a list via the helper reference() ? For example, I have this list (excerpt) :
But I expect this order :
Thanks ! Your plugin is very wonderful.
The text was updated successfully, but these errors were encountered: