7Implement Knowledge Advanced on Customer Portal

Overview of Knowledge Advanced Implementation

You can implement Knowledge Advanced in Customer Portal to enable self-service users to quickly get answers to their questions without contacting your support team. They can search for additional information, rate the answers that they get, and if needed, escalate a question by submitting it to the support organization. You can implement Knowledge Advanced in a new instance or in an existing instance using the Knowledge Advanced reference implementation files.

The reference implementation is a set of PHP files that you can use to implement knowledge features. The reference implementation is located at cp/src/core/framework/views/pages/okcs/.

You must implement the Knowledge Advanced search (OKCSSearch) and browse (OKCSBrowse) functionality on different pages. Search and browse functions use different data sources. The widgets that implement search, browse, and other related functions, such as results pagination, use unique source IDs to reference these data sources. If you implement both search and browse functions on a single page, a source ID conflict may occur.

Before You Start

Here are some things you should make sure you have done before you start implementing.

  • Enable the MOD_CP_DEVELOPMENT_ENABLED configuration setting to make changes to your Customer Portal development site. You can find more information about enabling this setting in Using B2C Service.

  • Set up a WebDAV connection to manage your development site files. You can find more information about connecting to a Customer Portal site using WebDAV in Using B2C Service.

  • Create a backup copy of your files using WebDAV. Navigate to cp/customer/development/views and download all the folders. You can find more information about downloading files in Using B2C Service.

  • Update widgets to the latest version. See Update Widgets for more information.

  • Make sure you created and published articles in at least one content type so that search results are available.

Implement Knowledge Advanced in a New Customer Portal Instance

You can enable Knowledge Advanced in a new Customer Portal instance by replacing the standard Customer Portal files with the Knowledge Advanced reference implementation files.

You can enable Knowledge Advanced in a new instance by replacing the standard pages in your development folder with the Knowledge Advanced reference implementation pages. You can replace the standard pages by downloading the reference implementation, copying them into your site, configuring the pages, and promoting the new implementation to production.

Download the Reference Implementation

Download the folder that contains the Knowledge Advanced reference implementation pages.

  1. Connect your Customer Portal site through WebDav.

  2. Download the okcs folder from here:

    /cp/core/framework/views/pages/

Replace the Customer Portal Standard Pages

Replace the standard pages in your current instance with the reference implementation pages.

  1. Copy the reference implementation pages from the okcs folder.

  2. Place them here:

    /cp/customer/development/views/pages/

Add the Knowledge Advanced Look and Feel

Add the reference implementation templates to your current instance to update the look and feel for page style, navigation menu, and search results.

  1. Copy the okcs_standard.php and okcs_mobile.php template files from here:

    /cp/core/framework/views/templates/okcs
  2. Place the template files here:

    /cp/customer/development/views/templates/

Promote Changes to Go Live

Stage your current instance pages to see how your changes will appear on the production site. Then, promote the changes to production so your users can begin using them.

  1. Go to the Customer Portal administration page (https://<your_site>/ci/admin/), click Development Mode from the dashboard. The Customer Portal site opens in the development mode.

  2. Preview your development pages to verify your changes in the development mode.

  3. Promote your changes to stage and production from the Customer Portal administration page.

You can find more information about staging and promoting changes into production in Using B2C Service.

Implement Knowledge Advanced in an Existing Customer Portal Instance

You can implement Knowledge Advanced in an existing instance by replacing or modifying the standard files in your development folder with the Knowledge Advanced reference implementation files.

You can preserve your customized pages by modifying only the specific lines of code required to implement Knowledge Advanced. You can use the reference implementation pages as examples on how to modify the pages instead of replacing them. You must promote your changes to production so that users can begin using them.

You can find more information about staging and promoting changes into production in Using B2C Service.

Add the Knowledge Advanced Look and Feel

You must replace or edit the standard template in your existing instance to add the Knowledge Advanced look and feel for page style, navigation menu, search results, and the password page. You can implement the look and feel using either of the following methods:
  • Replace the standard template in your existing instance with the reference implementation standard template.

  • Edit the standard template in your existing instance to include code from the reference implementation standard template.

Replace the Standard Template

Replace the standard template with the reference implementation standard template.

  1. Copy the implementation standard template from here:

    /cp/core/framework/views/templates/okcs/okcs_standard.php
  2. Place it here:

    /cp/customer/development/views/templates/

Edit the Standard Template

Edit the standard template to include code from the reference implementation standard template and rename the modified template file.

  1. Edit the file:

    cp/customer/development/views/templates/standard.php
  2. Add the style sheet by changing this line:

    <rn:theme path="/euf/assets/themes/standard" css="site.css"/>
    to:
    <rn:theme path="/euf/assets/themes/standard" css="site.css, okcs.css"/>
  3. Add search by changing this line:

    <rn:widget path="search/SimpleSearch" report_page_url="/app/results"/>
    to:
    <rn:widget path="search/OkcsSimpleSearch" icon_path="" report_page_url="/app/search"/>
  4. Modify the navigation menu by changing this code:

    <ul class="rn_NavigationMenu">
       <li>
          <rn:widget path="navigation/NavigationTab" label_tab="#rn:msg:SUPPORT_HOME_TAB_HDG#" link="/app/#rn:config:CP_HOME_URL#" pages="home"/>
       </li>
       <li>
          <rn:widget path="navigation/NavigationTab" label_tab="#rn:msg:ASK_QUESTION_HDG#" link="/app/ask" pages="ask, ask_confirm"/>
       </li>
       <li>
          <rn:widget path="navigation/NavigationTab" label_tab="#rn:msg:COMMUNITY_HOME_LBL#" link="/app/social/home" pages="social/home"/>
       </li>
    </ul>
    to:
    <ul class="rn_NavigationMenu">
       <li>
          <rn:widget path="navigation/NavigationTab" label_tab="#rn:msg:SUPPORT_HOME_TAB_HDG#" link="/app/#rn:config:CP_HOME_URL#" pages="home"/>
       </li>
       <rn:condition config_check="OKCS_ENABLED == true">
          <li>
             <rn:widget path="navigation/NavigationTab" label_tab="#rn:msg:ANSWERS_HDG#" link="/app/browse" pages="browse, answers/list, answers/detail, answers/intent, answers/answer_view, search"/>
          </li>
       <rn:condition_else>
          <li>
             <rn:widget path="navigation/NavigationTab" label_tab="#rn:msg:ANSWERS_HDG#" link="/app/search" pages="answers/list, answers/detail, answers/intent, answers/answer_view, search"/>
          </li>
       </rn:condition>
       <li>
          <rn:widget path="navigation/NavigationTab" label_tab="#rn:msg:ASK_QUESTION_HDG#" link="/app/ask" pages="ask, ask_confirm"/>
       </li>
    </ul>
  5. Modify the password login by adding this code:

    sub:login:create_account_fields="Contact.Emails.PRIMARY.Address;Contact.Login;Contact.NewPassword;Contact.FullName"
    after this line:
    sub:input_Contact.NewPassword:label_input="#rn:msg:PASSWORD_LBL#"
  6. Rename the template file to:

    okcs_template.php

Add Knowledge Advanced Search to the Home Page

You can add the Knowledge Advanced search (OKCSSearch) functionality so that users can search for knowledge base articles. You can implement the Knowledge Advanced search functionality in the support home ( home.php) page using either of the following methods:
  • Replace the home page in your existing instance with the reference implementation home page.

  • Edit it the home page in your existing instance to include code from the reference implementation home page.

Replace the Home Page

Replace the home page with the reference implementation home page.

  1. Copy the reference implementation home page from here:

    /cp/core/framework/views/pages/okcs/home.php
  2. Place it here:

    /cp/customer/development/views/pages/

Edit the Home Page

Edit the home page to include code from the reference implementation home page.

  1. Edit the file:

    cp/customer/development/views/pages/home.php
  2. Replace Knowledge Foundation search with Knowledge Advanced search by changing this line:

    <rn:container source_id="KFSearch">
    to:
    <rn:container source_id="OKCSSearch">
  3. Add both the recent searches and the suggested searches widgets by replacing this code:

    <rn:widget path="searchsource/SourceSearchButton" search_results_url="/app/results"/>
    with:
    <rn:widget path="okcs/RecentSearches"/>
    <rn:widget path="okcs/OkcsSuggestions"/>
    <rn:widget path="searchsource/SourceSearchButton" initial_focus="true" search_results_url="/app/results"/>
  4. Add the knowledge product and category selector by changing this line:

    <rn:widget path="navigation/VisualProductCategorySelector" numbered_pagination="true"/> 
    to:
    <rn:widget path="okcs/OkcsVisualProductCategorySelector" numbered_pagination="true"/>
  5. Add both the popular answers and the recent answers widgets by adding this code:

    <div class="rn_PopularKB">
       <div class="rn_Container">
         <rn:widget path="okcs/AnswerList" type="popular" target="_self" view_type="list"/>
       </div>
    </div>
    <div class="rn_PopularKB rn_RecentKB">
       <div class="rn_Container">
         <rn:widget path="okcs/AnswerList" type="recent" target="_self" view_type="list"/>
       </div>
    </div>
    after this code:
    <div class="rn_PageContent rn_Home">
       <div class="rn_Container">
         <rn:widget path="okcs/OkcsVisualProductCategorySelector" numbered_pagination="true"/>
       </div>

Here’s an example of the reference implementation home page:

<rn:meta title="#rn:msg:SHP_TITLE_HDG#" template="okcs_standard.php" clickstream="home"/>
<div class="rn_Hero">
    <div class="rn_HeroInner">
        <div class="rn_HeroCopy">
            <h1>#rn:msg:WERE_HERE_TO_HELP_LBL#</h1>
        </div>
        <div class="rn_SearchControls">
            <h1 class="rn_ScreenReaderOnly">#rn:msg:SEARCH_CMD#</h1>
            <form method="get" action="/app/results">
                <rn:container source_id="OKCSSearch">
                    <div class="rn_SearchInput">
                        <rn:widget path="searchsource/SourceSearchField" initial_focus="true" label_placeholder="#rn:msg:ASK_A_QUESTION_ELLIPSIS_MSG#"/>
                    </div>
                    <rn:widget path="okcs/RecentSearches"/>
 <rn:widget path="okcs/OkcsSuggestions"/>
                    <rn:widget path="searchsource/SourceSearchButton" initial_focus="true" search_results_url="/app/results"/>
                </rn:container>
            </form>
        </div>
    </div>
</div>
<div class="rn_PageContent rn_Home">
    <div class="rn_Container">
        <rn:widget path="okcs/OkcsVisualProductCategorySelector" numbered_pagination="true"/>
    </div>
    <div class="rn_PopularKB">
        <div class="rn_Container">
            <rn:widget path="okcs/AnswerList" type="popular" target="_self" view_type="list"/> 
        </div>
    </div>
    <div class="rn_PopularKB rn_RecentKB">
        <div class="rn_Container">
            <rn:widget path="okcs/AnswerList" type="recent" target="_self" view_type="list"/>		
        </div>
    </div>
</div>

Replace or Edit the Account Overview Page

You can replace or edit the account overview (overview.php) page so that users can view their support questions and content recommendations. Your users can also update their account settings, change their password, manage answer notifications, and manage content type notifications using the account overview page.

You can implement Knowledge Advanced notifications on the account overview page using either of the following methods:
  • Replace the overview page in your current instance with the reference implementation overview page.

  • Edit the overview page in your current instance to include code from the reference implementation overview page.

Replace the Account Overview Page

Replace the account overview page with the reference implementation overview page.

  1. Copy the reference implementation overview page from here:

    /cp/core/framework/views/pages/okcs/account/overview.php
  2. Place it here:

    /cp/customer/development/views/pages/account/

Edit the Account Overview Page

Edit the account overview page to include code from the reference implementation overview page.

  1. Edit the file:

    /cp/customer/development/views/pages/account/overview.php
  2. Add manage content recommendations by adding this code:

    <div id="rn_LoadingIndicator" class="rn_Browse">
       <rn:widget path="okcs/LoadingIndicator"/>
    </div>
       <rn:container source_id="OKCSBrowse">
          <div class="rn_HeaderContainer">
             <h2>a class="rn_Profile" href="/app/account/recommendations/list#rn:session#">#rn:msg:MY_RECOMMENDATIONS_LBL#</a></h2>
          </div>
          <div id="rn_OkcsManageRecommendations">
             <rn:widget path="okcs/OkcsManageRecommendations"/>
             <a href="/app/account/recommendations/list#rn:session#">#rn:msg:SEE_ALL_RECOMMENDATIONS_LBL#</a>
          </div>
       </rn:container>

    after this code:

    <div class=”rn_ContentDetail”>
  3. Remove social discussion notifications by removing this code:

    <div class="rn_Discussions">
       <rn:container report_id="15156" per_page="4">
          <div class="rn_HeaderContainer">
             <h2><a class="rn_Discussions" href="/app/social/questions/list/author/#rn:profile:socialUserID#/kw/*#rn:session#">#rn:msg:MY_DISCUSSION_QUESTIONS_LBL#</a></h2>
          </div>
          <rn:widget path="reports/Grid" static_filter="created_by=#rn:profile:socialUserID#" label_caption="<span class='rn_ScreenReaderOnly'>#rn:msg:YOUR_RECENTLY_SUBMITTED_DISCUSSIONS_LBL#</span>"/>
          <a href="/app/social/questions/list/author/#rn:profile:socialUserID#/kw/*#rn:session#">#rn:msg:SEE_ALL_MY_DISCUSSION_QUESTIONS_LBL#</a>
       </rn:container>
    </div>
  4. Add the content type notifications link in the side rail (<div class=”rn_SideRail”>) section by adding this line:

    <li>a href="/app/account/notif/content_type_list#rn:session#">#rn:msg:MANAGE_YOUR_CONTENT_TYPE_NOTIFICATIONS_LBL#</a></li>

Here’s an example of the reference implementation account overview page:

<rn:meta title="#rn:msg:ACCOUNT_OVERVIEW_LBL#" template="okcs_standard.php" login_required="true" force_https="true"/>
<div class="rn_Hero">
    <div class="rn_Container">
        <h1>#rn:msg:ACCOUNT_OVERVIEW_LBL#</h1>
    </div>
</div>
<div class="rn_PageContent rn_AccountOverview rn_Container">
    <div class="rn_ContentDetail">
        <div class="rn_Questions">
            <rn:container report_id="196" per_page="4">
                <div class="rn_HeaderContainer">
                    <h2><a class="rn_Questions" href="/app/account/questions/list#rn:session#">#rn:msg:MY_SUPPORT_QUESTIONS_LBL#</a></h2>
                </div>
                <rn:widget path="reports/Grid" label_caption="<span class='rn_ScreenReaderOnly'>#rn:msg:YOUR_RECENTLY_SUBMITTED_QUESTIONS_LBL#</span>"/>
                <a href="/app/account/questions/list#rn:session#">#rn:msg:SEE_ALL_MY_SUPPORT_QUESTIONS_LBL#</a>
            </rn:container>
        </div> 
    <div id="rn_LoadingIndicator" class="rn_Browse">
        <rn:widget path="okcs/LoadingIndicator"/>
    </div>
    <rn:container source_id="OKCSBrowse">
        <div class="rn_HeaderContainer">
            <h2><a class="rn_Profile" href="/app/account/recommendations/list#rn:session#">#rn:msg:MY_RECOMMENDATIONS_LBL#</a></h2>		 
        </div>
        <div id="rn_OkcsManageRecommendations">
            <rn:widget path="okcs/OkcsManageRecommendations"/>
            <a href="/app/account/recommendations/list#rn:session#">#rn:msg:SEE_ALL_RECOMMENDATIONS_LBL#</a>
        </div>
    </rn:container>
</div>
<div class="rn_SideRail">
    <div class="rn_Well">
        <h3>#rn:msg:LINKS_LBL#</h3>
        <ul>
            <li>a href="/app/account/profile#rn:session#">#rn:msg:UPDATE_YOUR_ACCOUNT_SETTINGS_CMD#/a>/li>
            <rn:condition external_login_used="false">
                <rn:condition config_check="EU_CUST_PASSWD_ENABLED == true">
                    <li><a href="/app/account/change_password#rn:session#">#rn:msg:CHANGE_YOUR_PASSWORD_CMD#</a>/li>
                </rn:condition>
            </rn:condition>
            <li><a href="/app/account/notif/list#rn:session#">#rn:msg:MANAGE_YOUR_NOTIFICATIONS_LBL#</a></li>
            <li><a href="/app/account/notif/content_type_list#rn:session#">#rn:msg:MANAGE_YOUR_CONTENT_TYPE_NOTIFICATIONS_LBL#</a></li>
            <rn:condition is_active_social_user="true">
                    <li><a href="/app/public_profile/user/#rn:profile:socialUserID#">#rn:msg:VIEW_YOUR_PUBLIC_PROFILE_LBL#</a></li>
            </rn:condition>
        </ul>
    </div>
</div>

Add the Browse Page

You must implement the Knowledge Advanced browse page so that users can browse articles and filter the articles by content type, product, and category. You implement the browse page by adding the browse page from the reference implementation to your existing instance.

  1. Copy the browse page from here:

    /cp/core/framework/views/pages/okcs/browse.php
  2. Place it here:

    /cp/customer/development/views/pages/

Here’s an example of the reference implementation browse page:

<rn:meta title="#rn:msg:FIND_ANS_HDG#" template="okcs_standard.php" clickstream="answer_list"/>
<rn:condition config_check="OKCS_ENABLED == true">
    <div class="rn_Container">
        <div id="rn_PageTitle" class="rn_ScreenReaderOnly">
            <h1>#rn:msg:BROWSE1_AB_HDG#</h1>
        </div>
        <rn:container source_id="OKCSBrowse">
            <div id="rn_PageContentChannel" class="rn_Browse rn_PageContentChannel">
                <div class="rn_PageContentChannelInner">
                    <rn:widget path="okcs/ContentType"/>
                </div>
            </div>

            <div id="rn_LoadingIndicator" class="rn_Browse">
               <rn:widget path="okcs/LoadingIndicator"/>
           < /div>

            <div id="rn_PageContentArticles" class="rn_AnswerList">
                <rn:widget path="okcs/OkcsRecommendContent"/>
                <div class="rn_ResultPadding">
                    <div>
                        <div id="rn_OkcsLeftContainer" class="rn_OkcsLeftContainer">
                            <rn:widget path="okcs/OkcsProductCategorySearchFilter" filter_type="products" view_type="explorer"/>
                            <rn:widget path="okcs/OkcsProductCategorySearchFilter" filter_type="categories" view_type="explorer"/>
                        </div>
                        <div id="rn_OkcsRightContainer" class="rn_OkcsRightContainer">
                            <div id="rn_Browse_Loading">/div>
                            <div id="rn_OkcsAnswerList">
                                <rn:widget path="okcs/AnswerList" target="_self"/>
                                <div class="rn_FloatRight">
                                    <rn:widget path="okcs/OkcsPagination"/>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </rn:container>
    </div>
</rn:condition>

Add the Knowledge Advanced Answer Detail Page

You must implement the answer detail (answer_view.php) page to open articles with the article details page. Users can see the article content and its details, including document ID, Version, Status, and Published Date using the article details page.

You can implement the answer detail page using either of the following methods:
  • Add the reference implementation answer detail page to your current instance.

  • Edit the answer detail page in your current instance to include code from the reference implementation answer detail page.

Add the Answer Detail Page

Add the answer details page from reference implementation to your current instance.

  1. Copy the reference implementation answer detail from here:

    /cp/core/framework/views/pages/okcs/answers/answer_view.php
  2. Place it here:

    /cp/customer/development/views/pages/answers/

Edit the Answer Detail Page

Edit the answer detail page in your current instance to include code from the reference implementation answer detail (answer_view.php) page and rename the modified file.

Ensure that the answer detail page does not contain the answer details (answer_details) attribute in the meta code <rn:meta...>. The presence of this attribute will cause the articles to display incorrectly.

  1. Edit the file:

    /cp/customer/development/views/pages/answers/detail.php
  2. Replace the entire code with this code:

    <div class="rn_Container">
        <rn:condition config_check="OKCS_ENABLED == true">
            <div class="rn_ContentDetail">
                <rn:meta title="#rn:php:\RightNow\Libraries\SEO::getDynamicTitle('answer', \RightNow\Utils\Url::getParameter('a_id'))#" template="okcs_standard.php"  clickstream="answer_view"/>
                <div class="rn_PageTitle rn_RecordDetail">
                   <rn:widget path="okcs/OkcsProductCategoryBreadcrumb" display_first_item="true"/>
                    <div class="rn_OkcsAnswerAction">
                       <rn:widget path="okcs/SubscriptionButton"/>
                       <rn:widget path="okcs/OkcsRecommendContent"/>
                    /div>
                    <rn:widget path="okcs/AnswerTitle">
                </div>
                <div class="rn_AnswerView">
                    <rn:widget path="okcs/AnswerStatus">
                    <div class="rn_SectionTitle"></div>
                    <rn:widget path="okcs/AnswerContent">
                </div>
                <div class="rn_DetailTools rn_HideInPrint">
                    <div class="rn_Links">
                        <rn:widget path="okcs/OkcsEmailAnswerLink" />
                    </div>
                </div>
                <rn:widget path="okcs/DocumentRating"/>
                <rn:widget path="okcs/OkcsRelatedAnswers"/>
            </div>
            <aside class="rn_SideRail" role="complementary">
                <rn:widget path="okcs/OkcsRecentlyViewedContent"/>
            </aside>
        </rn:condition>
    </div>
  3. Rename the file:

    answer_view.php

Add the Knowledge Advanced Results Page

You must implement the results page so that users can see Knowledge Advanced search results. You implement the search functionality by replacing the results page in your current instance with the reference implementation results page. Users can see a list of articles in search results that match the entered search text.

Users can also enable the interactive spell checker on the results page to either correct misspelled words automatically, or to suggest spelling corrections to the user-entered text.

  1. Copy the reference implementation results page from here:

    /cp/core/framework/views/pages/okcs/results.php
  2. Place it here:

    /cp/customer/development/views/pages/

Here’s an example of the reference implementation results page:

<rn:meta title="#rn:msg:FIND_ANS_HDG#" template="okcs_standard.php" clickstream="answer_list"/>
<rn:container source_id="OKCSSearch" document_id_reg_ex="^[\p{L}\p{Nd}_.]*\d{1,10}$" doc_id_navigation="true">
    <div id="rn_LoadingIndicator" class="rn_Browse rn_Container">
       <rn:widget path="okcs/LoadingIndicator"/>
    </div>
    <div id="rn_PageTitle" class="rn_Search">
        <div class="rn_Hero">
            <div class="rn_HeroInner">
                <div class="rn_SearchControls">
                    <h1 class="rn_ScreenReaderOnly">#rn:msg:SEARCH_CMD#</h1>
                    <form>
                        <div class="rn_SearchInput">
                            <rn:widget path="searchsource/SourceSearchField" initial_focus="true" label_placeholder="#rn:msg:ASK_A_QUESTION_ELLIPSIS_MSG#" filter_label="Keyword" filter_type="query"/>
                        </div>
                        <rn:widget path="okcs/RecentSearches"/>
                        <rn:widget path="okcs/OkcsSuggestions"/>
                        <rn:widget path="searchsource/SourceSearchButton" initial_focus="true" history_source_id="OKCSSearch"/>
                        <rn:widget path="okcs/OkcsInteractiveSpellChecker"/>
                        <div class="rn_StartOver">
                            <a href="/app/home" >#rn:msg:START_OVER_LBL#/a>
                        </div>
                    </form>
                </div>									 
            </div>
        </div>
    </div>
    <div id="rn_PageContent" class="rn_Container rn_OkcsResultsContainer">
        <div class="rn_ResultList rn_OkcsTable">
            <div class="rn_OkcsTableRow">
                <div id="rn_OkcsLeftContainer" class="rn_OkcsLeftContainer rn_OkcsTableCell">
                    <rn:widget path="okcs/Facet"/>
                </div>
                <div id="rn_OkcsRightContainer" class="rn_OkcsRightContainer rn_OkcsTableCell">
                    <rn:widget path="okcs/SearchResult" hide_when_no_results="false"/>
                    <div class="rn_FloatRight">
                        <rn:widget path="okcs/OkcsPagination"/>
                    </div>
                </div>
            </div>
            <div class="rn_OkcsTableRow">
                <div class="rn_OkcsLeftContainer rn_OkcsTableCell">/div>
                <div class="rn_OkcsRightContainer rn_OkcsTableCell">
                    <rn:widget path="okcs/OkcsRecentlyViewedContent"/>
                </div>
            </div>
        </div>
        <aside class="rn_SideRail" role="complementary">
            <rn:widget path="utils/ContactUs" channels="question,chat,feedback"/>
        </aside>
    </div>
</rn:container>

Enable Users to Manage Answer Notifications

You must edit the notifications (list.php) page so that users can manage their notifications. Users can see notifications they have subscribed to and delete a subscription from the notifications page.

You can edit the notifications page in your current instance to include code from the reference implementation notifications page.

  1. Edit the file:

    /cp/customer/development/views/pages/account/notif/list.php
  2. Add the loading indicator by adding this code:

    <div id="rn_LoadingIndicator" class="rn_Browse">
       <rn:widget path="okcs/LoadingIndicator"/>
    </div>

    before this code:

    <div class=”rn_PageContent”>
  3. Add the answer notification manager widget by adding this code:

    <rn:widget path="okcs/OkcsAnswerNotificationManager" view_type="list"/>

    within this section:

    <div class=”rn_PageContent”>

Here’s an example of the reference implementation notifications (list.php) page:

<rn:meta title="#rn:msg:NOTIFICATIONS_HDG#" template="okcs_standard.php" login_required="true" force_https="true"/>
<div class="rn_Hero">
    <div class="rn_Container">
        <h1>#rn:msg:NOTIFICATIONS_HDG#</h1>
    </div>
</div>
<div id="rn_LoadingIndicator" class="rn_Browse">
    <rn:widget path="okcs/LoadingIndicator"/>
</div>
<div class="rn_PageContent rn_AccountNotifications rn_Container">
    <h2>#rn:msg:ANS_NOTIFICATIONS_LBL#</h2>
    <rn:widget path="okcs/OkcsAnswerNotificationManager" view_type="list"/> 
</div>

Add Knowledge Advanced SmartAssistant

You must edit the ask a question (ask.php) page to add the Knowledge Advanced version of SmartAssistant. Users can submit a questions to a support agent using the Ask a Question page. Users can also see knowledge articles as well as community discussions that match the user-entered text before submitting the question.

You can edit the ask a question page in your existing instance by copying code from the reference implementation ask a question page.

  1. Edit the file:

    cp/customer/development/views/pages/ask.php
  2. Replace standard SmartAssistant with Knowledge Advanced SmartAssistant by changing this code:

    <rn:condition content_viewed="2" searches_done="1">
       <rn:condition_else/>
       <rn:widget path="input/SmartAssistantDialog" label_prompt="#rn:msg:OFFICIAL_SSS_MIGHT_L_IMMEDIATELY_MSG#"/>
    </rn:condition>

    to:

    <rn:widget path="okcs/OkcsSmartAssistant" view_type="explorer"/>
  3. Remove this code:

    [/concept/conbody/ol/licodeblock/i {"fa fa-thumbs-up"}) (i]

    From this section:

    <div class="translucent">
       <strong>#rn:msg:TIPS_LBL#:</strong>
          <ul>
             <li>[/concept/conbody/ol/licodeblock/i
    {"fa fa-thumbs-up"})  (i]#rn:msg:INCLUDE_AS_MANY_DETAILS_AS_POSSIBLE_LBL#</li>
          </ul>
    </div>
    <br>
    <p>#rn:msg:NEED_A_QUICKER_RESPONSE_LBL# <a href="/app/social/ask#rn:session#">#rn:msg:ASK_OUR_COMMUNITY_LBL#</a></p>
Here’s an example of the reference implementation ask a question ( ask.php) page:
<rn:meta title="#rn:msg:ASK_QUESTION_HDG#" template="okcs_standard.php" clickstream="incident_create"/>
<div class="rn_Container">
    <div id="rn_PageTitle" class="rn_AskQuestion">
        <h1>#rn:msg:SUBMIT_QUESTION_OUR_SUPPORT_TEAM_CMD#</h1>
    </div>
</div>
<div id="rn_PageContent" class="rn_AskQuestion rn_Container">
    <div class="rn_Padding">
        <form id="rn_QuestionSubmit" method="post" action="/ci/ajaxRequest/sendForm">
            <div id="rn_ErrorLocation">/div>
            <rn:condition logged_in="false">
                <rn:widget path="input/FormInput" name="Contact.Emails.PRIMARY.Address" required="true" initial_focus="true" label_input="#rn:msg:EMAIL_ADDR_LBL#"/>
                <rn:widget path="input/FormInput" name="Incident.Subject" required="true" label_input="#rn:msg:SUBJECT_LBL#"/>
            </rn:condition>
            <rn:condition logged_in="true">
                <rn:widget path="input/FormInput" name="Incident.Subject" required="true" initial_focus="true" label_input="#rn:msg:SUBJECT_LBL#"/>
            </rn:condition>
                <rn:widget path="input/FormInput" name="Incident.Threads" required="true" label_input="#rn:msg:QUESTION_LBL#"/>
                <rn:widget path="input/FileAttachmentUpload"/>
                <rn:widget path="input/ProductCategoryInput" name="Incident.Product"/>
                <rn:widget path="input/ProductCategoryInput" name="Incident.Category" data_type="Category"/>
                <rn:widget path="input/FormSubmit" label_button="#rn:msg:CONTINUE_ELLIPSIS_CMD#" on_success_url="/app/ask_confirm" error_location="rn_ErrorLocation"/>
                <rn:widget path="okcs/OkcsSmartAssistant" view_type="explorer"/>
        </form>
    </div>
</div>

Enable Knowledge Advanced on the Chat Page

You must replace or edit the chat landing (chat_landing.php) page to add the Knowledge Advanced chat enhancements to both the chat report page and the chat popup window. Users can see their position in the support queue, estimated and average wait times, and a search field on the chat landing page. The chat window opens when an agent is available.

You must implement the chat enhancements using either of the following methods:
  • Replace the chat landing page in your current instance with the reference implementation chat landing page.

  • Edit the chat landing page in your current instance to include code from the reference implementation chat landing page.

Replace the Chat Landing Page

Replace the chat landing page with the reference implementation chat landing page.

  1. Copy the reference implementation chat landing page from here:

    /cp/core/framework/views/pages/okcs/chat/chat_landing.php
  2. Place it here:

    /cp/customer/development/views/pages/chat/

Edit the Chat Landing Page

Edit the chat landing page by copying code from the reference implementation chat landing page.

  1. Edit the file:

    /cp/customer/development/views/pages/chat/chat_landing.php
  2. Add the chat queue by replacing this line:

    <rn:widget path="chat/ChatQueueSearch" popup_window="true"/>

    with:

    <rn:condition config_check="OKCS_ENABLED == true">
    <rn:widget path="chat/ChatQueueSearch" report_page_url="/app/search" popup_window="true" />
    <rn:condition_else>
    <rn:widget path="chat/ChatQueueSearch" popup_window="true" />
    </rn:condition>

Implement the Knowledge Advanced Widgets

Your B2C Service instance includes Knowledge widgets. They enable users to access knowledge features, including content type subscription, suggested searches, filter search by product and category, and search result facets.

You can implement widgets and configure them to tailor knowledge for your organization and users. You configure widgets by adding or editing the widget attributes on the pages in your existing instance. You can see the list of knowledge widgets by reading the documentation on Customer Portal administration page: https://<your_site>/ci/admin/docs/widgets/standard/okcs

Update Widgets to the Latest Version

Before you implement widgets, update them to the latest version.

  1. Go to the Customer Portal administration page:

    https://<your_site>/ci/admin
  2. Click on Widgets, then Widget Versions. The widgets page opens.

  3. Click the Update All option. The widgets will be updated to the latest version.

Set the Article Display on the Home Page

Users see most popular answers and most recent answers in a table view by default. You change the home page so that users can see articles in a list view. You implement list view using the view type parameter.

  1. Edit the file:

    /cp/customer/development/views/pages/home.php
  2. Edit the most popular answers code by changing this line:

    <rn:widget path="okcs/AnswerList" type="popular" target="_self"/>

    to:

    <rn:widget path="okcs/AnswerList" type="popular" target="_self" view_type="list"/>
  3. Edit the most recent answers code by changing this line:

    <rn:widget path="okcs/AnswerList" type="recent" target="_self"/>

    to:

    <rn:widget path="okcs/AnswerList" type="recent" target="_self" view_type="list"/>

Configure Searches to Filter by Product or Category

You can enable users to filters search results using product and category on the home page. Users see only the articles associated with the selected product, category, or both product and category. You implement these filters by including the product category search filter widget. The filters appear only in a tree view.

  1. Edit the file:

    cp/customer/development/views/pages/home.php
  2. Add the product filter by adding this line:
    <rn:widget path= "OkcsProductCategorySearchFilter" filter_type="products"/>
  3. Add the category filter by adding this line:
    <rn:widget path= "OkcsProductCategorySearchFilter" filter_type="categories"/>

Here’s an example of how to include the product and category filter in the home page:

<rn:meta title="#rn:msg:SHP_TITLE_HDG#" template="okcs_standard.php" clickstream="home"/><div class="rn_SearchControls">
<div class="rn_Hero">
    <div class="rn_HeroInner">
        <div class="rn_HeroCopy">
            <h1>#rn:msg:WERE_HERE_TO_HELP_LBL#</h1>
        </div>
        <div class="rn_SearchControls">
            <h1 class="rn_ScreenReaderOnly">#rn:msg:SEARCH_CMD#</h1>
            <form method="get" action="/app/results">
                <rn:container source_id="OKCSSearch">
                    <div class="rn_SearchInput">
                        <rn:widget path="searchsource/SourceSearchField" initial_focus="true" label_placeholder="#rn:msg:ASK_A_QUESTION_ELLIPSIS_MSG#"/>
                    </div>
                    <rn:widget path="okcs/RecentSearches"/>
                    <rn:widget path="okcs/OkcsSuggestions"/>
                    <rn:widget path="searchsource/SourceSearchButton" initial_focus="true" search_results_url="/app/results"/>
									<rn:widget path="okcs/OkcsProductCategorySearchFilter" filter_type="products" view_type="explorer"/>
									<rn:widget path="okcs/OkcsProductCategorySearchFilter" filter_type="categories" view_type="explorer"/>
                </rn:container>
            </form>
        </div>
    </div>
</div>
<div class="rn_PageContent rn_Home">
    <div class="rn_Container">
        <rn:widget path="okcs/OkcsVisualProductCategorySelector" numbered_pagination="true"/>
    </div>
    <div class="rn_PopularKB">
        <div class="rn_Container">
            <rn:widget path="okcs/AnswerList" type="popular" target="_self" view_type="list"/> 
        </div>
    </div>
    <div class="rn_PopularKB rn_RecentKB">
        <div class="rn_Container">
            <rn:widget path="okcs/AnswerList" type="recent" target="_self" view_type="list"/> 
        </div>
    </div>
</div>

Implement Suggested Searches

You can edit the home page so that users can use suggested searches. Users can see a list of articles that match the search term or phrase as they type in the search field. Suggestions with exact keywords match in article titles appear at the top of the results, then suggestions that have partial match. You implement suggested searches to provide a faster way for your users to locate and select relevant articles.

The current implementation contains suggested searches by default on both the home page and the results page. If you are using a previous implementation, you can implement suggested searches using the suggestions widget.

Before you implement suggested searches, you must enable attribute level searching for the master identifier (title field) of each content type in the knowledge base. You can find more information about enabling attribute level searching in the About Schema Attribute Options section in Administering Knowledge Advanced .

  1. Edit a Customer Portal page, for example:

    /cp/customer/development/views/pages/home.php

  2. Add the suggested search widget code as follows:

    <rn:widget path="okcs/OkcsSuggestions"/>
  3. Add the suggestion count attribute to specify the number of suggested searches you want to display. The default is 7. The maximum value is 100.

    <rn:widget path="okcs/OkcsSuggestions" suggestion_count="15"/>

Here’s an example of how to include suggested search widget in the home page:

<rn:meta title="#rn:msg:SHP_TITLE_H<>DG#" template="okcs_standard.php" clickstream="home"/>
<div class="rn_Hero">
	<div class="rn_HeroInner">
		<div class="rn_HeroCopy">
			<h1>#rn:msg:WERE_HERE_TO_HELP_LBL#</h1>
		</div>
	<div class="rn_SearchControls">
		<h1 class="rn_ScreenReaderOnly">#rn:msg:SEARCH_CMD#</h1>
		<form method="get" action="/app/results">
			<rn:container source_id="OKCSSearch">
				<div class="rn_SearchInput">
					<rn:widget path="searchsource/SourceSearchField" initial_focus="true" label_placeholder="#rn:msg:ASK_A_QUESTION_ELLIPSIS_MSG#"/>
				</div>
				<rn:widget path="okcs/RecentSearches">
				<rn:widget path="okcs/OkcsSuggestions">
				<rn:widget path="searchsource/SourceSearchButton" initial_focus="true" search_results_url="/app/results"/>
		</form>
	</div>
	</div>
</div>
<div class="rn_PageContent rn_Home">
	<div class="rn_Container">
		<rn:widget path="okcs/OkcsVisualProductCategorySelector" numbered_pagination="true"/>
	</div>
	<div class="rn_PopularKB">
		<div class="rn_Container">
			<rn:widget path="okcs/AnswerList" type="popular" target="_self" view_type="list"/>
		</div>
	</div>
	<div class="rn_PopularKB rn_RecentKB">
		<div class="rn_Container">
			<rn:widget path="okcs/AnswerList" type="recent" target="_self" view_type="list"/>
		</div>
	</div>
</div>

For more information on the OkcsSuggestions widget, see the Standard Widgets section in Using B2C Service.

Configure Search Results Facets

You can configure the display of facets on the search results page. You can use the top facet list attribute in the facet widget to:
  • reorder facets

  • hide facets

  • rename facets

The following list shows the default order in which the facets display on the results page.
  • Document Types

  • Collections

  • Categories

  • Products

The following table describes four values with an example each on how to reorder, hide, or rename the facets using the top facet list attribute. You must separate the facets by the pipe (|) character and use the comma (,) character for the facet label description.

Table Attribute Values for Configuring Facets

Configuration To display on the results page Attribute Value

Default

Document Types, Collections, Categories, Products

<rn:widget path=”okcs/Facet” top_facet_list=”DOC_TYPES, Document Types|COLLECTIONS, Collections|CMS-CATEGORY-REF, Categories/CMS-PRODUCT, Products”/>

Reorder

Categories, Products, Collections, Document Types

<rn:widget path=”okcs/Facet” top_facet_list=”CMS-CATEGORY-REF|CMS-PRODUCT|COLLECTIONS|DOC_TYPES”/>

Hide

Document Types, Collections, Categories

<rn:widget path=”okcs/Facet” top_facet_list=”DOC_TYPES|COLLECTIONS|CMS-CATEGORY_REF”/>

Rename

MyCategory, MyDocuments, MyProduct, MyCollections

<rn:widget path=”okcs/Facet” top_facet_list=”CMS-CATEGORY-REF, MyCategory|DOC_TYPES, MyDocuments|CMS-PRODUCT, MyProducts|COLLECTIONS, MyCollections”/>

Enable Users to Use Mutiple Facet Selection

You can implement multiple facet selection so that users can refine search results in the filters widget on the results page. Users can refine their search results by selecting multiple products and categories. They can select only one document type and collection.

When users select multiple facets, their search results will contain only documents that belong to all of the selections. For example, when user selects product1, product2, category1, category2, document type1, and collection1 from the available facets, the results list displays only documents that belong to all their selection.

Selecting a facet automatically applies all of its children in the hierarchy. Selecting a facet does not apply its parent facet. Each selected facet shows as a separate entry in the filters widget, and users can remove facets. Search results update automatically whenever users change a facet selection.

The current implementation does not include the multiple facet selection functionality on the results page by default. You can implement multiple facet selection by adding the enable multi facet attribute to the facet widget.

  1. Edit the file: /cp/customer/development/views/pages/results.php

  2. Add the enable multi facet attribute to the facet widget as follows:<rn:widget path="okcs/Facet"enable_multi_select="true"/>

Enable Users to View the Selected Facets

You can implement facet filter widget so that users can view the facets selected on the results page. Each selected facet shows as a separate entry in the facet filter widget, and users can remove a facet by clicking X next to it.

The current implementation includes facet filter at the top of the results page by default. If you upgrade from a previous implementation, you can implement facet filter by adding the facet filter widget to the results page.

  1. Edit the file: /cp/customer/development/views/pages/results.php

  2. Add the facet widget filter by adding this line: <rn:widget path="okcs/FacetFilter"/>

Enable Users to Set the Number of Results Per Page

You can configure the results per page drop-down so that users can change the number of display results that appear on each page by adding the results per page attribute to the results page. Specify the options for the number of results as a comma-separated list. The default options are 10, 20, 30, and 50. The results page uses the first number in the list as the default. You can remove the options from the results page by leaving the results per page attribute empty. Search will show ten results on each page by default.

You can follow these steps to configure the results per page drop-down on the results page.

  1. Edit the file:

    cp/customer/development/views/pages/results.php
  2. Add the results_per_page attribute code as follows:

    <rn:container source_id="OKCSSearch" document_id_reg_ex="^[\p{L}\p{Nd}_.]*\d{1,10}$" doc_id_navigation="true" results_per_page="2,6,12,18,20,25,30">

Enable Search by Document ID

You can enable users to bypass the search results list and open an article directly in the article detail page by entering its document ID in the search field. The current implementation contains the search by document ID feature by default. If you upgrade from a previous implementation, you can add search by document ID by modifying the results page.

  1. Edit the file:

    cp/customer/development/views/pages/results.php
  2. Add the document_id_reg_ex parameter by changing this line:

    <rn:container source_id="OKCSSearch"/>

    to:

    <rn:container source_id="OKCSSearch" document_id_reg_ex="^[\p{L}\p{Nd}_.]*\d{1,10}$"/>

  3. Add the doc_id_navigation parameter to open an article directly in the article detail page.

    <rn:container source_id="OKCSSearch" document_id_reg_ex="^\w{1,10}\d{1,10}$" doc_id_navigation="true"/>

Change the Style of Intent Answers on the Results Page

You can apply a visual style to answers that are associated to intents. Using a distinct visual style for intent answers helps users identify them as featured answers. Intents are dictionary objects that represent a class of similar questions and answers. Intents provide a way for knowledge managers to feature a single best answer to a set of questions that may vary in wording or detail.

The current implementation contains a default stylesheet to distinguish intent answers from other search results. If you upgrade from a previous implementation to the current implementation, the upgrade process automatically installs the intent style sheet in the default location, /cp/customer/assets/themes/standard/intent.css. To use the default intent style, you must update the search result widget to the latest version, which includes the intent style, as shown in this example:
<rn:widget path="okcs/SearchResult" apply_style_on_intents="true"/>

You can change the default style by editing the attributes in the intent style sheet.

  1. Edit the file:

    /cp/customer/assets/themes/standard/intent.css
  2. Edit the default style attributes to match your desired style.

Here’s an example of an intent style sheet that uses the default style:

.rn_IntentResult {
    padding: 0.75em;
    color: #000;
    border-radius: 0.3em;
    border: 0.5em solid #40526b;
}
.rn_IntentResult .rn_ResultIcon:before {
    display: none;
}
.rn_SearchResult .rn_SearchResultContent .rn_IntentResult a {
    font-weight: bold;
}
.rn_IntentResult.rn_ResultElement .rn_Element1 {
    padding-left: unset;
}

Configure a Product or Category Landing Page

You can configure the support home page as a product landing page or as a category landing page. Product and category landing pages restrict search and search results to a selected product or category, enabling users to easily find specific information. All searches from the page will automatically use the selected product or category, and answers displayed will be specific to the selected product or category. Users can also navigate to product and categories of interest using breadcrumbs and images.

You configure the home page using the knowledge visual product category selector widget to display either a product landing page or category landing page. The home page is configured as a product landing page by default.

You can add images to display for each product and category. To add product and category images, you must upload an image for each product or category to the following directory:

cp/customer/assets/images/prodcat-images

Images must have the same name as their corresponding product or category. If an image corresponding to a product or category is not found, default image (default.png) from the images directory is displayed on the home page.

Modify the home page in your existing instance to configure the product or category landing page.

  1. Edit the file:

    cp/customer/development/views/pages/home.php
  2. Locate the OkcsVisualProductCategorySelector widget code, for example:

    <rn:widget path="okcs/OkcsVisualProductCategorySelector" type="product"/>
  3. Edit the type attribute to the desired configuration, either product or categories, for example:

    <rn:widget path="okcs/OkcsVisualProductCategorySelector" type="categories"/>
  4. Add the maximum_items attribute to specify the number of products or categories you want to display. The default value is 8. The maximum value is 40.

    <rn:widget path="okcs/OkcsVisualProductCategorySelector" maximum_items="12"/>

Configure the Article Attributes

You can configure the article attributes so that users can see the article details along with its content. You configure the article attributes that you want to display including the custom metadata parameter in the answer view page and the ask a question page. By default, your users can see article details, including Document ID, Version, Status, and Display Date.

Table List of Article Attributes

Attribute Description

document_id

The article’s document ID.

version

The article’s version.

status

The article’s status. Displays whether the article is published or in draft state.

display_date

The publish date of a published article or the last modified date of a draft article.

creator

The user who created the article.

aggregate_rating

The aggregate rating of article.

owner

The article’s owner.

answer_id

The article’s answer ID.

last_modified

The date that the article was last modified.

last_modifier

The user who last updated the article.

Configure Article Attributes on the Answer Page

You can configure article attributes on the answer view page using the custom metadata attribute.

  1. Edit the file:

    cp/customer/development/views/pages/answer/answer_view.php
  2. Add the custom_metadata parameter code as follows:
    <rn:widget path="okcs/AnswerStatus" custom_metadata="attribute | attribute | attribute"/>
  3. Specify the attributes that you want to display as a list of items separated by the pipe character ( |), for example:
    <rn:widget path="okcs/AnswerStatus" custom_metadata="document_id | version | status | display_date"/>

Configure Article Attributes on the Ask a Question Page

You can configure article attributes on the Ask a Question page using the custom metadata attribute.

  1. Edit the file:

    cp/customer/development/views/pages/ask.php
  2. Add the custom_metadata parameter code as follows:
    <rn:widget path="okcs/OkcsSmartAssistant" custom_metadata="attribute | attribute | attribute"/>
  3. Specify the attributes that you want to display as a list of items separated by the pipe character ( |), for example:
    <rn:widget path="Okcs/SmartAssistant" custom_metadata="document_id | version | status | display_date"/>

Enable Users to View a Translated Version of an Article

You can implement the language drop-down so that users can see translated versions of an article from the article detail page. You implement the language drop-down by adding the translated answer selector widget to the article detail page.

Users select a locale from the language drop-down to see the article and its content in the selected locale. The language drop-down displays locales for only the published articles. In addition, a user can see translated versions of an article based on the usergroup access at the article level.

  1. Edit the file:

    cp/customer/development/views/pages/answer/answer_view.php
  2. Add the language drop-down by adding this line:

    <rn:widget path="okcs/OkcsTranslatedAnswerSelector"/>

    within this section:

    <div class="rn_OkcsAnswerAction">
    	<rn:widget path="okcs/SubscriptionButton"/>
    	<rn:widget path="okcs/OkcsRecommendContent"/>
    </div>
  3. Specify the label attribute to change label for the drop-down as follows:

    <rn:widget path="okcs/OkcsTranslatedAnswerSelector" label_drop_down="<label_name>"/>

Here’s an example on how to include the language drop-down in the answer detail (answer_view.php) page:

<div class="rn_Container">
	<rn:condition config_check="OKCS_ENABLED == true">
		<div class="rn_ContentDetail">
			<rn:meta title="#rn:php:\RightNow\Libraries\SEO::getDynamicTitle('answer', 
			\RightNow\Utils\	Url::getParameter('a_id'))#" template="okcs_standard.php"  
			clickstream="answer_view"/>
			<div class="rn_PageTitle rn_RecordDetail">
				<rn:widget path="okcs/OkcsProductCategoryBreadcrumb" display_first_item="true"/>
				<div class="rn_OkcsAnswerAction">
					<rn:widget path="okcs/SubscriptionButton"/>
					<rn:widget path="okcs/OkcsRecommendContent"/>
					<rn:widget path="okcs/OkcsTranslatedAnswerSelector"/>
				</div>
				<rn:widget path="okcs/AnswerTitle">
			</div>
			<div class="rn_AnswerView">
				<rn:widget path="okcs/AnswerStatus">
				<div class="rn_SectionTitle"></div>
				<rn:widget path="okcs/AnswerContent">
			</div>
			<div class="rn_DetailTools rn_HideInPrint">
				<div class="rn_Links">
					<rn:widget path="okcs/OkcsEmailAnswerLink"/>
				</div>
			</div>
			<rn:widget path="okcs/DocumentRating"/>
			<rn:widget path="okcs/OkcsRelatedAnswers"/>
		</div>
		<aside class="rn_SideRail" role="complementary">
			<rn:widget path="okcs/OkcsRecentlyViewedContent"/>
		</aside>
	</rn:condition>
</div>

Enable Users to Display Answers for All Content Types

You can edit the browse page to add the All option so that users can see articles for all content types. Users can see articles for all the content types or filter articles by a content type. You add the All option by including the display all label attribute in the content type widget.

  1. Edit the file:

    /cp/customer/development/views/pages/browse.php
  2. Add the All option by changing this line:

    <rn:widget path="okcs/ContentType"/>

    to:

    <rn:widget path="okcs/ContentType" display_all_content="true" display_all_label="<new_label_name>" />

Implement Content Type Subscriptions

Article subscription by content type is implemented by default on the account overview page. If you are using a previous implementation, you can implement content type subscription to enable users to subscribe to articles by content type. When users subscribe to a content type, they get an email every time there is a new or updated article of that type.

Users can limit their subscription to articles about specific products and categories in the content types that they subscribe to.

You implement content type subscription by adding a reference to the content type subscription page.

  1. Copy the content_type_list.php file from /cp/core/framework/views/pages/okcs/account/notif to /cp/customer/development/views/pages/account/notif.

  2. Edit a Customer Portal page, for example, the account overview page:

    /cp/customer/development/views/pages/account/overview.php

  3. Add the code snippet to refer to the content type subscription page, as follows:

    <a href="/app/account/notif/content_type_list#rn:session#">#rn:astr:Manage your content type answer notifications#</a>

Here’s an example on how to include a reference to the content type subscription page in the account overview page:

<rn:meta title="#rn:msg:ACCOUNT_OVERVIEW_LBL#" template="okcs_standard.php" login_required="true" force_https="true"/>

<div class="rn_Hero">
    <div class="rn_Container">
        <h1>#rn:msg:ACCOUNT_OVERVIEW_LBL#</h1>
    </div>
</div>

<div class="rn_PageContent rn_AccountOverview rn_Container">
    <div class="rn_ContentDetail">
        <div class="rn_Questions">
            <rn:container report_id="196" per_page="4">
                <div class="rn_HeaderContainer">
                    <h2><a class="rn_Questions" href="/app/account/questions/list#rn:session#">#rn:msg:MY_SUPPORT_QUESTIONS_LBL#/<a></h2>
                </div>
                <rn:widget path="reports/Grid" label_caption="<span class='rn_ScreenReaderOnly'>#rn:msg:YOUR_RECENTLY_SUBMITTED_QUESTIONS_LBL#</span>"/>
                <a href="/app/account/questions/list#rn:session#">#rn:msg:SEE_ALL_MY_SUPPORT_QUESTIONS_LBL#</a>
            </rn:container>
        </div>
    
    <div id="rn_LoadingIndicator" class="rn_Browse">
        <rn:widget path="okcs/LoadingIndicator"/>
    </div>
    <rn:container source_id="OKCSBrowse">
        <div class="rn_HeaderContainer">
            <h2><a class="rn_Profile" href="/app/account/recommendations/list#rn:session#">#rn:msg:MY_RECOMMENDATIONS_LBL#</a></h2>
        </div>
        <div id="rn_OkcsManageRecommendations">
           < rn:widget path="okcs/OkcsManageRecommendations"/>
            <a href="/app/account/recommendations/list#rn:session#">#rn:msg:SEE_ALL_RECOMMENDATIONS_LBL#</<a>
        </div>        
    </rn:container>    
</div>

<div class="rn_SideRail">
    <div class="rn_Well">
        <h3>#rn:msg:LINKS_LBL#</h3>
        <ul>
            <li><a href="/app/account/profile#rn:session#">#rn:msg:UPDATE_YOUR_ACCOUNT_SETTINGS_CMD#</a></li>
            <rn:condition external_login_used="false">
                <rn:condition config_check="EU_CUST_PASSWD_ENABLED == true">
                    <li><a href="/app/account/change_password#rn:session#">#rn:msg:CHANGE_YOUR_PASSWORD_CMD#</a></li>
                </rn:condition>
            </rn:condition>
            <li><a href="/app/account/notif/content_type_list#rn:session#">#rn:astr:Manage your content type answer notifications#</a></li>
            <rn:condition is_active_social_user="true">
                    <li><a href="/app/public_profile/user/#rn:profile:socialUserID#">#rn:msg:VIEW_YOUR_PUBLIC_PROFILE_LBL#</a></li>
            </rn:condition>
        </ul>
    </div>
</div>

Implement Favorites

You can implement favorites so that users can bookmark frequently-used articles. Favorites provides users with quick and easy access to the articles they use most often. Users can access their favorites on article detail page and account overview page.

Users must log into Customer Portal to use favorites. They can add articles to their favorites by clicking Add Favorite on the article detail page, and remove articles from their favorites by clicking Remove Favorite. They can also view and manage their favorites on the account overview page.

The current implementation includes favorites on both the article detail page and the account overview page by default. If you upgrade from a previous implementation, you can implement favorites by adding the favorites button widget to the article detail page, adding the favorites list widget to the account overview page, and copying the favorites list reference page into your site.

  1. Edit the file: /cp/customer/development/views/pages/answer/answer_view.php

  2. Add the favorite button by adding this line:

    rn:widget path="okcs/FavoritesButton"/>

    after this line:

    rn:widget path="okcs/OkcsRecommendContent"/>
  3. Add the favorites list reference (list.php) page by copying the favorites folder from /cp/core/framework/views/pages/okcs/account to /cp/customer/development/views/pages/account

  4. Edit the file: /cp/customer/development/views/pages/account/overview.php

  5. Add the favorites list section by adding the following code:

    <div class="rn_HeaderContainer">
       <h2><a class="rn_Profile" href="/app/account/favorites/list#rn:session#">#rn:msg:MY_FAVORITES_LBL#</a></h2>
    </div>
    <div id="rn_OkcsFavoritesList">
       <rn:widget path="okcs/OkcsFavoritesList" view_type="table" display_fields="title|documentId"/>
       <a href="/app/account/favorites/list#rn:session#">#rn:astr: See all favorites#</a>
    </div>

    within this section:

    <rn:container source_id="OKCSBrowse">
    </rn:container>


Suppress SmartAssistant Filters

SmartAssistant uses the user-provided product and category as search filters to restrict results by default. You can override the default filtering to use only product, category, or neither to filter search results.

SmartAssistant uses the user-provided product and category as search filters to restrict results. By default, it uses both product and category. When using SmartAssistant to search, you can override the default filtering to use only product, category, or neither.

A hook in the file hooks.php, which contains hook definitions, calls a method defined in Sample.php. To apply a specific choice of filter, or to ignore both filters, modify the files hooks.php and Sample.php.

  1. Edit the file:

    cp/customer/development/config/hooks.php
  2. Add the following code at the end of the file:

    $rnHooks['pre_retrieve_smart_assistant_answers'][] = array(  'class' => 'Sample', // Name of the custom model  'function' => 'retrieveSmartAssistantRequest',  'filepath' => ''  );
  3. Edit the file:

    cp/customer/development/models/custom/Sample.php
  4. Add the following code at the end of the file:

    <?php
    namespace Custom\Models;  
    require_once CPCORE . 'Models/Okcs.php';  
    
    class Sample extends \RightNow\Models\Okcs 
    {
    function __construct()  
    {
    parent::__construct(); 
    }
    public function retrieveSmartAssistantRequest(&$hookData) {
    // Second argument determines which SA results to show. Possible values are 'Product', 'Category', 'ProductAndCategory', 'None'.
    parent::retrieveSmartAssistantRequest(&$hookData, 'ProductAndCategory');
    }
    }

Enable Users to Open an Article Attachment

Users can open file attachments of an article in a separate browse window with the answer page. You implement the answer page by adding answer.php from the reference implementation to your current instance.

  1. Copy the answer.php file from here:

    /cp/core/framework/views/admin/okcs/
  2. Place it here:

    /cp/customer/development/views/admin/

Enable Agents to Open an Article from Agent Desktop

You can enable the support agents to open articles that users have viewed before submitting their question using the Ask a Question page. You enable agents to open articles in Agent Desktop by adding the answer preview page (okcs_answer_full_preview.php) from the reference implementation to your current instance.

  1. Copy the okcs_answer_full_preview.php file from here:

    /cp/core.framework/views/admin/okcs/
  2. Place it here:

    /cp/customer/development/views/admin/

Add Knowledge to Website Pages

You can use the knowledge syndication widget to add knowledge to pages on your organization’s website in addition to the customer portal. This enables users to search for and use knowledge from the most relevant places on your web page. You can set up the knowledge widget to display articles by content type, product, and category, popular and recent articles, and external articles.

You add the knowledge widget by configuring the widget, then pasting the JavaScript code that the widget generates into your organization’s web page.

Configure Knowledge Widget

Use the Configure Widget section of the widget configuration page to configure the knowledge widget.

  1. Go to the your site’s administration page:

    https://<your_site>/ci/admin
  2. Click Widgets, then Syndicated Widgets.

  3. Click OkcsKnowledgeSyndication.

  4. Configure the OkcsKnowledgeSyndication widget attributes using the Configure Widget section.

    You can see the list of the widget attributes and their descriptions on your site’s administration page: https://<your_site>/ci/tags/syndicated_widgets/standard/OkcsKnowledgeSyndication.

  5. Click Apply.

  6. Preview your changes in the Preview this Configuration section.

Add the Widget to a Page

Use the Copy Script code to your page section of the widget configuration page to copy and paste the syndication widget code into your web page.

  1. Open the source code for the web page that you want to add the widget to.

  2. Click the Select Text button to select the code that defines your site URL, then press Ctrl+c to copy the code.

    Here’s an example of the code that includes your site URL:

    <script type="text/javascript" scr="https://<your_site>/euf/rightnow/RightNow.Client.js"></script>
  3. Paste the code into the source code of your web page just before the closing </body> tag.

  4. Click the Select Text button to select the code that defines the widget and its attributes, then press Ctrl+c to copy the code.

    Here’s an example of the JavaScript code that includes the widget configuration:

    <script type="text/javascript">
    	RightNow.Client.Controller.addComponent(
    		{
    			div_id: "myDiv",
    			enable_recent: true,
    			presist_contenttype: false,
    			persist_prodcat: false,
    			q: "oracle",
    			instance_id: "okcs_0",
    			module: "OkcsKnowledgeSyndication",
    			type: 10
    		}
    		"https://<your_site>/ci/ws/get"
    	);
    </script>
  5. Paste the copied code just below the code you copied in the previous step.

  6. Click the Select Text button to select the <div> tag code, then press Ctrl+c to copy the code. This code calls the JavaScript code of the widget generated in the previous step.

    Here’s an example of the <div> tag code:

    <div id="myDiv"></div>
  7. Place the <div> tag within the </body> tag

    where you want the widget to appear on the web page.

Community Discussions

Community Self Service in B2C Service provides a platform for community and peer-to-peer knowledge sharing. It provides self-service users with an additional channel that community members can use to ask questions, provide answers, and discuss issues.

You can add community discussions to knowledge in your current instance to enable self-service users to get answers from discussions along side knowledge base answers. Community discussions are organized using the same product hierarchy as knowledge base articles.

You can include community discussions on the home page, the results page, and in the Knowledge Advanced version of SmartAssistant. When users search for answers on these pages, their answers will include both knowledge base articles and community discussions.

You can find more information about Community Self Service in Using B2C Service.

Add Community Discussions to the Home Page

Edit the home page so that users can to see community discussions in addition to most popular answers and most recent answers.

  1. Edit the file: /cp/customer/development/views/pages/home.php

  2. Add community discussions by adding this code:

    <div class="rn_PopularSocial">
    <div class="rn_Container">
    <h2>#rn:msg:RECENT_COMMUNITY_DISCUSSIONS_LBL#</h2>
    <rn:widget path="discussion/RecentlyAnsweredQuestions" show_excerpt="true" maximum_questions="5"/>
    <span class="rn_DiscussionLink">
    <a href="/app/social/questions/list/kw/*#rn:session#">#rn:msg:SHOW_MORE_COMMUNITY_DISCUSSIONS_LBL#</a>
    </span>
    </div>
    </div>

Add Community Discussions to the Results Page

Edit the results page so that users can see community discussions in addition to the articles in search results.

  1. Edit the file: /cp/customer/development/views/pages/results.php

  2. Add community discussions by adding this code:

    <div class="rn_Container">
    <div class="rn_QuestionResults">
    <rn:container source_id="SocialSearch" per_page="5">
    <rn:widget path="searchsource/SourceResultDetails"/>
    <rn:widget path="searchsource/SocialResultListing" label_heading="#rn:msg:RESULTS_FROM_THE_COMMUNITY_LBL#" more_link_url="/app/social/questions/list"/>
    </rn:container>
    </div>
    </div>

Add Recently Viewed Articles to the Social Page

Users can see the discussions about a selected community questions on the social detail page. You can add recently viewed knowledge base articles to the social detail page so that they will see recently viewed articles in addition to community discussions. You add them by including the recently viewed answers widget in the social detail page.

Users can see five recently viewed articles by default. You can set the limit to a value to five or fewer using the widget’s content count attribute.

  1. Edit the file:

    cp/customer/development/views/pages/social/questions/detail.php
  2. Add the recently viewed articles widget code by adding this line:

    <rn:widget path="okcs/OkcsRecentlyViewedContent"/>

    within this section:

    <div class="rn_SideRail">

Add Community Discussions to SmartAssistant

The Knowledge Advanced version of SmartAssistant includes community discussions as well as knowledge base answers. When users submit a question, Knowledge Advanced search returns answers and social search returns discussions that match the search terms that were entered.

Knowledge Advanced uses its own version of SmartAssistant. You can add community discussions to the Knowledge Advanced SmartAssistant so that users can see both community content and knowledge base articles in search results. You update SmartAssistant by editing the KFAPI_SSS_ENABLED configuration setting. The default value of the configuration setting is No.

  1. Go to Site Configuration, Configuration Settings.

  2. Set the value of the configuration setting KFAPI_SSS_ENABLED to Yes.

Implementing Knowledge Advanced on Mobile Customer Portal

You enable Knowledge Advanced in an existing Customer Portal mobile implementation by replacing or modifying the existing Customer Portal mobile pages. You can replace the entire set of Customer Portal files with the Knowledge Advanced mobile reference implementation. However, the new Knowledge Advanced mobile files will overwrite any customized files in your current implementation. You can preserve your customized files by using the Knowledge Advanced mobile files as examples on how to modify the files instead of replacing them.

Add Knowledge Advanced Search to the Mobile Home Page

You can add the mobile search (OKCSSearch) functionality so that users can search for knowledge base articles from the home page. You implement the search functionality by replacing the mobile home page in your existing instance with the reference implementation mobile home page.

  1. Copy the reference implementation mobile home page from here:

    /cp/core/framework/views/pages/okcs/mobile/home.php
  2. Place it here:

    /cp/customer/development/views/pages/mobile

Here’s an example of the reference implementation mobile home page:

<rn:meta title="#rn:msg:SHP_TITLE_HDG#" template="okcs_mobile.php" clickstream="home"/>
<div class="rn_Hero">
    <div class="rn_HeroInner">
        <div class="rn_HeroCopy">
            <h1>#rn:msg:WERE_HERE_TO_HELP_LBL#</h1>
        </div>
        <div class="rn_SearchControls">
            <h1 class="rn_ScreenReaderOnly">#rn:msg:SEARCH_CMD#</h1>
            <form method="get" action="/app/results">
                <rn:container source_id="OKCSSearch">
                    <div class="rn_SearchInput">
                        <rn:widget path="searchsource/SourceSearchField" initial_focus="true" label_placeholder="#rn:msg:ASK_A_QUESTION_ELLIPSIS_MSG#"/>
                    </div>
                    <rn:widget path="okcs/RecentSearches"/>
                    <rn:widget path="okcs/OkcsSuggestions"/>
                    <rn:widget path="searchsource/SourceSearchButton" initial_focus="true" search_results_url="/app/results"/>
                </rn:container>
            </form>
        </div>
    </div>
</div>
<div class="rn_PageContent rn_Home">
    <div class="rn_Container">
        <rn:widget path="okcs/OkcsVisualProductCategorySelector" numbered_pagination="true"/>
    </div>
    <div class="rn_PopularKB">
        <div class="rn_Container">
            <rn:widget path="okcs/AnswerList" type="popular" target="_self" view_type="list"/> 
        </div>
    </div>
    <div class="rn_PopularKB rn_RecentKB">
        <div class="rn_Container">
            <rn:widget path="okcs/AnswerList" type="recent" target="_self" view_type="list"/> 
        </div>
    </div>
</div>

Add Mobile Knowledge Advanced Browse

You must implement the mobile browse (OKCSBrowse) functionality so that users can browse articles and filter the articles by content type, product, and category. You implement the browse functionality by adding the browse page from your reference implementation to your existing instance.

  1. Copy the reference implementation mobile browse page from here:

    /cp/core/framework/views/pages/okcs/mobile/browse.php
  2. Place it here:

    /cp/customer/development/views/pages/mobile/

Here’s an example of the reference implementation mobile browse (browse.php) page:

<rn:meta title="#rn:msg:BROWSE1_AB_HDG#" template="okcs_mobile.php" clickstream="answer_list"/>
<rn:condition config_check="OKCS_ENABLED == true">
<div id="rn_PageTitle" class="rn_Home">
    <div class="rn_Hero">
        <div class="rn_HeroInner">
            <div class="rn_OkcsMobileBrowseHeader">
                <h1 class="rn_ScreenReaderOnly">rn:page_title/></h1>
                <rn:container source_id="OKCSBrowse">
                    <h2 id="rn_AccordTriggerContentType" class="rn_Collapsed"><a href="javascript:void(0);" role="button">#rn:msg:CONTENT_TYPE_LBL#span class="rn_ButtonOff">/span></a></h2>
                    <h2 id="rn_AccordTriggerProduct" class="rn_Collapsed"><a href="javascript:void(0);" role="button">#rn:msg:PRODUCT_LBL#span class="rn_ButtonOff">/span></a></h2>
                    <h2 id="rn_AccordTriggerCategory" class="rn_Collapsed"><a href="javascript:void(0);" role="button">#rn:msg:CATEGORY_LBL#span class="rn_ButtonOff">/span></a></h2>
                       <div class="rn_ClearBoth">
                        <div id="rn_ContainerContentType" class="rn_Hidden">
                            <rn:widget path="okcs/ContentType" list_display="vertical" toggle_selection="true" toggle="rn_AccordTriggerContentType" item_to_toggle="rn_ContainerContentType"/>
                        </div>
                        <div id="rn_ContainerProduct" class="rn_Hidden">
                            <rn:widget path="okcs/OkcsProductCategorySearchFilter" filter_type="products" toggle_selection="true" toggle="rn_AccordTriggerProduct" item_to_toggle="rn_ContainerProduct" view_type="explorer"/>
                        </div>
                        <div id="rn_ContainerCategory" class="rn_Hidden">
                            <rn:widget path="okcs/OkcsProductCategorySearchFilter" filter_type="categories" toggle_selection="true" toggle="rn_AccordTriggerCategory" item_to_toggle="rn_ContainerCategory" view_type="explorer"/>
                        </div>
                    </div>
                </div>
           </div>
    </div>  
</div>
<div class="rn_Container">
<section id="rn_PageContent" class="rn_Home">
        <div id="rn_LoadingIndicator" class="rn_Browse">
           <rn:widget path="okcs/LoadingIndicator"/>
        </div>
        <div id="rn_PageContentArticles">
            <div class="rn_ResultPadding">
                <div id="rn_Browse_Loading">/div>
                <div id="rn_OkcsAnswerList">
                    <div class="rn_Report">
                        <rn:widget path="okcs/OkcsRecommendContent"/>
                        <rn:widget path="okcs/AnswerList" view_type="list" show_headers="false" per_page="5" target="_self"/>
                    </div>
                    <div class="rn_FloatRight">
                        <rn:widget path="okcs/OkcsPagination"/>
                    </div>
                </div>
            </div>
        </div>
    </rn:container>
</section>
</div>
</rn:condition>

Add the Mobile Knowledge Advanced Answer Detail Page

You must implement the mobile answer detail (answer_view.php) page to enable users to open articles with the article details page. Users can see the article content and its details, including document ID, Version, Status, and Published Date using the article details page.

You implement the mobile answer detail page by adding answer_view.php from reference implementation to your existing instance.
  1. Copy the reference implementation mobile answer detail from here:

    /cp/core/framework/views/pages/okcs/mobile/answers/answer_view.php
  2. Place it here:

    /cp/customer/development/views/pages/mobile/answers/

The following is an example of the reference implementation mobile answer detail (answer_view.php) page:

<div class="rn_Container">
    <rn:condition config_check="OKCS_ENABLED == true">
        <rn:widget path="okcs/OkcsProductCategoryBreadcrumb" display_first_item="false"/>
        <rn:meta title="#rn:php:\RightNow\Libraries\SEO::getDynamicTitle('answer', \RightNow\Utils\Url::getParameter('a_id'))#" template="okcs_mobile.php"  clickstream="answer_view"/>
        <rn:widget path="okcs/OkcsRecommendContent"/>
        <rn:widget path="okcs/SubscriptionButton"/>
        <section id="rn_PageContent" class="rn_AnswerDetail">
            <div id="rn_AnswerText">
                <rn:widget path="okcs/AnswerTitle">
                <rn:widget path="okcs/AnswerStatus">
                <div class="rn_SectionTitle"></div>
                <rn:widget path="okcs/AnswerContent">
            </div>
            <div class="rn_DetailTools rn_HideInPrint">
                <div class="rn_Links">
                    <rn:widget path="okcs/OkcsEmailAnswerLink" />
                </div>
            </div>
            <rn:widget path="okcs/DocumentRating"/>
            <rn:widget path="okcs/OkcsRelatedAnswers"/>
        </section>
    </rn:condition>
</div>

Add the Mobile Knowledge Advanced Results Page

You must implement the mobile Knowledge Advanced results page so that users can see knowledge articles in search results. You implement the search functionality by replacing the mobile results page in your current instance with the reference implementation mobile results page.

Users can also use the interactive spell checker on the results page to either correct misspelled words automatically, or to suggest spelling corrections to the user-entered text.

  1. Copy the reference implementation mobile results page from here:

    /cp/core/framework/views/pages/okcs/mobile/results.php
  2. Place it here:

    /cp/customer/development/views/pages/mobile/

Here’s an example of the reference implementation mobile results (results.php) page:

<rn:meta title="#rn:msg:FIND_ANS_HDG#" template="okcs_mobile.php" clickstream="answer_list"/>
<rn:container source_id="OKCSSearch" document_id_reg_ex="^\w{1,10}\d{1,10}$">
<div id="rn_PageTitle" class="rn_Search">
    <div class="rn_Hero">
        <div class="rn_HeroInner">
            <div class="rn_SearchControls">
                <h1 class="rn_ScreenReaderOnly">#rn:msg:SEARCH_CMD#</h1>
                form method="get" action="/app/results">
                    <rn:container source_id="OKCSSearch">
                        <div class="rn_SearchInput">
                            <rn:widget path="searchsource/SourceSearchField" initial_focus="true" label_placeholder="#rn:msg:ASK_A_QUESTION_ELLIPSIS_MSG#"/>
                        </div>
                        <rn:widget path="okcs/RecentSearches" display_tooltip="true"/>
                        <rn:widget path="okcs/OkcsSuggestions"/>
                        <rn:widget path="searchsource/SourceSearchButton" initial_focus="true" history_source_id="OKCSSearch"/>
                        <rn:widget path="okcs/OkcsInteractiveSpellChecker"/>
                    </rn:container>
                    <div class="rn_StartOver">
                        <a href="/app/home" >#rn:msg:START_OVER_LBL#</a>
                    </div>
                </form>
            </div>
        </div>
    </div>  
</div>
</rn:container>
<div class="rn_Container">
    <section id="rn_PageContent" class="rn_Container">
        <rn:container source_id="OKCSSearch" truncate_size="200">
            <div class="rn_Module">
                <rn:widget path="okcs/Facet" toggle_title="true"/>
            </div>
            <div id="rn_OkcsRightContainer" class="rn_Padding">
                <rn:widget path="okcs/SearchResult" hide_when_no_results="false"/>
                <div class="rn_FloatRight rn_Padding">
                    <rn:widget path="okcs/OkcsPagination"/>
                </div>
            </div>
        </rn:container>
    </section>
</div>

Add Knowledge Advanced SmartAssistant

You must add the mobile ask a question (ask.php) page to implement the Knowledge Advanced version of SmartAssistant. Users can submit a question to a support agent from the Ask a Question page. Users can also see knowledge articles as well as community discussions that match the user-entered text before submitting the question.

You implement mobile SmartAssistant by replacing the mobile ask a question page in your current instance with the reference implementation mobile ask a question page.
  1. Copy the reference implementation mobile ask a question page from here:

    /cp/core/framework/views/pages/okcs/mobile/ask.ph
  2. Place it here:

    /cp/customer/development/views/pages/mobile/

Here’s an example of the reference implementation mobile ask a question (ask.php) page:

<rn:meta title="#rn:msg:ASK_QUESTION_HDG#" template="okcs_mobile.php" clickstream="incident_create"/>
<div class="rn_Hero">
   <div class="rn_HeroInner">
      <div class="rn_HeroCopy">
         <h1>#rn:msg:SUBMIT_QUESTION_OUR_SUPPORT_TEAM_CMD#</h1>
         <p>#rn:msg:OUR_DEDICATED_RESPOND_WITHIN_48_HOURS_MSG#</p>
      </div>
   </div>
</div>

<div class="rn_PageContent rn_AskQuestion rn_Container">
   <form id="rn_QuestionSubmit" method="post" action="/ci/ajaxRequest/sendForm">
      <div id="rn_ErrorLocation">/div>
      <rn:condition logged_in="false">
      <rn:widget path="input/FormInput" name="Contact.Emails.PRIMARY.Address" required="true" initial_focus="true" label_input="#rn:msg:EMAIL_ADDR_LBL#"/>
      <rn:widget path="input/FormInput" name="Incident.Subject" required="true" label_input="#rn:msg:SUBJECT_LBL#"/>
      </rn:condition>
      <rn:condition logged_in="true">
      <rn:widget path="input/FormInput" name="Incident.Subject" required="true" initial_focus="true" label_input="#rn:msg:SUBJECT_LBL#"/>
      </rn:condition>
      <rn:widget path="input/FormInput" name="Incident.Threads" required="true" label_input="#rn:msg:QUESTION_LBL#"/>
      <rn:widget path="input/FileAttachmentUpload"/>
      <rn:widget path="input/MobileProductCategoryInput" name="Incident.Product"/>
      <rn:widget path="input/MobileProductCategoryInput" name="Incident.Category"/>
      <rn:widget path="input/FormSubmit" label_button="#rn:msg:SUBMIT_YOUR_QUESTION_CMD#" on_success_url="/app/ask_confirm" error_location="rn_ErrorLocation"/>
      <rn:condition content_viewed="2" searches_done="1">
      <rn:condition_else/>
      <rn:widget path="okcs/OkcsSmartAssistant" accesskeys_enabled="false" view_type="inline"/>
      </rn:condition>
   </form>
</div>

Customer Portal Customization Guidelines

Web developers who need to produce custom code to invoke Knowledge Advanced REST APIs from Customer Portal can use the OKCS API model. To use the model, you should have an understanding of web application development, PHP, software design and development methodologies, object-oriented programming, and also a basic understanding of WebDAV, HTML, CSS, and JavaScript.

OKCS API Model

The OKCS API model (okcs.php) provides functionality to perform Knowledge Advanced operations. It has various wrapper functions for the Knowledge Advanced REST API's and business logic to model the data for Customer Portal pages and widgets interaction. All Knowledge Advanced widgets and pages use the Knowledge Advanced REST APIs to fetch or post data.

Invoke the Knowledge Advanced REST APIs from Customer Portal

You can invoke both the Knowledge Advanced content (IM) and search REST APIs directly from Customer Portal using the OKCS API model. The OKCS API model is located in /cp/core/framework/Models.

The OKCS API model includes a public makeApiRequest method. You can write custom code to instantiate the model class, then call the makeApiRequest method to invoke a content (IM) or a search API. The response is stored in the $apiResponse variable, which can be consumed as required. You can include the custom code within a custom PHP page or a custom widget.

The makeApiRequest method has three parameters.
  • $url − The API end-point URL of a REST API. Use \RightNow\Utils\Config::getConfig(OKCS_IM_API_URL) . '<resource_URL>' to invoke a content (IM) API and \RightNow\Utils\Config::getConfig(OKCS_SRCH_API_URL) . '<resource_URL>' to invoke a search API.

  • $methodName − Method name is the type of method request, including GET or POST.

  • $postData − Post data is an array of variable names and values in the body of the request message sent by the POST method.

You can find the complete list of Knowledge Advanced content (IM) and search resource URLs in the Tasks section of the REST API for Knowledge Advanced in B2C Service guide.

Content (IM) API Code Example

This sample code snippet shows a GET request that retrieves a document by its document Id. The request returns the knowledge base article with the specified document Id.

Example of Request Body:
$okcsModel = new \RightNow\Models\Okcs();
$url = \RightNow\Utils\Config::getConfig(OKCS_IM_API_URL) . 'latest/content/docId/{docId}';
$methodName = 'GET';
$apiResponse = $okcsModel->makeApiRequest($url, $methodName);
var_dump($apiResponse);

Search API Code Example

This sample code snippet shows a POST request that creates a question in the knowledge base repository. The request returns a set of search results for the specified question.

Example of Request Body:
$okcsModel = new \RightNow\Models\Okcs(); 
$url = \RightNow\Utils\Config::getConfig(OKCS_SRCH_API_URL) . 'latest/search/question?question=search_keyword'; 
$methodName = 'POST'; 
$postData = '{resultLocales": "en_us", "session": null, "transactionId": 0}'; 
$apiResponse = $okcsModel->makeApiRequest($url, $methodName, $postData);
var_dump($apiResponse);