Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create "recent posts" widget for user and group dashboards #93

Open
rgilman opened this issue Nov 18, 2018 · 15 comments
Open

Create "recent posts" widget for user and group dashboards #93

rgilman opened this issue Nov 18, 2018 · 15 comments
Assignees

Comments

@rgilman
Copy link
Member

rgilman commented Nov 18, 2018

One of the "courtyard" features I would like to see is a list of recent posts similar to what's on the current forum at the main forum index page. Here's a screen shot:

screen shot 2018-11-18 at 8 43 07 am

I'm envisioning that on the user home page/dashboard, the list includes post from all the groups/forums where the user is an active member. On the group dashboard, it would just be posts from that group. The same basic widget should work for both uses with just a settings change.

I'm thinking of doing this as a widget rather than just a function/template set because that will prepare us for an easier approach to later user customization.

I posted an ill-formed question on the bbPress support site and got a very helpful response. You can see it here.

I also did quite a bit of work after posting that question. I'm feeling confident that I can now move this forward pretty quickly.

@rgilman rgilman self-assigned this Nov 18, 2018
@rgilman
Copy link
Member Author

rgilman commented Nov 22, 2018

I feel I've made major progress on this in the past few days, as illustrated in PR #94 .

The user home page (dev.bfcom.local) and the group home page (g-dash) now have widget areas and I've successfully converted the widgets.php file from the bbp style pack into a "recent posts" widget similar to what's illustrated above.

I've made those two pages responsive with an accordion layout for smaller screens. I've done it just with CSS by including the content twice, once for widescreen and once as an accordion, and use a media query to only display one at a time. There may be a more efficient way to do this with JS but this works for now.

Evolving the functionality and the styling for this pages should now be pretty straightforward.

@rgilman
Copy link
Member Author

rgilman commented Nov 23, 2018

I've uploaded the 11/22 master to bfn.context.org. To get your local instance to look the same, you will need to make some changes in the WP admin:

  • Go to Pages > Home Page – Front Page > Edit. Once on the edit page, look in the right column for Page Attributes > Template. Choose Home from the dropdown list and then click Update.
  • Go to Appearance > Widgets and add the following widgets:
    • In User Home Left Panel add (BuddyPress) Latest Activities. Defaults are OK.
    • In User Home Center Panel add (Style Pack) Latest Activity. Make the Title = Forum Posts ; Max topics = 20 (or whatever you like) ; check Show Freshness, Show topic author and Show Forum.
    • In User Home Right Panel add Recent Posts with the title = Blog Posts.
    • In Group Dash Left Panel add (BuddyPress) Latest Activities. Defaults are OK (same as above).
    • In Group Dash Right Panel add (Style Pack) Latest Activity. Settings same as above.

@iangilman
Copy link
Member

@DavidScottBernstein @wunluv Please update your local versions as specified in the comment above and update here to let us know you've done it.

@DavidScottBernstein
Copy link
Collaborator

I'm a bit lost. When I edit the Home Page, I see a Page Attribute pane in the right column that has two dropdowns: Parent and Template, along with an entry field called Order. I don’t see ‘Home’ in either dropdown lists. Also, in Appearances > Widgets, I see the following panels: Wiki Top, Wiki Bottom Left, Wiki Bottom Right, Sidebar 1, Offcanvas, BuddyPress Member’s Home, BuddyPress Group’s Home but not the ones you list. Can you help?

@rgilman
Copy link
Member Author

rgilman commented Nov 28, 2018

Have you pulled the new master into your local site yet?

@DavidScottBernstein
Copy link
Collaborator

GitHub Desktop should pull in the latest when my current branch is Master and I click Fetch origin. It says I have the latest as of 2 minutes ago.

@rgilman
Copy link
Member Author

rgilman commented Nov 29, 2018

Hmm. Check to see that you have a file called home.php at the top level in the bfcom folder in themes.

@DavidScottBernstein
Copy link
Collaborator

Yes, I have the file home.php at the top level in the bfcom folder in themes.

@rgilman
Copy link
Member Author

rgilman commented Nov 29, 2018

That's weird. It should show up in the Template dropdown for the Home Page. The additional widget areas should also automatically load. I'll see what I can figure out. If you don't have it working by tomorrow's meeting, maybe we can do some debugging.

@DavidScottBernstein
Copy link
Collaborator

That sounds good. I'll try looking at it with fresh eyes tomorrow.

@DavidScottBernstein
Copy link
Collaborator

@rgilman, I was able to drop the widgets on the panels but not customize the fields. I see the customizable fields right before I drop the widget but those fields don't show up after I drop it, instead I see "?>". Should I call it good enough or do you want to look at it with me?

@rgilman
Copy link
Member Author

rgilman commented Nov 29, 2018

I'm going to say, for now, let's wait until you are back after next week to look at this.

@DavidScottBernstein
Copy link
Collaborator

DavidScottBernstein commented Nov 29, 2018 via email

@DavidScottBernstein
Copy link
Collaborator

Done. After rebooting Wordpress the widget options showed up and I was able to set them.

@iangilman iangilman removed their assignment Nov 30, 2018
@iangilman
Copy link
Member

I've now done this as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants