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

feat: display options for curated lists #5

Closed
wants to merge 32 commits into from
Closed

Conversation

dkoo
Copy link
Contributor

@dkoo dkoo commented Oct 8, 2020

All Submissions:

Changes proposed in this Pull Request:

Enables all display/design options for Curated List block. The styles here are placeholder, mostly to demonstrate how they might work.

Also fixes inheritance of Curated List block attributes to Listing blocks.

How to test the changes in this Pull Request:

  1. Create a curated list block and add several list items.
  2. Change the display options for the block and observe that the settings are reflected for all list items in both editor and front-end views.

Display options to test in this PR:

  • Show list item numbers: toggles display of numbers alongside listings
  • Show featured image: toggles display of featured image
  • Show featured image caption (only available if featured image is enabled): toggles display of featured image caption
  • Featured image position (only available if featured image is enabled): sets position of featured image to top, left, or right
  • Mobile stack (only available if featured image position is left or right): if ON, featured image will stack on top of post content at smaller viewports.
  • Show author: toggles display of listing post authors
  • Show excerpt: toggles display of listing post excerpts
  • Type scale: sets font size of listing title, author, and excerpt
  • Text color: sets font color of listing title, author, and excerpt

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Sets up custom post types and Listing block prototype.
Instead of just registering a single Listing block and selecting the type in the parent post, this registers a separate block for each listing type (all of which use the same code).
Addresses pull request feedback and refactors post types config into a more DRY treatment.
This removes the Curated List CPT in favor of a wrapper block that can be inserted into any other post or page. This block can contain Listing blocks to create curated lists anywhere, and can be converted to a Reusable Block if it needs to be reusable.
Lays out a method of passing attributes data from the Curated List block to its child Listing inner blocks, without relying on contexts. We basically duplicate parent block attributes on each child block and sync the values of those attributes.
This establishes a pattern for providing block patterns for particular listings CPTs. This might let us provide structured content without having to register metadata fields for listing content.
Adds support for location-based data using the jetpack/maps block. If a listing CPT of any type contains a jetpack/map block with location data, the location data is used to show the listing on a map for any Curated List blocks containing the listing post.
Sets up a sync from certain content blocks to post meta fields. This will help us more easily implement search/filter functionality for listing posts on a large scale.
We want to avoid letting editors nest Curated Lists inside list items which could be nested inside Curated Lists which could be inside list items which could be... etc.
Moves shared styles to a `shared` SCSS folder and implements helpers to output the same class names in editor + front-end based on curated list block attributes.
- show author
- text color
- type scale
- all options reflected in both editor and front-end
Block patterns and block pattern categories can only be registered on init or admin_init hooks in WP 5.5.
Base automatically changed from feat/curated-list-block to master October 27, 2020 17:58
@dkoo
Copy link
Contributor Author

dkoo commented Oct 27, 2020

Closing in favor of #6.

@dkoo dkoo closed this Oct 27, 2020
@dkoo dkoo deleted the feat/display-options branch October 27, 2020 18:21
@dkoo dkoo mentioned this pull request Oct 27, 2020
6 tasks
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

Successfully merging this pull request may close these issues.

1 participant