Project

General

Profile

Actions

Feature #14256

closed

Design/UX #13998: Homepage Redesign

"Latest News" feed

Added by Colin McDonald over 3 years ago. Updated almost 3 years ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
Home Page
Target version:
Start date:
2021-03-30
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

The Latest News section of the homepage redesign should include the latest three posts collectively from:

https://news.commons.gc.cuny.edu
https://in.commons.gc.cuny.edu/

Actions #1

Updated by Boone Gorges about 3 years ago

  • Status changed from New to Testing Required

Here's background on how this is built:

- The list of sites that are the source for Latest News is defined here https://github.com/cuny-academic-commons/cac/blob/f3158f150819ff9c7ae901c07dc4ba4b215ac0e6/wp-content/mu-plugins/cac-functions.php#L341
- On the home page, the latest items from these source sites is pulled using the WP REST API. See https://github.com/cuny-academic-commons/cac/blob/f3158f150819ff9c7ae901c07dc4ba4b215ac0e6/wp-content/themes/bp-nelo/parts/home/latest-news.php#L3. I tried doing this with switch_to_blog(), but that function isn't sufficient - things like fetching post thumbnails failed because of limitations in blog-switching and persistent caching. I made a modification to the /posts/ endpoint on the source sites so that the post thumbnail is included in the payload https://github.com/cuny-academic-commons/cac/blob/f3158f150819ff9c7ae901c07dc4ba4b215ac0e6/wp-content/mu-plugins/cac-functions.php#L366
- Because we are using Featured Images, it's critical that items on in.commons and news.commons always have Featured Images. Scott, I've added you as a watcher so that this can become part of the team workflow.
- The API calls are cached, and the cache is invalidated when a new post appears on one of the source sites. https://github.com/cuny-academic-commons/cac/blob/f3158f150819ff9c7ae901c07dc4ba4b215ac0e6/wp-content/mu-plugins/cac-functions.php#L353

Actions #2

Updated by Boone Gorges about 3 years ago

Quick follow-up: The REST API mods were necessary for development testing, so I had to deploy them prematurely to the production site. So they can be found in the 1.18.x branch.

Actions #3

Updated by Boone Gorges almost 3 years ago

  • Status changed from Testing Required to Staged for Production Release
Actions #4

Updated by Boone Gorges almost 3 years ago

  • Status changed from Staged for Production Release to Resolved
Actions

Also available in: Atom PDF