verbb / comments

A Craft CMS plugin for managing comments directly within the CMS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A Setting to show newest comments first in the comments overview tab

smartpill opened this issue · comments

What are you trying to do?
Not have to click on the date tab and wade through over a decade of imported comments

What's your proposed solution?
Set default to newest first.

Additional context
n/a.

This might actually be a Craft limitation, with being unable to order by the structure and commentDate. Otherwise, at the moment, you'll have to change from ordering via the Structure to commentDate. It should remember your selection, but not entirely ideal.

Will keep looking for a solution.

@engram-design Hi! (I work with @smartpill, we're working on the same project here). The problem is that it doesn't save your default across browsers, so every user has to keep setting it. If you could just make it so we could set the default sort for all users via the config file or something, that would be great? We've got comments going back 10+ years and sorting by Structure is completely useless for us. (Nobody needs to see the comments from 2008, pretty much ever).

Descending Order for date, ideally vs current Ascending.

Descending Order for date, ideally vs current Ascending.

Well, yeah, hopefully they will just let us set the default sort to any of the available options.

Yep, can't figure out how to get it as descending, which would be the bare-minimum. @adrienne You want to be able to set the default sort? Adjusting the sort once should save it for next load at the very least.

@engram-design - sure, but we have like 80 users and i don't want to have to explain to them that they have to set their sort manually. Plus it won't persist between browsers, and some users have multiple browsers. So yeah, setting the default would be ideal. Let me poke at your code, too, i might have an idea.

@engram-design - okay, this is actually pretty simple and i'm going to submit a pull request.

@adrienne Yep, so sorting by default was straightforward enough, and thanks for your PR - that's exactly what I was going to do, so you beat me to it.

It was more the fact I wanted to see if we could retain the structure format and be able to change a second metric of ordering (by commentDate) but that doesn't seem possible. Setting the default sort to commentDate desc is totally valid, you just get a flat-list of comments, as opposed to comments in a stucture.

Thanks again for the PR!

@engram-design -- yeah, i think because of the way the nested set implementation works (for the tree structure) that's not really going to be possible. In our case, we can always re-sort by structure if we actually need it, but honestly when you have tens or hundreds of thousands of comments the structure view is pretty useless. (Not a slam on you, at all; just the reality of the interface.)