Skip to content

Sponsors list block#1122

Open
cjyabraham wants to merge 2 commits into
mainfrom
sponsors-list
Open

Sponsors list block#1122
cjyabraham wants to merge 2 commits into
mainfrom
sponsors-list

Conversation

@cjyabraham

@cjyabraham cjyabraham commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Test page
Test Google Sheet
Test Google Sheet CSV

Initial prompt:

Make a plan for a new Gutenberg block that lists sponsors. First, the editor will be able to specify a list of sponsors in a Google Sheet with the following columns:
- Sponsor Name - free text field
- Post ID - number corresponds with post ID for the corresponding Sponsor CPT post ID
- Level - free text field
- Description - free text field
- Categories - comma-delimited list of categories
- Booth Location - free text field

There may be many (up to 100) sponsors added to a particular block from the Google Sheet. The sheet will be published publicly and the url of the CSV provided to the block to import. To keep things simple, the data does not need to be editable within the Gutenberg editor. If edits need to happen, they’ll happen on the Sheet and the import button pressed again. Sponsors from the sheet will be matched to a corresponding Sponsor CPT post by ID and then the logo and url from that post is used for the front-end display. Skip unmatched rows and report them. 

For the actual listing on the front-end of the site, we want it to be filterable by category and level. The listing should show sponsor name, logo, level, booth location, and categories. The list is sorted alphabetically by sponsor name. Each sponsor can be clicked to display a popup with the full information about the sponsor including their website url.  

Signed-off-by: Chris Abraham <cjyabraham@gmail.com>
Signed-off-by: Chris Abraham <cjyabraham@gmail.com>
Copilot AI review requested due to automatic review settings July 21, 2026 18:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a dynamic Gutenberg sponsor directory block backed by Google Sheets CSV data.

Changes:

  • Adds authenticated CSV importing and validation.
  • Renders filterable sponsor cards with modal details.
  • Adds editor UI, frontend assets, filtering tests, and project configuration.

Reviewed changes

Copilot reviewed 16 out of 22 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
.gitignore Allows plugin files while excluding dependencies.
phpcs.xml Adds the plugin to PHP linting.
sponsor-directory-block.php Bootstraps block and REST route.
package.json Defines build, lint, and test tooling.
includes/class-sponsor-directory-importer.php Fetches and validates CSV sponsor data.
includes/render.php Server-renders filters, cards, and modals.
src/block.json Defines block metadata and attributes.
src/index.js Registers the dynamic block.
src/edit.js Implements the CSV import editor UI.
src/editor.scss Styles the editor interface.
src/style.scss Styles the directory and modal.
src/filter.js Implements filter matching.
src/filter.test.js Tests filtering behavior.
src/view.js Initializes frontend filtering.
build/block.json Provides built block metadata.
build/index.js Provides the compiled editor script.
build/index.css Provides compiled editor styles.
build/index.asset.php Declares editor dependencies.
build/view.js Provides compiled frontend filtering.
build/view.asset.php Declares frontend dependencies.
build/style-index.css Provides compiled frontend styles.
Files not reviewed (4)
  • web/wp-content/plugins/sponsor-directory-block/build/index.css: Generated file
  • web/wp-content/plugins/sponsor-directory-block/build/index.js: Generated file
  • web/wp-content/plugins/sponsor-directory-block/build/style-index.css: Generated file
  • web/wp-content/plugins/sponsor-directory-block/build/view.js: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

array(
'timeout' => 15,
'redirection' => 3,
'limit_response_size' => self::MAX_RESPONSE_SIZE,
Comment on lines +50 to +51
count.textContent =
visibleCount === 1 ? '1 sponsor' : `${ visibleCount } sponsors`;
ob_start();
?>
<div <?php echo $wrapper_attributes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
<div class="sponsor-directory__filters" aria-label="<?php esc_attr_e( 'Filter sponsors', 'sponsor-directory-block' ); ?>">
array(
'class' => sanitize_html_class( $class_name ),
'loading' => 'lazy',
'alt' => $name . ' logo',
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.

2 participants