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

Events: Use a showcase like approach for the events list/archive #1124

Merged
merged 30 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
44371c8
Try using a php block that queries.
StevenDufresne Dec 2, 2023
1a5adca
Example query filtering.
StevenDufresne Dec 2, 2023
a43b837
add block build script.
StevenDufresne Dec 3, 2023
d568afe
Add the patterns
StevenDufresne Dec 4, 2023
cf3a3f4
Hook in another filter.
StevenDufresne Dec 4, 2023
12b7c06
Rename template.
StevenDufresne Dec 4, 2023
29f8205
Some minor updates.
StevenDufresne Dec 4, 2023
c73ed57
Add the month filter
StevenDufresne Dec 4, 2023
9cc0b23
Add in Past Events template
iandunn Dec 4, 2023
5b413d4
update menu links
iandunn Dec 5, 2023
8404ff7
pass filter values to map block
iandunn Dec 5, 2023
5819e91
Add map block. Isn't yet connected to country list.
StevenDufresne Dec 5, 2023
e636d34
Update copy.
StevenDufresne Dec 5, 2023
3e7d9c2
Harmonize spacing.
StevenDufresne Dec 5, 2023
9662871
Make font size smaller for past events.
StevenDufresne Dec 5, 2023
1ee70b1
Update post title spacing.
StevenDufresne Dec 5, 2023
76c027c
Update search layout.
StevenDufresne Dec 5, 2023
55b279c
fix upcoming spacing.
StevenDufresne Dec 5, 2023
55b4e41
Update the filters to show the item count on archives.
StevenDufresne Dec 5, 2023
7b10fbb
Fix the template widths.
StevenDufresne Dec 5, 2023
d3db670
Update event list UI.
StevenDufresne Dec 5, 2023
c26787d
Update the menu text based on designs.
StevenDufresne Dec 5, 2023
855fa57
combine build/watch scripts for convenience
iandunn Dec 5, 2023
0889f6f
use get_events for filtering and caching
iandunn Dec 5, 2023
303e77f
add missing template part
iandunn Dec 5, 2023
0de639a
update upcoming events slug
iandunn Dec 5, 2023
b0c2278
add country filter values
iandunn Dec 5, 2023
9908d41
add all months
iandunn Dec 5, 2023
8796cbb
schedule crons to prime cache
iandunn Dec 6, 2023
47fdebd
apply coding standards
iandunn Dec 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions public_html/wp-content/themes/wporg-events-2023/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ function add_site_navigation_menus( $menus ) {
return array(
'local-navigation' => array(
array(
'label' => __( 'All Events', 'wordcamporg' ),
'label' => __( 'Upcoming events', 'wordcamporg' ),
'url' => '/upcoming/',
),
array(
'label' => __( 'Organize an Event', 'wordcamporg' ),
'label' => __( 'Organize an event', 'wordcamporg' ),
'url' => '/organize-events/',
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace WordPressdotorg\Theme\Events_2023\WordPress_Event_List;

use function WordPressdotorg\MU_Plugins\Google_Map\{get_events};
use function WordPressdotorg\MU_Plugins\Google_Map\{get_events,get_all_upcoming_events};

add_action( 'init', __NAMESPACE__ . '\init' );

Expand Down Expand Up @@ -47,7 +47,7 @@ function render( $attributes, $content, $block ) {
array_walk( $facets, 'sanitize_text_field' );
$facets = array_filter( $facets );

$events = get_events( $attributes['events'], 0, 0, $facets );
$events = get_all_upcoming_events();
iandunn marked this conversation as resolved.
Show resolved Hide resolved

// Get all the filters that are currently applied.
$filtered_events = array_slice( filter_events( $events ), 0, 10);
Copy link
Member

Choose a reason for hiding this comment

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

This is cutting the list off at 10, but we only want that for the homepage. Maybe the block should accept a limit attribute that defaults to 50 or something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, good idea. I was thinking about the grouping as well. Should we pass in a groupyByMonth property? Feels too specific.

Alternatively, we can pass a "heading" property to this list block and create a wrapper block where we use the query results to loop and output multiple instances of the event list block. I'll look at that today.

Expand Down
Loading