-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add/single staff member block #108
Draft
brettshumaker
wants to merge
35
commits into
main
Choose a base branch
from
add/single-staff-member-block-new
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a big commit. Adds a functional single Staff Member block. There are still a few bugs to work out and still some work to do on the admin rendering, but it's a pretty good start.
Ok, this seems to be working now. A dynamic block that renders the shortcode on the front-end and also uses `<ServerSideRender />` to render the shortcode in the admin area too.
Accidentally introduced a bug where the block would automatically select the first search result with no interaction from the user.
I'd like to offer a better way to template out the staff member loops. I'm marking this block as "legacy" because we're using the shortcode to generate the output. I'll be building "new" blocks that will have a few different layout options and the ability to hook into them and add additional layouts.
- Fixed error when Staff Member did not contain a photo.
This adds a Gutenberg-first (not utilizing the shortcode) dynamic block. And likely renders the legacy block from #104 useless because I added the "Staff Loop Template" for a layout option. It contains 3 layout options: - image left, content right - content left, image right - image top, content bottom You can control the fields that are shown on each Single Staff Member block via toggle switches in the `Content Options` panel. **TODO: make these filterable? Would allow users/plugin developers to add their own custom fields.** All functions that handle the layouts, and all block field render functions are pluggable in that a user can add a function with the same name to their theme and it will be used instead of the function contained in Simple Staff List.
This is a big commit. Adds a functional single Staff Member block. There are still a few bugs to work out and still some work to do on the admin rendering, but it's a pretty good start.
Ok, this seems to be working now. A dynamic block that renders the shortcode on the front-end and also uses `<ServerSideRender />` to render the shortcode in the admin area too.
Accidentally introduced a bug where the block would automatically select the first search result with no interaction from the user.
I'd like to offer a better way to template out the staff member loops. I'm marking this block as "legacy" because we're using the shortcode to generate the output. I'll be building "new" blocks that will have a few different layout options and the ability to hook into them and add additional layouts.
- Fixed error when Staff Member did not contain a photo.
This adds a Gutenberg-first (not utilizing the shortcode) dynamic block. And likely renders the legacy block from #104 useless because I added the "Staff Loop Template" for a layout option. It contains 3 layout options: - image left, content right - content left, image right - image top, content bottom You can control the fields that are shown on each Single Staff Member block via toggle switches in the `Content Options` panel. **TODO: make these filterable? Would allow users/plugin developers to add their own custom fields.** All functions that handle the layouts, and all block field render functions are pluggable in that a user can add a function with the same name to their theme and it will be used instead of the function contained in Simple Staff List.
…m/brettshumaker/Staff-List-Plugin into add/single-staff-member-block-new
* Adds /sslp/v1/block-layouts/ endpoint to get available layouts for context * Adds filters to set the default layout and content options: `sslp-single-staff-member-block-attribute-default-layout` `sslp-single-staff-member-block-attribute-default-content-{{content name}}` * Adds filter for adding custom layouts `sslp-custom-block-layouts` * Slight change to the structure of attribute content used in layout callback functions - now has the "name" as the index
Removing the "Single Staff Member (Legacy)" block - it's not needed now that we have a template selector in the main block.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.