Hi
I have a requirement in Dynamics Portal to show knowledge articles search list that users can then filter by category. I'm want to achieve something similar to https://www.samsung.com/uk/support/model/SM-G991BZIGEUA/ where the left side bar contains categories that then dynamically filter the displayed articles list - all on same page.
I know this will be a custom page and can use FetchXML to get the articles and their categories but are not sure how to implement the filtering feature. Any help on how to achieve this (if possible including code) is greatly appreciated.
Thanks in advance.
Hi JasR
Look at what is actually being done for the Customer Self Service. There are 2 main Web templates being utilised:
Knowledge Base - Home: this lists the categories and creates URLs that pass the category number to the child page
Category Details: this receives the category number in the id parameter, which is then used to end up getting the GUID of the actually category (this is then substituted into the FetchXML query to retrieve the collection of articles).
These are two pieces of code that involve categories as well as knowledge base articles, maybe you can refer it:
{% extends 'layout_1_column' %}
{% block main %}
{% include 'Page Copy' %}
{% assign category_url = sitemarkers['Category'].url %}
{% assign count = count | default: 0 %}
{% assign categories = knowledge.categories | top_level: count %}
{% if categories %}
{{ article.description | escape }}{% extends 'Layout 1 Column' %}
{% block breadcrumbs %}
{% assign categoryid = request.params['id'] %}
{% if categoryid %}
{% assign category = knowledge.categories | category_number: categoryid %}
{% if category %}
{% assign pagetitle = category.title %}
{% assign categoryguid = category.categoryid %}
{% else %}
{% assign pagetitle = resx["Knowledge_Article_Unavailable"] %}
{% endif %}
{% endif%}
{% include 'Breadcrumbs' title: pagetitle %}
{% endblock %}
{% block title %}
{% include 'Page Header' title: pagetitle %}
{% endblock %}
{% block main %}
{% include 'Page Copy' %}
{% assign category_url = sitemarkers['Category'].url %}
{% assign portallanguagecode = website.selected_language.code %}
{% if categoryguid %}
{% fetchxml knowledgearticlecategory_query %}
{% if portallanguagecode %}
{% endif %}
{% endfetchxml %}
{% assign articles = knowledgearticlecategory_query.results.entities %}
{% if articles.size > 0 %}
{% for article in articles %}
{% endif %}
{% include 'Category - Related Categories' categoryguid: categoryguid %}
{% else %}
Regards,
Leah Ju
Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,188 Super User 2024 Season 2
Martin Dráb 230,030 Most Valuable Professional
nmaenpaa 101,156