Black Friday 2026 50% off every plan Our biggest deal of the year on #1 Joomla products.
Ends in 12d 15h 14m 49s
Claim 50% off
Staff replied Templates

SBPB Article Addon does not sort by Latest correctly

Asked by Chris Elliott 4 years ago Last activity 4 years ago

Using Folium quickstart, when I create a page using Articles addon, and choosing "Ordering = Latest", ordering is not correct when displaying articles.

I note that the components/com_sppagebuilder/helpers/articles.php script does not even look for that value:
around line 73:

    // has order by
    if ($ordering == 'hits') {
        $query->order($db->quoteName('a.hits') . ' DESC');
    } elseif($ordering == 'featured') {
        $query->where($db->quoteName('a.featured') . ' = ' . $db->quote(1));
        $query->order($db->quoteName('a.publish_up') . ' DESC');
    } elseif($ordering == 'oldest') {
        $query->order($db->quoteName('a.publish_up') . ' ASC');
    } elseif($ordering == 'alphabet_asc') {
        $query->order($db->quoteName('a.title') . ' ASC');
    } elseif($ordering == 'alphabet_desc') {
        $query->order($db->quoteName('a.title') . ' DESC');
    } elseif($ordering == 'random') {
        $query->order($query->Rand());  
    } else {
        $query->order($db->quoteName('a.publish_up') . ' DESC');
    }

by adding:

    } elseif($ordering == 'latest') {
        $query->order($db->quoteName('a.created') . ' DESC');

within this if block, I can now get ordering working correctly.

Please advise if this is a bug?

1 reply

Ofi Khan Staff

Hello Chris Elliott

I have not found this issue with Folium or SP Page Builder. It works without the line too. The Articles are sorted according to the created date.

Best regards

Log in to reply.