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

[BLOCK] Custom Query Loop #7

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

GeoffDusome
Copy link
Contributor

Custom Query Loop

What does this do/fix?

A dynamic block with some supporting components to create the ability to define a custom query loop that gives us more features than that of the core Query block.

How can this be quickly implemented for testing?

  1. Copy contents of the block directory to the themes/core/blocks/tribe/custom-query-loop/ directory.
  2. Copy components directory to the themes/core directory.
  3. Add the tribe/custom-query-loop block to the self::TYPES array in plugins/core/src/Blocks/Blocks_Definer.php.
  4. Run npm run dist to build the block.

Media

@GeoffDusome GeoffDusome added Needs FE Review Use this tag if the work is complete and requires FE review Needs BE Review Use this tag if the work is complete and requires BE review labels May 28, 2024
@GeoffDusome GeoffDusome self-assigned this May 28, 2024
Copy link

@LayaTaal LayaTaal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GeoffDusome I'm going to continue going through this but want to leave individual comments as I do.

I left a few small thoughts here for now. Also, I wanted to share this screencast of a bug I encountered on the admin side.


.page-numbers:not(.dots, .next, .prev) {

@mixin t-body;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should think about doing this differently. I know these are intended to be used only with Moose, but it feels a little uncomfortable to be relying on mixins and variables from a different codebase where they may change or not be present at all.

Comment on lines 16 to 20
<h2 class="p-card-search-result__title t-display-x-small" style="margin-top: 0; margin-bottom: var(--wp--preset--spacing--10)"><?php echo get_the_title( $id ); ?></h2>

<p class="p-card-search-result__excerpt"><?php echo get_the_excerpt( $id ); ?></p>

<p class="p-card-search-result__permalink t-caption" style="margin-top: var(--wp--preset--spacing--20); color: var(--color-neutral-60)"><?php echo get_the_permalink( $id ); ?></p>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to escape these.

Comment on lines +380 to +387
<FormTokenField
__next40pxDefaultSize={ true }
label={ __( 'Post Types', 'tribe' ) }
value={ postTypes }
suggestions={ postTypeSuggestions() }
onChange={ ( tokens ) => {
setPostTypes( tokens );
} }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am finding these form token fields a little confusing to use. Maybe we can add more helper text or change the control type? It just wasn't clear to me that typing would bring up a list of available post types.

} }
/>
{ postTypes !== null && postTypes.length > 0 ? (
<FormTokenField

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment here about the form token field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs BE Review Use this tag if the work is complete and requires BE review Needs FE Review Use this tag if the work is complete and requires FE review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants