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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Portal: search results...
Power Pages
Suggested Answer

Portal: search results page

(1) ShareShare
ReportReport
Posted on by 4
Hi there,
 
We currently have the search results page set up that the results are only listed with their KB-no, instead of the actual title of the knowledge base item.
 
 
If there are multiple results, this is not very user friendly and why we want to change it to contain also the title of the knowledge base item. I found the following in code:
<ul class='search-results'>
{% for result in searchindex.results %}
<li>
<h4>
<a title='{{ result.title | escape }}' href='{{ result.url | escape }}'>{{ result.title }}</a>
</h4>
<p class='fragment'>{{ result.fragment }}</p>
</li>
{% endfor %}
</ul>
 
But I have no idea what to fill in with <a title> so that it also contains the name of the KB item.
 
Any assistance? 
 
Thanks,
Robbert
Categories:
I have the same question (0)
  • Suggested answer
    Fubar Profile Picture
    8,379 Super User 2025 Season 2 on at
    Not sure you will be able to do what you want, it is made more difficult as the results from search itself do not expose all fields on the underlying record and search often is configured to run over multiple record types, see the attributes/properties available
     
    to get additional information you may potentially need to get the Id and entity logical name out of the result and use them to know what table your result is for and then get the additional field data either from the entity object in the results object or to directly reference the underlying record using the id
  • Suggested answer
    Inogic Profile Picture
    1,135 Super User 2025 Season 2 on at
    Hi,
     
    To enhance your search results page in Power Pages (formerly known as Power Apps Portals) by including the title of each Knowledge Base (KB) item alongside its number, you'll need to modify the page template or the code used to render the search results.

    If you're using Liquid templates to render the search results, you can modify the template to include both the KB number and title. Here’s how you might do it:

    {% if search_results %}
      <ul>
        {% for result in search_results %}
          <li>
            <a href="{{ result.url }}" title="{{ result.title }}">
              {{ result.kb_number }}: {{ result.title }}
            </a>
          </li>
        {% endfor %}
      </ul>
    {% else %}
      <p>No results found.</p>
    {% endif %}

    Make sure that the fields you’re referencing (url, title, kb_number) are available in your search results data.

    Hope this helps.
     
    Thanks!
    Inogic Professional Services: Power Platform/Dynamics 365 CRM
    An expert technical extension for your techno-functional business needs
    Drop an email at crm@inogic.com 
    Service: https://www.inogic.com/services/ 
    Tips and Tricks: https://www.inogic.com/blog/ 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 89 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard