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 :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Portals - change customization of default SEARCH page

(0) ShareShare
ReportReport
Posted on by 5

Hi

I am struggling to remove a whole section form the SEARCH page.  there is a section  called 

<h1 class="section-landing-heading"><div class="xrm-editable-html xrm-attribute" data-cmstemplate-render-url="/_services/portal/7b138792-1090-45b6-9241-8f8d96d8c372/adx_contentsnippet/0ccb8a6f-d924-4925-96cc-987677e95564/__templates/live-preview/L3NlYXJjaC8%3d" data-cmstemplate-url="/_services/portal/7b138792-1090-45b6-9241-8f8d96d8c372/adx_contentsnippet/0ccb8a6f-d924-4925-96cc-987677e95564/__templates/all/L3NlYXJjaC8%3d" data-editable-title="Search/Title" data-editable-url="/_services/portal/7b138792-1090-45b6-9241-8f8d96d8c372/adx_contentsnippet/0ccb8a6f-d924-4925-96cc-987677e95564/adx_value" data-encoded="false" data-filebrowser-dialog-url="~/xrm-adx/filebrowser.html" data-filebrowser-url="/_services/portal/7b138792-1090-45b6-9241-8f8d96d8c372/elFinder/connector" data-label="Search/Title" data-languagecontext="English" data-liquid="true" data-xrm-base="/xrm-adx/"><div class="xrm-attribute-value">Discover contoso</div></div></h1>

I want to get rid of this whole section so i can use the space on the page. 

In the search web template I have added the following code 

<script>
$(document).ready(function(){
$(".section-landing-heading").hide();
});
</script>
But it does not work , I still get the whole white space.. I am newbie here so trying ot learn as i go along , can someone help me how to do that please ...
Currently the page looks like 
pastedimage1575909113524v1.png
doing f12 - and deleting the h1 element I get the below , which is what I am looking for .. 
pastedimage1575909214652v2.png
Any help please .. 
Thanks

I have the same question (0)
  • Suggested answer
    Nicholas Hayduk Profile Picture
    2,863 on at

    Hi,

    Your JavaScript code is fine - I suspect it's where you are putting that is the problem.  If you put it in the Search web template, this will appear in the header of the page, before jQuery is defined, which will cause a script error.

    I'd recommend moving your code to the Custom JavaScript attribute on the localized version of the Search Web Page.  Note that when you add it there, you don't need the <script> tag.

    Nick

  • bikmann Profile Picture
    5 on at

    Hi Thank you for that , I have tried doing what you have suggested, sadly that is not working  :(

     pastedimage1575967226530v1.png

    The part i am trying to get rid of is still visible

    pastedimage1575967419284v2.png

    Thanks 

  • bikmann Profile Picture
    5 on at

    Hi  Nick

    Thank you, I got it working. the code needs to be put in the Content page ..  and it works.

    Thank you for the idea.

    Regards

    Bik

  • cloflyMao Profile Picture
    25,210 on at

    Hi bik,

    If your web page is a rewrite type which custom code couldn't be embedded,

    pastedimage1575972911319v1.png

    Rewrite type couldn't be customized directly.

    pastedimage1575972934786v2.png

    then you could create a global js to detect URL path and then perform custom action:

    function hideElement() {
    
      var url = location.pathname;
    
      if (url.indexOf('search') > -1) {
    
        var header = document.getElementsByClassName('section-landing-heading');
    
        if (header.length > 0) {
          header[0].style.display = 'block';
        } else {
          console.log('no such element');
        } 
    
      }
    
    }
    
    document.addEventListener("DOMContentLoaded", hideElement);

    Regards,

    Clofly

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 72 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 29 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans