Closed laryn closed 3 years ago
I struggled with how to do this in Views then gave up.
@docwilmot One approach: just show the parent level forums on the main forums page, and then have a child forums listing at the top of the parent forum page. I have a rough WIP of this flow on a dev site. It does leave some questions:
Could you explain that a bit? An how about child-child-child... forum? Just one sublevel?
@docwilmot Here are mockups for the two options I tried to describe above. The first could work with any number of child levels I suppose. The second would work best with a limit of one level most likely.
So we'd be allowing topics on a forum term that itself has child terms?
@docwilmot Open question -- and if not, do you know how to prevent it? :)
@docwilmot Open question -- and if not, do you know how to prevent it? :)
But first, is that OK though? I see that Drupal and Joomla dont do that. I wonder if users are now more used to a flat structure for discussions a la FB and Twitter etc. Do we really need to support that UI? I see PHPBB forum does allow it, but thats an older UI pattern I'd guess.
In fact this is all guess, I dont know, just seemed weird to me. If you feel it should be supprted thats fine with me.
If not, but we still want subforums, we could probably figure it out by checking access based on taxonomy child terms etc.
@docwilmot I won't pretend to be an expert on this, but version one above feels more old-school, and version two feels more current. (In v2 the "sub-forums" act almost like tags rather than structured forums, and the initial topic listing is more of a stream that can be filtered by these tags/child forums).
I'm working on a site where they've requested multiple levels of sub-forum -- I'm going to suggest they stick to parent and child but I guess the need for sub-forums of some kind may be out there.
Maybe the topic listing view is always the same views page, just with a different value inserted into the exposed filter to reduce results to topics from a particular forum? (ie. instead of forums/32
that forum listing would be forums?forum=32
which prefills the exposed filter).
As far as nested/child forum terms, we could show all topics from the parent term and any child terms in the topic listing. But if viewing a child forum, it would only show results from that child forum (and below in the case of multiple child levels).
How does that sound?
I'm playing with this and I'm liking it. Here are a few shots from a dev site to illustrate what I mean:
Parent forum (also pulling in child forum topics):
Child forum (not pulling in parent topics):
this looks good. would you sort by last reply as usual, or group the subforum topics?
I would think sorting by last reply rather than grouping. If people want to see the posts in a group they can filter.
This particular dev site is getting more opinionated, I realize, but if I get further afield then you are comfortable with maybe we can still pull bits out. Here's the current status:
Should I file a PR with this (or most of it) in it?
So far is this working with multiple levels of subforum, or just one?
In either case, by all means PR! This would be a great addition to what we've got now.
@docwilmot Take a look and see what you think! Theoretically it should work with any number of sub-forums, although the CSS only indents up to four levels currently.
This is really excellent @laryn. Only things:
,strong>
.@docwilmot I'll try to make these adjustments early this week. The bent arrow is copied from Basis directly (to match an indented comment/reply) but if it doesn't work in other themes by default you solution sounds fine.
Do you have any idea why some of the links to the URL with a query (for the exposed filter) are getting double-encoded, or how to fix? e.g. https://github.com/backdrop-contrib/forum_ng/pull/16/commits/794d1cb561a58f12836e6badb67c31a0feea12b1
Do you have any idea why some of the links to the URL with a query (for the exposed filter) are getting double-encoded, or how to fix? e.g. 794d1cb
Not getting your meaning here sorry
@docwilmot Sorry. In one or two places (e.g. the main administrative "Forum NG" page that duplicates/replaces the administrative taxonomy term listings) the URL doesn't work if you click on the forum name. It is supposed to be something like this:
/forums/stream/?forum=395
But the URL comes out all garbled and doesn't filter to the right forum page. This is where that URL is added in the code: https://github.com/backdrop-contrib/forum_ng/commit/794d1cb561a58f12836e6badb67c31a0feea12b1
I'm at work now so cant test this, but I suspect passing a query string to #href
is likely the problem. Try keeping #href
as 'forums/stream/'
was but also pass the query string in #options
, like `$form[$key]['view']['#options'] = array('query' => array('forum' => $term['tid']));
@docwilmot Ready for another review on https://github.com/backdrop-contrib/forum_ng/pull/16
Hmm... the hiding of the "Posted in..." line for the current forum is not working consistently, not sure why.
The changes are great. I have doubts about the user picture above the "submitted by" info like it is. It pushes the submitted by line down and looks a bit uncomfortable to me. I can understand that this would be a good feature to have the original poster's image, but not sure if the styling is OK. Posting a screenshot so that others could comment:
I think it would be best if we left that off and push it in another PR, so we can commit what youve done so far.
@docwilmot This is a screenshot from a sandbox site that doesn't have Forum NG installed:
I agree we should make that look nicer but I don't think the piece of code you referenced is causing that -- it's actually the submitted info that shows up in the listing table and it does have some styling associated with it to float the image in that context.
This is a screenshot from a sandbox site that doesn't have Forum NG installed:
Well in that case, lets keep it and make another issue? Meanwhile, is this ready for a final review you think?
@docwilmot Yes, I think it's ready for review. I'm not going to be able to work on it for a little while here (vacation!) so feel free to adapt/modify as you see fit.
The one thing I think may need a little TLC is the hiding of the category for the currently viewed level -- I think it's inconsistent for some reason.
@docwilmot Did this have any movement while I was away? I want to try to add a little more polish to a few pieces but don't want to have any conflicts with this PR. Can we split anything loose in here into separate issues?
Nope, nothing new. I've not noticed any issues either. I'd say commit this, and if you can review the other outstanding PR, we can commit that too, then push an alpha and get this on the road.
In early testing, it seems that there isn't a mechanism to display forums as parent/child -- everything shows up at the same level in the forum listing.