-
AuthorPosts
-
Mr.Cat
Moderator
Mr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
October 13, 2017 at 1:34 am #1067640In latest version, we already support sort by custom field, you can check at demo
Regards
Wisdom is not a product of schooling but of the lifelong attempt to acquire it.
kroenerdesign Friend
kroenerdesign
- Join date:
- September 2014
- Posts:
- 28
- Downloads:
- 3
- Uploads:
- 2
- Thanked:
- 2 times in 2 posts
October 13, 2017 at 4:17 pm #1067811This reply has been marked as private.
Mr.Cat
Moderator
Mr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
October 16, 2017 at 2:43 am #1068032Yes, it’s possible with latest version. But you’re using old version so let me try on your site.
Please provide me the admin info in private reply
Regards
Wisdom is not a product of schooling but of the lifelong attempt to acquire it.
kroenerdesign Friend
kroenerdesign
- Join date:
- September 2014
- Posts:
- 28
- Downloads:
- 3
- Uploads:
- 2
- Thanked:
- 2 times in 2 posts
October 16, 2017 at 7:38 am #1068071This reply has been marked as private.
Mr.Cat
Moderator
Mr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
October 16, 2017 at 9:29 am #1068103I can’t access to your admin site. Please check the login info
Regards
P.S: Correct me if i’m wrong. You want default sort is "by alphabet", but after doing any filter, the sorting will change to "by a custom field". And after reset filter, the sorting will back to "by alphabet" ?
If it’s true, i think megafilter doesn’t support workflow like that.
-
This reply was modified 7 years, 3 months ago by
Mr.Cat.
Wisdom is not a product of schooling but of the lifelong attempt to acquire it.
kroenerdesign Friend
kroenerdesign
- Join date:
- September 2014
- Posts:
- 28
- Downloads:
- 3
- Uploads:
- 2
- Thanked:
- 2 times in 2 posts
October 17, 2017 at 6:49 am #1068307This reply has been marked as private.
Mr.Cat
Moderator
Mr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
October 17, 2017 at 9:10 am #1068337Yes, it’s clear now. You can made it by open file
/components/com_jamegafilter/assets/js/megafilter.jsReplace this block code
var t1 = self.getItem(a).getField('id'), t2 = self.getItem(b).getField('id'); return t1 > t2 ? d : -d;with this
var t1 = self.getItem(a).getField('name'), t2 = self.getItem(b).getField('name'); return t1 > t2 ? -d : d;I already change on your site. Please check https://dev.netplans.de/businesscloud#sort=attr.ct2.frontend_value&themen=6&page=1
Wisdom is not a product of schooling but of the lifelong attempt to acquire it.
kroenerdesign Friend
kroenerdesign
- Join date:
- September 2014
- Posts:
- 28
- Downloads:
- 3
- Uploads:
- 2
- Thanked:
- 2 times in 2 posts
October 17, 2017 at 9:29 am #1068343Yeehaaa! Looks good. Thank you very much for your efforts.
One question: You must have done this by uploading a file through the jooma installer, correct?
–> Will your modification be overwritten when we update the megafilter component or plugin?
Mr.Cat
Moderator
Mr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
October 17, 2017 at 9:37 am #1068345Yes, the changes will be lost when you update component. So please back up.
Regards
Wisdom is not a product of schooling but of the lifelong attempt to acquire it.
kroenerdesign Friend
kroenerdesign
- Join date:
- September 2014
- Posts:
- 28
- Downloads:
- 3
- Uploads:
- 2
- Thanked:
- 2 times in 2 posts
October 18, 2017 at 8:27 am #1068555Our client want still a little change.
Now we have a field named "Filter". And this I set to sort. But it sorts by name. It would be better if we could sort by rawvalue. For example: the field has the options:
- Netplans Cloud – value 1
- Microsoft Cloud – value 2
- Netplans Service – value 3
Now we sort DESc, so first it shows value 3, then 1, then 2 (because of the names). It is possible to sort like 1,2,3?
So it would be fine, if the first order is by value and then alphabetically. Is it possible? Can you send me a fix? In the sidebar we had just done this.
Thank you very much.
Mr.Cat
Moderator
Mr.Cat
- Join date:
- December 2016
- Posts:
- 270
- Downloads:
- 24
- Uploads:
- 69
- Thanks:
- 58
- Thanked:
- 53 times in 50 posts
October 18, 2017 at 9:31 am #1068579My account on your site is blocked, so these codes haven’t be tested on your site.
Open file
/components/com_jamegafilter/views/default/view.html.phpReplace
'frontend_field' => str_replace('.value', '.frontend_value', $filter->field));With
'frontend_field' =>$filter->field;Replace
$config->default_sort = str_replace('.value', '.frontend_value', $default_sort);With
$config->default_sort = $default_sort;Open file
/plugins/jamegafilter/content/tmpl/default.phpReplace
UBLNConfig.sortByOptions = <?php echo str_replace('.value','.frontend_value',json_encode($this->config->sorts)); ?>;With
UBLNConfig.sortByOptions = <?php echo json_encode($this->config->sorts); ?>;-
This reply was modified 7 years, 3 months ago by
Mr.Cat.
Wisdom is not a product of schooling but of the lifelong attempt to acquire it.
kroenerdesign Friend
kroenerdesign
- Join date:
- September 2014
- Posts:
- 28
- Downloads:
- 3
- Uploads:
- 2
- Thanked:
- 2 times in 2 posts
-
AuthorPosts
This topic contains 12 replies, has 2 voices, and was last updated by kroenerdesign 7 years, 3 months ago.
The topic ‘Sort items’ is closed to new replies.