Welcome to Geeklog, Anonymous Friday, February 07 2025 @ 10:10 pm EST

Geeklog Forums

Static Page List Sort Order Problem after upgrade


BMcDonald

Anonymous
I just upgraded to the latest version of geeklog and when I click on "last updated" column, in the static page list, it no longer lists the last updated pages at the top like it used to. The default sort puts them at the bottom. Is there a way to change the default sort so the last updated static pages list at the top rather than the bottom like it used to? I have hundreds of static pages.
 Quote

tokyoahead

Anonymous
Hi,

by default the static pages are sorted by title, ascending (A->Z).
If you click on the "Last Updated"-Header, you sort by another field, but with the same direction, so from small numbers to large numbers (old->new).
If you click once again on the "Last Updated"-Header. you will invert this sort order.

This is the normal and intended beahvior. I do not have the older version before 1.4.1 installed here to see how the older version behaved.
If you want to change this, you can default your static pages admin to sort by update-time descending by default.

For this however, you have to edit the file

geeklog/public_html/admin/plugins/staticapages/index.php
on line 386 from

Text Formatted Code
    $defsort_arr = array('field' => 'sp_title', 'direction' => 'asc');

to
Text Formatted Code
    $defsort_arr = array('field' => 'unixdate', 'direction' => 'desc');


Hope this helps.
Please note however that you will have to re-apply this change whenever there is a new version released.
I think that this could be a config option for the plugin, but given the amount of lists in the system, that would be a lot of code to be changed. Volunteers?
 Quote

BMcDonald

Anonymous
Yes this helps. Thanks. I don't know why they changed it. In the old version geeklog, when you click on the Last Updated column, it sorted with the last updated page on top. Doesn't make sense to sort the last updated page on the bottom of the pile. You'd want the last updated page on top. It worked that way in the previous version.

Anyway, at least I can fix it with your help here. I'll have to keep notes for any updates.

Thanks so much.
 Quote

tokyoahead

Anonymous
Quote by: BMcDonald

I don't know why they changed it.


I changed that. I did it because I introduced a common engine to generate all the admin lists automatically to make them look and behave all the same and at the same time dramatically reduce the code & templates needed to generate such a list. However this eliminated custom reactions for each list when you click on a list-header.

Quote by: BMcDonald

Doesn't make sense to sort the last updated page on the bottom of the pile. You'd want the last updated page on top. It worked that way in the previous version.


This is a philosophical question, not so much a pure fact. I know as many people who for example list their inbox from old to new as I know people who have the latest on top.
It also heavily depends on the amount of static pages you have on your site. With many pages and many changes dates descending is better, with many pages but few changes, the title-sorting ascending works better. So you see that is really depends on the users to know what is best. I am sorry that I cannot provide a good solution to accomodate everybody here without changing the code. Maybe a cookie would do an easy job here, but a config system is a lot of work in this point.
 Quote

BMcDonald

Anonymous
Points taken. I understand.

It's not that hard to click on the column twice to sort it the way I want. I appreciate all your hard work at making the system better.

Thanks again.
 Quote

All times are EST. The time is now 10:10 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content