Skip to content

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

Open

Description

@rgilman

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.

Activity

  1. self-assigned this
    on Nov 18, 2018
  2. rgilman commented on Nov 22, 2018

    @rgilman
    MemberAuthor

    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.

  3. rgilman commented on Nov 23, 2018

    @rgilman
    MemberAuthor

    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.
  4. iangilman commented on Nov 28, 2018

    @iangilman
    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.

  5. DavidScottBernstein commented on Nov 28, 2018

    @DavidScottBernstein
    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?

  6. rgilman commented on Nov 28, 2018

    @rgilman
    MemberAuthor

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

  7. DavidScottBernstein commented on Nov 28, 2018

    @DavidScottBernstein
    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.

  8. rgilman commented on Nov 29, 2018

    @rgilman
    MemberAuthor

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

  9. DavidScottBernstein commented on Nov 29, 2018

    @DavidScottBernstein
    Collaborator

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

  10. rgilman commented on Nov 29, 2018

    @rgilman
    MemberAuthor

    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.

  11. DavidScottBernstein commented on Nov 29, 2018

    @DavidScottBernstein
    Collaborator

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

  12. DavidScottBernstein commented on Nov 29, 2018

    @DavidScottBernstein
    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?

  13. rgilman commented on Nov 29, 2018

    @rgilman
    MemberAuthor

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

  14. DavidScottBernstein commented on Nov 29, 2018

    @DavidScottBernstein
    Collaborator
  15. DavidScottBernstein commented on Nov 29, 2018

    @DavidScottBernstein
    Collaborator

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

  16. removed their assignment
    on Nov 30, 2018
  17. iangilman commented on Nov 30, 2018

    @iangilman
    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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions