TheStanfordDaily / stanforddaily

The Stanford Daily website frontend is proudly powered by Expo.
https://www.stanforddaily.com/
Apache License 2.0
59 stars 8 forks source link

Add photo gallery page layout to our custom WP theme #160

Open hs4man21 opened 3 years ago

hs4man21 commented 3 years ago

We want to check each post for some photo gallery category or categories (for now you can just use an existing category like "Opinions" or "News" for testing purposes) and render ContentView (See ContentView.tsx) differently if a post belongs to a photo gallery category. We can check for the category in the post object's tsdCategories property (an array) and retrieve the post HTML in the post object's postContent property (a string).

We will pull from the content in that string and use it to fill a template for the new photo gallery layout.

Here's an example of how this might look in ContentView.tsx:

Screen Shot 2021-04-16 at 9 15 30 PM

Notice how we have a different layout for Humor articles, and others have the second layout (most of which is cut off here).

Here's the guiding example we discussed: https://www.washingtonpost.com/graphics/world/2020/08/04/photos-show-aftermath-beirut-blasts/

The rest is pretty open-ended! We'll def want to consult with the photo/video staff after some initial development and experimentation.