-
AuthorPosts
-
ilet Friend
ilet
- Join date:
- February 2009
- Posts:
- 25
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 2
- Thanked:
- 5 times in 1 posts
November 2, 2015 at 12:04 am #720875Couple questions
1. I loved the old K2 search module how I could order by increase or decreased as default. How can I do this with the new update? I don’t want the user to choose. ex. I’m ranking items. 10 being the highest. I want to order an extrafield called “ranking” to start with the highest to lowest (which is decrease, but increase is default). but then I have another field where I want the opposite.
2. numeric ordering doesn’t seem to be working. can you check my site. I’m not sure if I set it up correctly.
I saw another post about fixing ordering method, but that doesn’t solve my problem.
3. is it possible to rename “increase” “decrease” per extrafield. I want one to say “Best” “least” and another “Highest” “lowest”
Luna Garden ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
November 3, 2015 at 5:01 am #721184Hi,
Thanks for your feedback, here is my answer, hope that it could help you.
<blockquote>1. I loved the old K2 search module how I could order by increase or decreased as default. How can I do this with the new update? I don’t want the user to choose. ex. I’m ranking items. 10 being the highest. I want to order an extrafield called “ranking” to start with the highest to lowest (which is decrease, but increase is default). but then I have another field where I want the opposite.</blockquote>
Because of Increase and Decrease of one field make the order list seem too long, so we improve the order list, make it easy to use. I’ll discuss with the developer if we could make the default order to ASC or DESC base on one each field<blockquote>2. numeric ordering doesn’t seem to be working. can you check my site. I’m not sure if I set it up correctly.</blockquote>
It seems only order by Ranking isn’t correct, cause you insert ‘.’ (dot) to this extra field, so you must set the Type is String, not Numberic. Order numberic only works with number type Interger<blockquote>3. is it possible to rename “increase” “decrease” per extrafield. I want one to say “Best” “least” and another “Highest” “lowest” </blockquote>
It’s impossible, you can only change all field to the same Name, you can not specified them. In order to change name, go to file: languageen-GBen-GB.mod_jak2filter.ini find for:
JAK2DESC = "Decrease";
JAK2ASC = "Increase";
Change as you wantLuna Garden ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
November 3, 2015 at 5:01 am #721204Hi,
Thanks for your feedback, here is my answer, hope that it could help you.
<blockquote>1. I loved the old K2 search module how I could order by increase or decreased as default. How can I do this with the new update? I don’t want the user to choose. ex. I’m ranking items. 10 being the highest. I want to order an extrafield called “ranking” to start with the highest to lowest (which is decrease, but increase is default). but then I have another field where I want the opposite.</blockquote>
Because of Increase and Decrease of one field make the order list seem too long, so we improve the order list, make it easy to use. I’ll discuss with the developer if we could make the default order to ASC or DESC based on each field<blockquote>2. numeric ordering doesn’t seem to be working. can you check my site. I’m not sure if I set it up correctly.</blockquote>
It seems only order by Ranking isn’t correct, cause you insert ‘.’ (dot) to this extra field, so you must set the Type is String, not Numberic. Order numberic only works with number type Interger<blockquote>3. is it possible to rename “increase” “decrease” per extrafield. I want one to say “Best” “least” and another “Highest” “lowest” </blockquote>
It’s impossible, you can only change all field to the same Name, you can not specified them. In order to change name, go to file: languageen-GBen-GB.mod_jak2filter.ini find for:
JAK2DESC = "Decrease";
JAK2ASC = "Increase";
Change as you wantLuna Garden ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
November 3, 2015 at 5:01 am #753586Hi,
Thanks for your feedback, here is my answer, hope that it could help you.
<blockquote>1. I loved the old K2 search module how I could order by increase or decreased as default. How can I do this with the new update? I don’t want the user to choose. ex. I’m ranking items. 10 being the highest. I want to order an extrafield called “ranking” to start with the highest to lowest (which is decrease, but increase is default). but then I have another field where I want the opposite.</blockquote>
Because of Increase and Decrease of one field make the order list seem too long, so we improve the order list, make it easy to use. I’ll discuss with the developer if we could make the default order to ASC or DESC based on each field<blockquote>2. numeric ordering doesn’t seem to be working. can you check my site. I’m not sure if I set it up correctly.</blockquote>
It seems only order by Ranking isn’t correct, cause you insert ‘.’ (dot) to this extra field, so you must set the Type is String, not Numberic. Order numberic only works with number type Interger<blockquote>3. is it possible to rename “increase” “decrease” per extrafield. I want one to say “Best” “least” and another “Highest” “lowest” </blockquote>
It’s impossible, you can only change all field to the same Name, you can not specified them. In order to change name, go to file: languageen-GBen-GB.mod_jak2filter.ini find for:
JAK2DESC = "Decrease";
JAK2ASC = "Increase";
Change as you wantilet Friendilet
- Join date:
- February 2009
- Posts:
- 25
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 2
- Thanked:
- 5 times in 1 posts
November 4, 2015 at 5:16 am #721362another question. K2 does not have a numeric field. In order to get commas correctly in the front-end I have to input commas in the back-end value. this breaks k2 filter. Is there a work around where I can have both K2 and K2 filter show commas and decimals in the front-end? Currently I have it likes this: K2 extrafield : 2000 => front displays 2000 (no comma)– in order to get k2 filter to work.
ilet Friendilet
- Join date:
- February 2009
- Posts:
- 25
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 2
- Thanked:
- 5 times in 1 posts
November 4, 2015 at 5:16 am #753697another question. K2 does not have a numeric field. In order to get commas correctly in the front-end I have to input commas in the back-end value. this breaks k2 filter. Is there a work around where I can have both K2 and K2 filter show commas and decimals in the front-end? Currently I have it likes this: K2 extrafield : 2000 => front displays 2000 (no comma)– in order to get k2 filter to work.
Luna Garden ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
November 5, 2015 at 10:04 am #721563Hi,
My mistake, I have discussed with the developer again and he has confirmed that JA K2 Filter can order with Numberic that has commas like decimals. Please set Extra Field Data Type of Extra Field back to Numberic (if you set it to Alphabet to make Order works with decimals)
At this time, JA k2 Filter get this error, please apply the fix to JA K2 Filter on your site: http://www.joomlart.com/forums/topic/jak2filter-ordering-not-working/#post-706156 Maybe this is the reason the filter doesn’t show the right order on your site.
We’ll add this fix in next version.
Luna Garden ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
November 5, 2015 at 10:04 am #753810Hi,
My mistake, I have discussed with the developer again and he has confirmed that JA K2 Filter can order with Numberic that has commas like decimals. Please set Extra Field Data Type of Extra Field back to Numberic (if you set it to Alphabet to make Order works with decimals)
At this time, JA k2 Filter get this error, please apply the fix to JA K2 Filter on your site: http://id.joomlart.com/forums/topic/jak2filter-ordering-not-working/#post-706156 Maybe this is the reason the filter doesn’t show the right order on your site.
We’ll add this fix in next version.
ilet Friendilet
- Join date:
- February 2009
- Posts:
- 25
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 2
- Thanked:
- 5 times in 1 posts
November 11, 2015 at 7:30 pm #723867Hi, Is there a way to make the decrease radio input default? I have a field called popular based on a number, and I want to an option to sort by popularity. The bigger the number the higher the rank, so I want it decrease by default. Thanks.
ilet Friendilet
- Join date:
- February 2009
- Posts:
- 25
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 2
- Thanked:
- 5 times in 1 posts
November 11, 2015 at 7:30 pm #754312Hi, Is there a way to make the decrease radio input default? I have a field called popular based on a number, and I want to an option to sort by popularity. The bigger the number the higher the rank, so I want it decrease by default. Thanks.
Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
November 12, 2015 at 7:52 am #723926Hi ilet.
You can try this:
edit the file : /modules/mod_jak2filter/tmpl/default.php
line : 359-381
change
if (!jQuery('#jak2filter<?php echo $module->id;?>').find('li').length) {
jQuery(this).parent('li').after(
'
<li class="fssorts" data-of="' + jQuery(this).val() + '"> ' +
'<div class="title"><h6>' + jQuery(this).find('option:selected').html() + '</h6></div>' +
' '
+ (jQuery.inArray(jQuery(this).val(), ['zelevance', 'best', 'modified', 'publishUp']) === -1 ? '
<div class="group-controls">
<div class="controls">
<input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="" name="orders[' + jQuery(this).val() + ']" value="' + jQuery(this).val() + '" /><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p>
</div>
<div class="controls">
<input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p>
</div>
</div>
' : '' +
'<div class="group-controls"><div class="controls"><input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="checked" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div></div>')
+ '
<div class="controls"><button class="delete" onclick="jQuery(this).parents('li').remove();<?php if($auto_filter || $ajax_filter): ?>jQuery('#<?php echo $formid; ?>').submit();<?php endif; ?>"><?php echo JText::_("JAK2DELETE"); ?></button></div>
</li>
');
}
To
if (!jQuery('#jak2filter<?php echo $module->id;?>').find('li').length) {
checkeddesc='';
checkedasc=' checked="" ';
if (jQuery(this).val().search('xf') !== -1) {
checkeddesc=' checked="" ';
checkedasc='';
}
jQuery(this).parent('li').after(
'
<li class="fssorts" data-of="' + jQuery(this).val() + '"> ' +
'<div class="title"><h6>' + jQuery(this).find('option:selected').html() + '</h6></div>' +
' '
+ (jQuery.inArray(jQuery(this).val(), ['zelevance', 'best', 'modified', 'publishUp']) === -1 ? '
<div class="group-controls">
<div class="controls">
<input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" '+checkedasc+' name="orders[' + jQuery(this).val() + ']" value="' + jQuery(this).val() + '" /><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p>
</div>
<div class="controls">
<input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" '+checkeddesc+' name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p>
</div>
</div>
' : '' +
'<div class="group-controls"><div class="controls"><input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="checked" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div></div>')
+ '
<div class="controls"><button class="delete" onclick="jQuery(this).parents('li').remove();<?php if($auto_filter || $ajax_filter): ?>jQuery('#<?php echo $formid; ?>').submit();<?php endif; ?>"><?php echo JText::_("JAK2DELETE"); ?></button></div>
</li>
');
}Focus on this code :
checkeddesc='';
checkedasc=' checked="" ';
if (jQuery(this).val().search('xf') !== -1) {
checkeddesc=' checked="" ';
checkedasc='';
}——————————————————————————————————
if you want all the field had descending order change to this :
checkeddesc=' checked="" ';
checkedasc='';——————————————————————————————————
if you want some field has descending order only:
You just need to edit the line
if (jQuery(this).val().search('xf') !== -1) {
for example
if (jQuery(this).val().search('xf') !== -1) {
This mean all the extra field will had descending order.
if you want some extra field not all.
change to
if (jQuery(this).val().search('xf1|xf2|xf3|xf4') !== -1) {
1,2,3,4… mean id of extra field. you can find in administratorjust add more field like that.
It’s a littble bit tricky.
If you find it’s difficult. you can pm me ftp account so i can edit for you.Regards.
BigHug FriendBigHug
- Join date:
- September 2012
- Posts:
- 60
- Downloads:
- 17
- Uploads:
- 277
- Thanked:
- 11 times in 1 posts
November 12, 2015 at 7:52 am #754367Hi ilet.
You can try this:
edit the file : /modules/mod_jak2filter/tmpl/default.php
line : 359-381
change
if (!jQuery('#jak2filter<?php echo $module->id;?>').find('li').length) {
jQuery(this).parent('li').after(
'
<li class="fssorts" data-of="' + jQuery(this).val() + '"> ' +
'<div class="title"><h6>' + jQuery(this).find('option:selected').html() + '</h6></div>' +
' '
+ (jQuery.inArray(jQuery(this).val(), ['zelevance', 'best', 'modified', 'publishUp']) === -1 ? '
<div class="group-controls">
<div class="controls">
<input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="" name="orders[' + jQuery(this).val() + ']" value="' + jQuery(this).val() + '" /><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p>
</div>
<div class="controls">
<input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p>
</div>
</div>
' : '' +
'<div class="group-controls"><div class="controls"><input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="checked" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div></div>')
+ '
<div class="controls"><button class="delete" onclick="jQuery(this).parents('li').remove();<?php if($auto_filter || $ajax_filter): ?>jQuery('#<?php echo $formid; ?>').submit();<?php endif; ?>"><?php echo JText::_("JAK2DELETE"); ?></button></div>
</li>
');
}
To
if (!jQuery('#jak2filter<?php echo $module->id;?>').find('li').length) {
checkeddesc='';
checkedasc=' checked="" ';
if (jQuery(this).val().search('xf') !== -1) {
checkeddesc=' checked="" ';
checkedasc='';
}
jQuery(this).parent('li').after(
'
<li class="fssorts" data-of="' + jQuery(this).val() + '"> ' +
'<div class="title"><h6>' + jQuery(this).find('option:selected').html() + '</h6></div>' +
' '
+ (jQuery.inArray(jQuery(this).val(), ['zelevance', 'best', 'modified', 'publishUp']) === -1 ? '
<div class="group-controls">
<div class="controls">
<input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" '+checkedasc+' name="orders[' + jQuery(this).val() + ']" value="' + jQuery(this).val() + '" /><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p>
</div>
<div class="controls">
<input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" '+checkeddesc+' name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p>
</div>
</div>
' : '' +
'<div class="group-controls"><div class="controls"><input <?php if($auto_filter || $ajax_filter): ?>onclick="jQuery('#<?php echo $formid; ?>').submit();"<?php endif; ?> type="radio" checked="checked" name="orders[' + jQuery(this).val() + ']" value="r' + jQuery(this).val() + '" /><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div></div>')
+ '
<div class="controls"><button class="delete" onclick="jQuery(this).parents('li').remove();<?php if($auto_filter || $ajax_filter): ?>jQuery('#<?php echo $formid; ?>').submit();<?php endif; ?>"><?php echo JText::_("JAK2DELETE"); ?></button></div>
</li>
');
}Focus on this code :
checkeddesc='';
checkedasc=' checked="" ';
if (jQuery(this).val().search('xf') !== -1) {
checkeddesc=' checked="" ';
checkedasc='';
}——————————————————————————————————
If you want all fields have descending order change to this :
checkeddesc=' checked="" ';
checkedasc='';——————————————————————————————————
if you want some field has descending order only:
You just need to edit the line
if (jQuery(this).val().search('xf') !== -1) {
for example
if (jQuery(this).val().search('xf') !== -1) {
This mean all the extra field will had descending order.
if you want some extra field not all.
change to
if (jQuery(this).val().search('xf1|xf2|xf3|xf4') !== -1) {
1,2,3,4… mean id of extra field. you can find in administratorjust add more field like that.
It’s a littble bit tricky.
If you find it’s difficult. you can pm me ftp account so i can edit for you.Regards
ilet Friendilet
- Join date:
- February 2009
- Posts:
- 25
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 2
- Thanked:
- 5 times in 1 posts
November 13, 2015 at 5:20 pm #724187Thank you. This worked. Now is there a way to add a descending numeric order option for a JA K2 menu item? All I see is ascending. I want my category item view to be ordered by descending by default.
ilet Friendilet
- Join date:
- February 2009
- Posts:
- 25
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 2
- Thanked:
- 5 times in 1 posts
November 13, 2015 at 5:20 pm #754536Thank you. This worked. Now is there a way to add a descending numeric order option for a JA K2 menu item? All I see is ascending. I want my category item view to be ordered by descending by default.
Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
November 16, 2015 at 8:21 am #724865Hi ilet.
You can active the old options.
edit the file : /modules/mod_jak2filter/helper.php
line :
1404 : // $options[] = JHtml::_(‘select.option’, ‘ralpha’, JText::_(‘JAK2_TITLE_REVERSEALPHABETICAL’));
1406 : // $options[] = JHtml::_(‘select.option’, ‘rorder’, JText::_(‘JAK2_ORDERING_REVERSE’));
1450 : // $options[] = JHtml::_(‘select.option’, ‘rxf’.$item->id, JText::sprintf(‘XFIELD_ORDER_DESCENDING’, $item->name));
1453 : // $options[] = JHtml::_(‘select.option’, ‘rxf’.$item->id, JText::sprintf(‘XFIELD_ORDER_REVERSE_ALPHABETICAL’, $item->name));remove the comment “//”
And edit the file : components/com_jak2filter/models/itemlist.php
line : 361-364
Move the code
if (empty($order_fields)) { // set default ordering if no ordering choosen.
if ($jaK2FilterParams->get('catOrdering'))
$order_fields[$jaK2FilterParams->get('catOrdering')] = $jaK2FilterParams->get('catOrdering');
}To line : 63.
$xf = '';
$xfJoin = " LEFT JOIN #__jak2filter_taxonomy_map jatm ON jatm.item_id = i.id";
$orderby=array();
if (empty($order_fields)) { // set default ordering if no ordering choosen.
if ($jaK2FilterParams->get('catOrdering'))
$order_fields[$jaK2FilterParams->get('catOrdering')] = $jaK2FilterParams->get('catOrdering');
}
foreach ($order_fields AS $of => $vof) {That’s all.
This feature with order is in under development stage, we’re trying to improve it better. And it’ll be updated in upcoming release version.
Regards.
-
AuthorPosts
This topic contains 16 replies, has 4 voices, and was last updated by BigHug 9 years ago.
We moved to new unified forum. Please post all new support queries in our New Forum