CMS Development

WLIQ
Mitglied

Blog search not working

lösung

Hi,

We are experiencing an issue with the blog search functionality on the same blog listing page. I've attached the 'blog_listing_module' file. Is there a custom function available to enable search specifically for blogs on the same page, along with pagination?

Page link: https://blog.tsibinc.com/tsib-blog-2024

Screenshot_19-Feb-29-2024-08-54-38-2239-PM.pngScreenshot_18-Feb-29-2024-08-52-31-2118-PM.png

0 Upvotes
1 Akzeptierte Lösung
evaldas
Lösung
Ratgeber/-in | Platinum Partner
Ratgeber/-in | Platinum Partner

Blog search not working

lösung

Hi @WLIQ 

 

You can include search results on a template by adding the search resutls module:

 

{% module "search_results" path="@hubspot/search_results" %}

 

This can also be customized with code - this article on content search provides additional information.

 

Also, in order to search only blog posts, you would need to add a hidden input field with a value="BLOG_POST".

 

<form action="/tsib-blog-2024/" method="GET">
   <input type="text" id="search_" name="q" value="" placeholder="Search posts, topics and authors...">
   <input type="hidden" name="type" value="BLOG_POST">
   <button type="submit">
    <i class="fa-solid fa-magnifying-glass"></i>
   </button>
</form>

 

Hope this helps!

 


✔️ Did this post help answer your query? Help the community by marking it as a solution.

Lösung in ursprünglichem Beitrag anzeigen

0 Upvotes
1 Antwort
evaldas
Lösung
Ratgeber/-in | Platinum Partner
Ratgeber/-in | Platinum Partner

Blog search not working

lösung

Hi @WLIQ 

 

You can include search results on a template by adding the search resutls module:

 

{% module "search_results" path="@hubspot/search_results" %}

 

This can also be customized with code - this article on content search provides additional information.

 

Also, in order to search only blog posts, you would need to add a hidden input field with a value="BLOG_POST".

 

<form action="/tsib-blog-2024/" method="GET">
   <input type="text" id="search_" name="q" value="" placeholder="Search posts, topics and authors...">
   <input type="hidden" name="type" value="BLOG_POST">
   <button type="submit">
    <i class="fa-solid fa-magnifying-glass"></i>
   </button>
</form>

 

Hope this helps!

 


✔️ Did this post help answer your query? Help the community by marking it as a solution.

0 Upvotes