web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Portals Search Bar not working

(0) ShareShare
ReportReport
Posted on by 40

Hi,

I'm doing some work on a portal for a customer and I have one issue with the search bar on the home page. The search bar is on the page in the Page Template that the Home Page is using and is added by a line of liquid, {% include 'Search' %}. 

When I press enter or pressing on the magnify glass button after typing in the search term, my expectation is that it would redirect, with my query text to the /search page (something like this, /search/?logicalNames=&q=testing). Thats not the case as the page just refreshes when submitting the search.

Is there some additional code I need to put in the liquid tag to display the search box?

We have made some small changes to the home page template, but I'd like to think we haven't broken that function.

Thanks

Kevin

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Kevin,

    OOB, the search lookup is on the home web template which is controlled by the setting 'Search/Enabled'. And it works as mentioned by you i.e. on click/ enter redirects to search/?logicalname...

    Below is the oob home web template... take a copy of your current home web tenplate and try this to see if it works. If it does work then you can compare the versions and figure out what is missing... hope this helps.

    Home Web Template

    ==========================

    {% assign forums_sm = sitemarkers["Forums"] %}

    <section class="page_section section-landing">

     <div class="container">

       <div class="row ">

         <div class="col-md-12">

           <h1 class="section-landing-heading">{% editable snippets 'Home/Title' default: 'Contoso' %}</h1>

           <h2 class="section-landing-sub-heading">{% editable snippets 'Home/Subtitle' default: 'Customer' %}</h2>

           {% include 'Search' %}

         </div>

       </div>

     </div>

     <div class="layer_down"> </div>

    </section>

    <section class="page_section section-knowledge">

     <div class="layer_up"> </div>

     <div class="container">

       <div class="content-home">

         <h2 class="blue_border">{% editable snippets "Home/MostPopularHeading" default: resx["Most_Popular"] %}</h2>

         {% include 'Knowledge Management - Most Popular Articles' showdescription: true %}

       </div>

       <div class="row sidebar-home no-lr-margins">

         <div class="col-md-4">{% include 'Knowledge Management - Most Popular Articles' showdescription: false %}</div>

         <div class="col-md-4">{% include 'Knowledge Management - Most Recent Articles' %}</div>

         <div class="col-md-4">{% include 'Knowledge Management - Top Rated Articles' %}</div>

       </div>

     </div>

    </section>

    <section class="page_section section-sub-landing color-inverse">

     <div class="container">

       <div class="row">

         <div class="col-md-4 text_center-mobile">

           <h1>{{ forums_sm.adx_name | escape }}</h1>

           {% editable snippets "Forum/HomeDescription" %}

           <a href="{{ forums_sm.url | h }}" class="btn btn-info-home btn-lg-home" title="{{ snippets['Home/ViewMoreButton'] | default: resx['View_More'] | h }}">{{ snippets['Home/ViewMoreButton'] | default: resx['View_More'] | h }}</a>

         </div>

       </div>

     </div>

    </section>

    ==========================

  • Kevin Annfield Profile Picture
    40 on at

    Hey Ravi,

    Thanks for the info and the copy of the standard home page web template. This is nearly the same as the one I already have but I do have an additional include statement

    {% include "Custom Layout 1 Column" %}

    After some investigation this line is the cause of my issues...if I remove the line the search bar works correctly, if I add it back in the search fails again.

    This points to another Web Template which has the contents below.

    I don't have enough experience to know whats wrong with the below but assume there is something wrong with it. Any ideas?

    <div class="container">
     <div class="row" id="contents">
      <div class="col-md-12">
       {% block main %}
        <!--{% include 'Page Copy' %}-->
        
        {% if page.adx_entitylist %}
               {% include 'entity_list' key:page.adx_entitylist.id %}
            {% endif %}
            
            {% if page.adx_entityform %}
              {% entityform id: page.adx_entityform.id %}
            {% endif %}
            
            {% if page.adx_webform %}
              {% webform id: page.adx_webform.id %}
            {% endif %}
       {% endblock %}
      </div>
     </div>
    </div>
  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Where exactly you have that include statement in your template? Is it under some if condition or just at the top? I am not sure whats wrong here but interested to try at my end as well ?

  • Kevin Annfield Profile Picture
    40 on at

    Here is my Home Page web template. Its on line 21.

    Cheers

    {% assign forums_sm = sitemarkers["Forums"] %}

    <section class="page_section section-landing">

    <div class="container">

       <div class="row ">

         <div class="col-md-12">

           <h1 class="section-landing-heading">{% editable snippets 'Home/Title' default: 'Contoso' %}</h1>

           <h2 class="section-landing-sub-heading">{% editable snippets 'Home/Subtitle' default: 'Customer' %}</h2>

           {% include 'Search' %}

         </div>

       </div>

     </div>

     <div class="layer_down"> </div>

    </section>

    <section class="page_section section-knowledge">

     <div class="layer_up"> </div>

     <div class="container">

       <div class="content-home">

         <h2 class="blue_border">{% editable snippets "Home/MostPopularHeading" default: resx["Most_Popular"] %}</h2>

         <!-- {% include 'Knowledge Management - Most Popular Articles' showdescription: true %} -->

         {% include "Custom Layout 1 Column" %}

       </div>

       <div class="row sidebar-home no-lr-margins">

         <div class="col-md-4">{% include 'Knowledge Management - Most Popular Articles' showdescription: false %}</div>

         <div class="col-md-4">{% include 'Knowledge Management - Most Recent Articles' %}</div>

         <div class="col-md-4">{% include 'Knowledge Management - Top Rated Articles' %}</div>

       </div>

     </div>

    </section>

    <section class="page_section section-sub-landing color-inverse">

     <div class="container">

       <div class="row">

         <div class="col-md-4 text_center-mobile">

           <h1>{{ forums_sm.adx_name | escape }}</h1>

           {% editable snippets "Forum/HomeDescription" %}

           <a href="{{ forums_sm.url | h }}" class="btn btn-info-home btn-lg-home" title="{{ snippets['Home/ViewMoreButton'] | default: resx['View_More'] | h }}">{{ snippets['Home/ViewMoreButton'] | default: resx['View_More'] | h }}</a>

         </div>

       </div>

     </div>

    </section>

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Kevin,

    I tried the same templates and it is working fine for me. I even added a span tag (Ravina) under the custom template to verify if the home template is actually loading the custom template or not and it is working as expected. There must be something else.

    Here is my test portal i tried on testportalnov.microsoftcrmportals.com

    Try clearing cache and see if it works.

  • Kevin Annfield Profile Picture
    40 on at

    Thanks for trying it out. I’ll check it out again on Monday.

    Thanks again for your help. Say hi to Una for me too!

    Kev

  • nickmangioros Profile Picture
    470 on at

    Hi,

    Can you let me know if you have the original source code that goes in the Home page of the website in Customer portal

    Path:  Dynamics 365>Portals>Web Templates>Home> Source

    A co-worker modified it and no longer works so I wanted to put it back as the original.
    Thanks for your help

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans