-
AuthorPosts
-
Fred Tep Friend
Fred Tep
- Join date:
- September 2014
- Posts:
- 76
- Downloads:
- 46
- Uploads:
- 7
- Thanks:
- 15
- Thanked:
- 2 times in 1 posts
October 20, 2015 at 10:35 am #705987Hello,
I’ve installed the amazing JA K2 filter on my website. It’s working but I can’t order the item the way I want (most recent first).
I’m searching by tag and it’s working fine with the signaletique tag. When I click on the signaletique tag, the order is the same whatever the configuration I use either on the component parameters or the module parameters.
Can somebody help me with that ?Have a fun day
Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
October 21, 2015 at 4:45 am #706156Hi fredtep.
You could fix the problem by adding this code to file :
com_jak2filter/models/itemlist.php
line 360
//Set ordering
if (empty($order_fields)) { // set default ordering if no ordering choosen.
if ($jaK2FilterParams->get('catOrdering'))
$order_fields[$jaK2FilterParams->get('catOrdering')] = $jaK2FilterParams->get('catOrdering');
}Regards
Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
October 21, 2015 at 4:45 am #752373Hi fredtep.
You could fix the problem by adding this code to file :
com_jak2filter/models/itemlist.php
line 360
//Set ordering
if (empty($order_fields)) { // set default ordering if no ordering choosen.
if ($jaK2FilterParams->get('catOrdering'))
$order_fields[$jaK2FilterParams->get('catOrdering')] = $jaK2FilterParams->get('catOrdering');
}Regards
Fred Tep FriendFred Tep
- Join date:
- September 2014
- Posts:
- 76
- Downloads:
- 46
- Uploads:
- 7
- Thanks:
- 15
- Thanked:
- 2 times in 1 posts
October 22, 2015 at 1:07 pm #706594Great, it’s working just fine. I’ll be glad to offer you a beer if you come in Dordogne (France).
Last question and i’ll stop bothering you this week.
Is there a way to add a “most recent first by created date” field in the item ordering option. For now only “most recent first by published date” is available. I can modify my published date but this option would be usefull.
Thanks for you helpFred Tep FriendFred Tep
- Join date:
- September 2014
- Posts:
- 76
- Downloads:
- 46
- Uploads:
- 7
- Thanks:
- 15
- Thanked:
- 2 times in 1 posts
October 22, 2015 at 1:07 pm #752511Great, it’s working just fine. I’ll be glad to offer you a beer if you come in Dordogne (France).
Last question and i’ll stop bothering you this week.
Is there a way to add a “most recent first by created date” field in the item ordering option. For now only “most recent first by published date” is available. I can modify my published date but this option would be usefull.
Thanks for you helpMo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
October 23, 2015 at 9:19 am #706721Hi Fred.
You can do it by changing the file
/components/com_jak2filter/models/itemlist.php
line 370-372
Change
case 'date' :
$orderby['date'] = 'i.created ASC';
break;To
case 'adate' :
$orderby['adate'] = 'i.created ASC';
break;case 'zdate' :
$orderby['zdate'] = 'i.created DESC';
break/modules/mod_jak2filter/helper.php
line: 1400-1401
Change
$options[] = JHtml::_('select.option', 'date', JText::_('JAK2_OLDEST_FIRST'));
// $options[] = JHtml::_('select.option', 'rdate', JText::_('JAK2_MOST_RECENT_FIRST'));To
$options[] = JHtml::_('select.option', 'adate', JText::_('JAK2_OLDEST_FIRST'));
$options[] = JHtml::_('select.option', 'zdate', JText::_('JAK2_MOST_RECENT_FIRST'));/modules/mod_jak2filter/tmpl/default.php
line 266-272
<div class="group-controls">
<?php if (!in_array($kfs, array('zelevance', 'best', 'modified', 'publishUp'))) : ?>
<div class="controls"><input type="radio" <?php echo(strpos($fs, 'r') !== 0 ? ' checked="" ' : '') ?> name="orders[<?php echo(ltrim($fs, 'r')); ?>]" value="<?php echo ltrim($fs, 'r'); ?>"/><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p></div>
<?php endif; ?>
<div class="controls"><input type="radio" <?php echo(preg_match('/^r/', $fs) ? ' checked="" ' : '') ?> name="orders[<?php echo(ltrim($fs, 'r')); ?>]" value="<?php echo 'r' . ltrim($fs, 'r'); ?>"/><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></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>
</div>To
<div class="group-controls">
<?php if (!in_array($kfs, array('zelevance', 'best', 'modified', 'publishUp', 'zdate'))) : ?>
<div class="controls"><input type="radio" <?php echo(strpos($fs, 'r') !== 0 ? ' checked="" ' : '') ?> name="orders[<?php echo(ltrim($fs, 'r')); ?>]" value="<?php echo ltrim($fs, 'r'); ?>"/><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p></div>
<?php endif; ?>
<?php if (!in_array($kfs, array('adate'))) : ?>
<div class="controls"><input type="radio" <?php echo(preg_match('/^r/', $fs) ? ' checked="" ' : '') ?> name="orders[<?php echo(ltrim($fs, 'r')); ?>]" value="<?php echo 'r' . ltrim($fs, 'r'); ?>"/><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div>
<?php endif; ?>
<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>
</div>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) {
strout = '';
if (jQuery.inArray(jQuery(this).val(), ['zelevance', 'best', 'modified', 'publishUp', 'zdate']) === -1) {
strout = '
<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>';
if (jQuery.inArray(jQuery(this).val(), ['adate']) === -1)
strout += '<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>';strout += '</div>';
} else {
strout = '<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>';
}
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>' +
' '
+ strout
+ '
<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>
');
}If you find it difficult. You can pm me ftp account, I will do it for you.
Regards.
Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
October 23, 2015 at 9:19 am #752617Hi Fred.
You can do it by changing the file
/components/com_jak2filter/models/itemlist.php
line 370-372
Change
case 'date' :
$orderby['date'] = 'i.created ASC';
break;To
case 'adate' :
$orderby['adate'] = 'i.created ASC';
break;case 'zdate' :
$orderby['zdate'] = 'i.created DESC';
break/modules/mod_jak2filter/helper.php
line: 1400-1401
Change
$options[] = JHtml::_('select.option', 'date', JText::_('JAK2_OLDEST_FIRST'));
// $options[] = JHtml::_('select.option', 'rdate', JText::_('JAK2_MOST_RECENT_FIRST'));To
$options[] = JHtml::_('select.option', 'adate', JText::_('JAK2_OLDEST_FIRST'));
$options[] = JHtml::_('select.option', 'zdate', JText::_('JAK2_MOST_RECENT_FIRST'));/modules/mod_jak2filter/tmpl/default.php
line 266-272
<div class="group-controls">
<?php if (!in_array($kfs, array('zelevance', 'best', 'modified', 'publishUp'))) : ?>
<div class="controls"><input type="radio" <?php echo(strpos($fs, 'r') !== 0 ? ' checked="" ' : '') ?> name="orders[<?php echo(ltrim($fs, 'r')); ?>]" value="<?php echo ltrim($fs, 'r'); ?>"/><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p></div>
<?php endif; ?>
<div class="controls"><input type="radio" <?php echo(preg_match('/^r/', $fs) ? ' checked="" ' : '') ?> name="orders[<?php echo(ltrim($fs, 'r')); ?>]" value="<?php echo 'r' . ltrim($fs, 'r'); ?>"/><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></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>
</div>To
<div class="group-controls">
<?php if (!in_array($kfs, array('zelevance', 'best', 'modified', 'publishUp', 'zdate'))) : ?>
<div class="controls"><input type="radio" <?php echo(strpos($fs, 'r') !== 0 ? ' checked="" ' : '') ?> name="orders[<?php echo(ltrim($fs, 'r')); ?>]" value="<?php echo ltrim($fs, 'r'); ?>"/><p class="ascending"><?php echo JText::_("JAK2ASC"); ?></p></div>
<?php endif; ?>
<?php if (!in_array($kfs, array('adate'))) : ?>
<div class="controls"><input type="radio" <?php echo(preg_match('/^r/', $fs) ? ' checked="" ' : '') ?> name="orders[<?php echo(ltrim($fs, 'r')); ?>]" value="<?php echo 'r' . ltrim($fs, 'r'); ?>"/><p class="decrease"><?php echo JText::_("JAK2DESC"); ?></p></div>
<?php endif; ?>
<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>
</div>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) {
strout = '';
if (jQuery.inArray(jQuery(this).val(), ['zelevance', 'best', 'modified', 'publishUp', 'zdate']) === -1) {
strout = '
<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>';
if (jQuery.inArray(jQuery(this).val(), ['adate']) === -1)
strout += '<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>';strout += '</div>';
} else {
strout = '<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>';
}
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>' +
' '
+ strout
+ '
<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>
');
}If you find it difficult. You can pm me ftp account, I will do it for you.
Regards.
Fred Tep FriendFred Tep
- Join date:
- September 2014
- Posts:
- 76
- Downloads:
- 46
- Uploads:
- 7
- Thanks:
- 15
- Thanked:
- 2 times in 1 posts
November 2, 2015 at 4:46 pm #721112hello,
I did all you suggested. it’s working (which is good) but all the way around (which is not good enough for me) 😉
My articles are filtered from the oldest to the most recent.
Any idea ?Fred Tep FriendFred Tep
- Join date:
- September 2014
- Posts:
- 76
- Downloads:
- 46
- Uploads:
- 7
- Thanks:
- 15
- Thanked:
- 2 times in 1 posts
November 2, 2015 at 4:46 pm #753514hello,
I did all you suggested. it’s working (which is good) but all the way around (which is not good enough for me) 😉
My articles are filtered from the oldest to the most recent.
Any idea ?Mo0nlight ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
November 3, 2015 at 7:56 am #721216Hi Fred,
It should work fine.
Could you update the admin account info or PM me the correct account? as I can’t login with the provided info, I need to take a closer look at configuration in back-end.
BigHug FriendBigHug
- Join date:
- September 2012
- Posts:
- 60
- Downloads:
- 17
- Uploads:
- 277
- Thanked:
- 11 times in 1 posts
November 3, 2015 at 7:56 am #753598Hi Fred,
It should work fine.
Could you update the admin account info or PM me the correct account? as I can’t login with the provided info, I need to take a closer look at configuration in back-end.
Fred Tep FriendFred Tep
- Join date:
- September 2014
- Posts:
- 76
- Downloads:
- 46
- Uploads:
- 7
- Thanks:
- 15
- Thanked:
- 2 times in 1 posts
November 4, 2015 at 4:17 pm #721493I’ve just updated the account. Thanks for having a look
Fred Tep FriendFred Tep
- Join date:
- September 2014
- Posts:
- 76
- Downloads:
- 46
- Uploads:
- 7
- Thanks:
- 15
- Thanked:
- 2 times in 1 posts
November 4, 2015 at 4:17 pm #753744I’ve just updated the account. Thanks for having a look
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:11 am #721564Luna 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:11 am #753811 -
AuthorPosts
This topic contains 21 replies, has 4 voices, and was last updated by Luna Garden 8 years, 11 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum