WAIT: Relevanssi + Bricks compatibility issue, not showing custom excerpts

Bricks Version: Latest
Browser: Brave
OS: macOS

So I am trying to use Relevanssi – A Better Search – WordPress plugin | WordPress.org with Bricksbuilder, and I have read in the changelog of Bricksbuilder (version 1.3.2) that compatibility between the two was added, therefore I report this problem here, knowing that it is a 3rd party plug-in.

Relevanssi allows me to search through pages and blog posts on my bricks website, so far so good.
I have a custom search page template with a “post element” that is dynamically populated through these fields:
{post_title:link} {post_excerpt}

Now to the problem. When searching with Relevanssi enabled the {post_title:link} field is populated as expected, it shows pages and posts that were indexed.
But Relevanssi should also create a custom post excerpt that will show where the search result comes from. However, this feature seems to not be working properly with Bricks. When the search result is a blog post, it shows the standard post excerpt. When the search result is a page, the {post_excerpt} field stays empty. In either case it seems as if the Relevanssi custom excerpt is somehow not getting through to the Bricks {post_excerpt} field.

I already tried to contact the developer of Relevanssi and he posted the following response Custom Excerpts in Bricksbuilder | WordPress.org
indicating, that Bricks might get the {post_excerpt} data in a way that circumvents the standard way of how Wordpress does it and therefore does not work with Relevanssi.

So my question would be if this is indeed a bug that you guys can reproduce and if so, what possibilities do I have, to use Relevanssi, as the searchability of my page is a key feature.

Warm regards.

3 Likes

Hi! have you solved this issue?

No I haven’t solved it yet, so far I have postponed trying to find a solution but will have to do so soon. Please let me know if you figure out something of help.

2 Likes

@timmse Any news here. I need to create a search results page with Relevanssi Premium, where excerpt texts are also needed!

Could you please give us an update or an ETA for a fix. Need to talk to my client when we can finish the search functionality for him!

Thanks and best regards
Michael

2 Likes

Yea, it would be nice to have a fix at some point. I would also like to improve the search functionality for my client in the future.

1 Like

Is there any update on this?

Hi guys,

So sorry and we missed out on this thread.

Please try to use this snippet for your query if want to support relavanssi on non-search pages.

// Replace the etjffc to your query ID brxe-etjffc => etjffc
add_filter( "bricks/posts/query_vars", function( $query_vars, $settings, $element_id ) {
  
	if( $element_id !== 'etjffc' ) return $query_vars;
	
	$query_vars['relevanssi'] = true;
	return $query_vars;
}, 100, 3);
1 Like