⚙️ Displaying Articles in OmniChat

šŸ“š Discover how to manage user visibility, notifications, and login verification in OmniChat. Learn to configure real-time updates, automated offline status, and integrate knowledge base articles effectively.

šŸ’” PRO TIP: Click here to hire an expert to guide you in the step by step. Book a call now to learn all the tips and tricks for training your AI, or let us handle it all for you instead.

Learn how to display articles in the OmniChat dashboard, share them in chat conversations, or show them on a dedicated page. This guide covers various methods, including API integration and JavaScript.

 

Knowledge base articles provide instant answers to customers to help reduce customer support volume. You can access the articles from the left OmniChat menu.

Display articles #

  • The articles can be shown in the chat dashboard by enabling them fromĀ Settings > Articles > Display in dashboard.

  • Alternatively, articles can be shared in any chat conversation via the rich message shortcode,Ā [articles].
  • The articles can be shown in a dedicated page in three ways:
    • REST API METHOD
      Insert the code below into your page. ReplaceĀ [YOUR-TOKEN] with your token. You can find your token entering to your OmniChat account.
    • <div id=“sb-articles”>
      <?php
      $ch
      = curl_init(‘https://omnichat.planifyx.com/include/api.php’ . (empty($_GET[‘category’]) ? (empty($_GET[‘article_id’]) ? (empty($_GET[‘search’]) ? : ‘?search=’ . $_GET[‘search’]) : ‘?article_id=’ . $_GET[‘article_id’]) : ‘?category=’ . $_GET[‘category’]));
      $parameters
      = [
      CURLOPT_RETURNTRANSFER
      => true,
      CURLOPT_SSL_VERIFYPEER
      => false,
      CURLOPT_USERAGENT
      => ‘OmniChat’,
      CURLOPT_POST
      => true,
      CURLOPT_CONNECTTIMEOUT
      => 5,
      CURLOPT_POSTFIELDS
      => http_build_query([
      ‘token’=> ‘[YOUR-TOKEN]’,
      ‘function’ => ‘init-articles’
      ])
      ];
      curl_setopt_array
      ($ch, $parameters);
      $response
      = curl_exec($ch);
      curl_close
      ($ch);
      echo $response
      ;
      ?>
      </div>
    • Include the attibureĀ nojquery => trueĀ if you already have jQuery included in your page.
    • JS METHOD
      Insert the codeĀ <script>var SB_ARTICLES_PAGE = true;</script><div id=”sb-articles” class=”sb-loading”></div>Ā into any page showing the chat. If you’re using the WordPress version you can use the shortcodeĀ [sb-articles]. This method is not recommended as the as the articles are loaded asynchronously and the page may not be indexed by search engines.

    The articles will be shown in the same location of the code above. You can hide the chat widget by adding the JS codeĀ var SB_DISABLED = true;to the page.

For more details, you can ask the AI here.

ChangeĀ articlesĀ with the name of your articles page and set the articles page URL inĀ Settings > Articles > Articles page URL.

More information #

 

  • Translate the categories fromĀ Settings > TranslationsĀ by adding the translation name and its translation. The original translation name must be in English.

  • If you use categories, all the articles must be assigned to a category.
  • If there is at least one translated article in the user’s language, only the translated articles are displayed.
  • If some block is not saved, e.g. text block, disable all browser extentions and try again.
  • Articles are synchronized automatically with the Dialogflow knowledge base if the Artificial Intelligence app is installed.
  • You can create an internal chat link to an article with theĀ button rich message.
  • You can create a link to a specific article with the URL attributeĀ article=ID, replaceĀ ID with the article ID. Example: “https://planifyx.com/articles-demo?article=Ucsx6.”
  • You can create a link to an article category with the URL attributeĀ category=ID, replaceĀ ID with the category ID. Example: “https://planifyx.com/articles-demo?category=LnNaZ.”
  • The articles are always included into the training of yourĀ OpenAIĀ chatbot.

If you have additional doubts, remember that you can always contact us.