CMS Development

kchung
Member

Site Search Input module

SOLVE

Hello,

I am not a developer and I was hoping someone could tell me if I have tweaked the following code correctly for the SITE SEARCH INPUT module. Here is a section of code from the Site Search Input module:

 

<input type="text" class="hs-search-field__input" name="term" autocomplete="off" aria-label="{{ module.field_label || "Search" }}" placeholder="{{ module.placeholder }}">
        
        {% if module.content_types.website_pages %}
          <input type="hidden" name="type" value="SITE_PAGE">
          <input type="hidden" name="property" value="title">
          <input type="hidden" name="property" value="description">
        {% endif %} 

I added the two new input "property" lines under "SITE_PAGE".

 

Does this make the search look for the key phrases in the webpage's title and meta descriptions only? And is this coded properly?

 

I am just trying to streamline the search results so that it does not return too many irrelevant results from the ENTIRE webpage, or from the main menu, etc.

 

0 Upvotes
1 Accepted solution
acurtwright
Solution
HubSpot Employee
HubSpot Employee

Site Search Input module

SOLVE

Hi @kchung , the snippet you linked from the Site Search module appears to be coded correctly. Are you seeing any unexpected behavior on your end when entering search queries into your site?

View solution in original post

0 Upvotes
2 Replies 2
acurtwright
Solution
HubSpot Employee
HubSpot Employee

Site Search Input module

SOLVE

Hi @kchung , the snippet you linked from the Site Search module appears to be coded correctly. Are you seeing any unexpected behavior on your end when entering search queries into your site?

0 Upvotes
kchung
Member

Site Search Input module

SOLVE

Thank you @acurtwright - the search results seem to be fine. I was just wondering if the code was implemented properly.

0 Upvotes