Skip to main content

Notifications

Announcements

No record found.

Customer Service forum
Answered

Custom Portal - How to display Knowledge article from Category Details Web Page ?

Posted on by 40

Hi,

I am using a custom portal and would like to add knowledge base on it in the navbar.

I tried to follow how it was done in Self-service portal by creating same records. However I come to a point where I can display category details page but can't access to an article : 

custom-portal-article-href-empty.png

HTML href tag is empty.

If we look into self-service portal, HTML href tag is filled with <a href="/knowledgebase/article/KA-01... class="title">TEST ARTICLE</a>. 

How could I achieve that in custom portal ? I don't know very much about Liquid but from what I read the liquid code in the category details web template doesn't include article detail page. 

Categories:
  • Mico365 Profile Picture
    Mico365 5 on at
    RE: Custom Portal - How to display Knowledge article from Category Details Web Page ?

    Hello Alex, can you share your solution with this? I'm currently experiencing the same issue you encountered. Thanks

  • Alex519 Profile Picture
    Alex519 40 on at
    RE: Custom Portal - How to display Knowledge article from Category Details Web Page ?

    Hi LA,

    Thank you for your reply and details for the two web templates.

    It worked well after adding sitemarkers for children web pages but I am still trying to figure out how.

    There is no sitemarker mentioned in  web templates code for article. "category_url" seems not to be used as well.

    Also, where can I find the resx content ?

    Regards,

  • Verified answer
    Fubar Profile Picture
    Fubar 2,750 on at
    RE: Custom Portal - How to display Knowledge article from Category Details Web Page ?

    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)

    Note: there are several other preconditions for the existing templates, Articles must be set to not be Internal only, Articles must be published, Articles must have at least 1 Category assigned to them, the Article language must match the Portal language, Portal user must have privileges to read category and knowledge articles.

    Also, articles can be slow to sync to the Portal, and sometimes you may need to manually reset the search index (<your portal>/_services/about )

    {% 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 %}
        
    {% for category in categories %} {{ category.title }} {% endfor %}
    {% endif %} {% endblock %}

    {% 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 %}
          
        {% endif %}
        
        {% include 'Category - Related Categories' categoryguid: categoryguid %}
      {% else %}
        
    {% editable snippets "KnowledgeManagement/ArticleUnavailableMessage" %}
    {% endif %} {% endblock %}

  • Alex519 Profile Picture
    Alex519 40 on at
    RE: Custom Portal - How to display Knowledge article from Category Details Web Page ?

    Hi Leah,

    Actually my question was more about configuring the knowledge base in a custom portal using Liquid, web template, web pages, snippet, site markers etc .. since the configuration is only partial. Web template for example doesn't exist, so I did create a custom web template from what I saw on the self-service portal for which knowledge is already configured.

    However regarding the custom portal, I am facing an issue to display articles because of my lack of Liquid Knowledge.

    So I have some difficulties to understand how knowledge base is handle in Portal.

    I see this code (below) which shows how articles are displayed but I have a behavior in portal that shows nothing when clicking on a category hyperlink. The page just refreshed itself.

    Custom-portal-_2D00_-knowledge-base-for-articles.PNG

    Do you have any idea on what I am missing ?

    Regards

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Custom Portal - How to display Knowledge article from Category Details Web Page ?

    Hi Alex519,

    In fact, just category can list on the page, you need first associate article to one category, then click this category on the portal you will see articles, just like this:

    (1) open one article in customer service hub, select Associate Category.

    pastedimage1606208199732v1.png

    (2) click this category on the portal.

    pastedimage1606208212040v2.png

    (3) you will see:

    pastedimage1606208224808v3.png

    You can refer following to Configure and manage category:

    https://docs.microsoft.com/en-us/dynamics365/portals/configure-knowledge-categories-articles

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • CRMJetty Profile Picture
    CRMJetty 3,508 on at
    RE: Custom Portal - How to display Knowledge base ?

    Hello,

    pls refer this link

    https://docs.microsoft.com/en-us/dynamics365/portals/configure-knowledge-categories-articles

    also pls refer this video,

    https://www.youtube.com/watch?v=zz7mNOpkWdQ

    I hope it helps,

    Thanks.

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,989 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,588 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans