#4570 closed enhancement (fixed)
Track latest post for sites to improve the Sites directory
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 1.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Blogs | Keywords: | |
Cc: |
Description
To improve the Sites directory for multisite BP, I'm suggesting for each sites that we record the latest post's title, content, and featured image to a site meta record. We can then display this information on the Sites directory templates.
Pre-1.7, the Sites / Groups / Members templates in BP-Default have been almost identical, and I think the Sites templates are by far the worse. If for each site we show an excerpt of the latest article and a picture, it makes the directory much more useful to people trying to find new content on the network.
Change History (9)
#2
@
12 years ago
Or the data could be stored in the blogs meta tables (we don't use these anywhere in core just yet).
#3
@
12 years ago
blogmeta seems like the right place for this kind of data. Agreed that it shouldn't be dependent on Activity (it will mean duplicating some recent post stuff that already appears in new_blog_post activity items, but this isn't too big a deal). Just a matter of writing the functions that hook into publish_post (or maybe the {status}_to_{status} hooks, to avoid problems with scheduled posts and other goodies like that) and record the content.
#5
@
12 years ago
I found some long-forgotten (for me, anyway) function that does something similar already; bp_get_blog_latest_post()
The underlying database query is in need of overhaul -- as is most of the Blogs component, really -- but for now I've extended the query to get the data I needed (featured images, specifically) and added some template functions for that, the title, and the post body.
I'm going to commit and close this ticket because, in a way, we already *do* track latest posts; just not very well. Perhaps overhauling the Blogs component will be something I might do for 1.8, unless I get any more time in 1.7 for incremental improvements.
I'm thinking that this meta is updated by each site to avoid switch_to_blog. We could use data from the activity component in lieu of building something new, but that creates a hard requirement between the Sites and Activity components.