List & Filter recipes


Requires the List & Filter module enabled and activated on the map.

Show the Progress Map search form inside the list filter area

Some builds let you surface the core address / radius search inside List & Filter’s filter column. In List & Filter settings / tutorials options for the map, enable the option to display Progress Map’s search form within the filter area (wording varies slightly by version). Save and test on the front end.

If the control is missing, place [cspm_main_map] search tools via map settings and keep List & Filter’s own keyword/taxonomy filters for directory facets.

Add HTML before/after list item titles

add_filter( 'cspml_before_listing_title', function ( $html, $post_id, $map_id, $view ) {
	return '<span class="badge">New</span> ';
}, 10, 4 );

add_filter( 'cspml_after_listing_title', function ( $html, $post_id, $map_id, $view ) {
	return ' <small class="meta">' . esc_html( get_post_meta( $post_id, 'city', true ) ) . '</small>';
}, 10, 4 );

Change list / grid item description

add_filter( 'cspml_list_item_description', function ( $details, $post_id ) {
	return '<p>' . esc_html( get_the_excerpt( $post_id ) ) . '</p>';
}, 10, 2 );

add_filter( 'cspml_grid_item_description', function ( $details, $post_id ) {
	return '<p>' . esc_html( get_the_excerpt( $post_id ) ) . '</p>';
}, 10, 2 );

For a fully custom card, see cspml_custom_listing_item in the List & Filter module.

Close the map on page load

Useful for list-first mobile layouts. In List & Filter / layout settings, enable the option to start with the map closed (or collapsed), or use the module’s documented “close map on load” setting when present.

Related

Top