7Enabling Knowledge Advanced on Customer Portal

Accessing the Knowledge Advanced Customer Portal Files

The Knowledge Advanced Customer Portal files are packaged as an archive, OKCS-CP.zip, which is available in the Service Cloud Support Knowledge base as an attachment to Answer 8019: How do We Enable Knowledge Advanced on Customer Portal? (https://cx.rightnow.com/app/answers/detail/a_id/8019).

Implementation Overview

You can enable Knowledge Advanced on new or existing Customer Portal implementations. Knowledge Advanced is supported in the Customer Portal standard and mobile views. Knowledge Advanced is not supported in the basic view.

If you have a new instance of Customer Portal, you can enable Knowledge Advanced by replacing the default reference implementation files with a set of files that are completely configured to implement Knowledge Advanced functionality.

If you have an existing implementation or have already begun to configure Customer Portal, and if you have customized any aspect of the Customer Portal code, you can enable Knowledge Advanced by following the process in this guide.

If you copy the Knowledge Advanced files into your existing implementation, you will overwrite any customizations that you have made. To avoid overwriting your customizations, use the Knowledge Advanced files as examples to modify any customized files in your implementation.

To enable Knowledge Advanced on an existing instance of Oracle Service Cloud, use the instructions under this topic to modify specific lines of existing code with new code changes.

Prerequisites to Enable Knowledge Advanced on Customer Portal

Before you enable Knowledge Advanced on Customer Portal, you must fulfill the following prerequisites.

  • Enable MOD_CP_DEVELOPMENT_ENABLED to ensure that you are able to modify code on Customer Portal by using WebDav.

  • Map a drive or path to Customer Portal by using WebDav. All the paths in these instructions refer to the Customer Portal WebDav paths.

  • Ensure that search results are available by creating and processing at least one content collection within Knowledge Advanced Authoring.

  • Before you modify your files, connect to your Customer Portal site and create a backup of your code.

Updating Customer Portal Files

To update your Customer Portal files to Knowledge Advanced, do the following.

  1. Connect your Customer Portal site through webDAV:

    1. Click Start and then Computer.

    2. Click Map network drive.

    3. Click the Connect to a Web site that you can use to store your documents and pictures link, and click Next.

    4. Click Choose a custom network location.

    5. Enter your WebDAV URL and click Next.

    6. When the sign-in prompt appears, enter your user name and password.

  2. Navigate to cp/src/core/framework/views/pages and download the folder okcs.

  3. Go to the customer development area path cp/customer/development/views/pages/ and overwrite the existing pages with the new set of OKCS reference pages that are in the okcs folder.

  4. Copy okcs_standard.php and okcs_mobile.php template files from /cp/core/framework/views/templates/okcs/ to /cp/customer/development/views/templates/.

  5. Copy answer.php and okcs_answer_full_preview.php admin folder files from /cp/core/framework/views/admin/okcs/ to /cp/customer/development/views/admin/.

  6. Validate the changes in development mode.

  7. Go to the ci/admin directory and promote the changes to stage and production.

    When the Customer Portal pages are configured to use Knowledge Advanced, the template includes three links across the top: Home, Answers, and Ask a Question. The default non-Knowledge Advanced pages do not have the Answers link.

How to Add the Knowledge Advanced Page Templates

The template files for both the standard and mobile PHP pages add the Knowledge Advanced look and feel for page style, navigation menu, search results, and password.

In the following sets of code, add to or replace the existing code with the modified code in both the standard and mobile templates.

Modify the Standard Template

Make the following code changes to modify the standard template.

This is the standard.php file path.

/cp/customer/development/views/templates/standard.php

For each of the following lines of existing code, replace or add to the existing code with the specified modified code.

The following table lists the two existing code blocks and the corresponding modified code to use for the style sheet.

Table Modify the Style Sheet

Existing Code Modified Code
<rn:theme path="/euf/assets/themes/standard" css="site.css"/>
<rn:theme path="/euf/assets/themes/standard" css="site.css, okcs.css"/>
<rn:widget path="search/SimpleSearch" report_page_url="/app/results"/>
<rn:widget path="okcs/OkcsSimpleSearch" icon_path="" report_page_url="/app/search"/>

For each of the following lines of existing code, replace or add to the existing code with the specified modified code.

The following table lists the existing code block and the corresponding modified code to use for the search results page.

Table Modify the Search Results Page

Existing Code Modified Code
<rn:widget path="search/SimpleSearch" report_page_url="/app/results"/>
<rn:widget path="okcs/OkcsSimpleSearch" icon_path="" report_page_url="/app/search"/>

After the existing code, add the following modified code for the Home page list index.

The following table lists the existing code block and the corresponding modified code to use for the navigation menu.

Table Modify the Navigation Menu

Existing Code Modified 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>

Add the following condition after the Home page list index:

<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>

After the following existing code, add the specified modified code.

The following table lists the existing code block and the corresponding modified code to use for the password login.

Table Modify the Password Login

Existing Code Modified Code
sub:input_Contact.
NewPassword:label_
input=
"#rn:msg:PASSWORD_LBL#"

Add the following code after the existing code:

sub:login:create_account_fields="Contact.Emails.
PRIMARY.Address;Contact.Login;Contact.
NewPassword;Contact.FullName"

Modify the Mobile Template

Make the following code changes to modify the mobile template.

The mobile.phpmobile.php file path is:

/cp/customer/development/views/templates/mobile.phpmobile.php

Replace the following existing code with the corresponding modified code.

The following table lists the existing code block and the corresponding modified code to use for the mobile Knowledge Advanced style sheet.

Table Add the Mobile Knowledge Advanced Style Sheet

Existing Code Modified Code
<rn:theme path="/euf/assets/themes/mobile" css="site.css "/>
<rn:theme path="/euf/assets/themes/mobile" css="site.css, okcs.css"/>

Replace the following existing code with the corresponding modified code.

The following table lists the existing code block and the corresponding modified code to use for the mobile search results page.

Table Modify the Mobile Search Results Page

Existing Code Modified Code
<rn:widget path="search/SimpleSearch" report_page_url="/app/results"/>
<rn:widget path="okcs/OkcsSimpleSearch" report_page_url="/app/search"/>

Replace the following existing code with the corresponding modified code.

The following table lists the two existing code blocks and the corresponding modified code to use for the mobile navigation menu.

Table Modify the Mobile Navigation Menu

Existing Code Modified Code
<input type="checkbox" id="rn_NavigationMenuButton
Toggle" />
<input type="checkbox" id="rn_NavigationMenuButtonToggle" class="rn_ScreenReaderOnly"
role="button"/>

Add the specified modified code after the following existing 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>

Add the following code after the Home page list index:

<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>

Add the specified modified code after the following existing code.

The following table lists the existing code block and the corresponding modified code to use for the mobile password login.

Table Modify the Mobile Password Login

Existing Code Modified Code
sub:input_Contact.NewPassword
:label_input= 
"#rn:msg:PASSWORD_LBL#"

Add the following code after the existing code:

sub:login:create_account_fields="Contact.Emails.
PRIMARY.Address;Contact.Login;Contact.NewPassword;"

Replace or Add the Standard Browse Page

You can modify the Customer Portal Browse page to include Knowledge Advanced answers.

If you have an existing browse.php file:
  1. Edit the file:

    /cp/customer/development/views/pages/browse.php
  2. Replace its contents with the example code.

If you do have an existing browse.php file:
  1. Create a new browse.php file.

  2. Paste the example code into the new file.

Use the following is example code.

<rn:meta title="#rn:msg:FIND_ANS_HDG#" template="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">
                <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" internal_pagination="true"/>
                                <div class="rn_FloatRight">
                                    <rn:widget path="okcs/OkcsPagination"/>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </rn:container>
    </div>
</rn:condition>

Replace or Add the Mobile Browse Page

If the file browse.php is available, then remove the existing code entirely and add the following code. If browse.php is not available, then create a new file browse.php and add the following code.

This is the path.

/cp/customer/development/views/pages/mobile/browse.php

Use the following code:

<rn:meta title="#rn:msg:BROWSE1_AB_HDG#" template="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);">#rn:msg:CONTENT_TYPE_LBL#<span class="rn_ButtonOff" role="button"></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/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>

Enable Standard SmartAssistant

To enable the Knowledge Advanced version of SmartAssistant, change the existing code.

The path is:

/customer/development/views/pages/ask.php

Remove the following existing 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>

Replace the code you removed with the following modified code.

         <rn:widget path="okcs/OkcsSmartAssistant" view_type="explorer"/>

Remove the following existing code:

<div class="translucent">
            <strong>#rn:msg:TIPS_LBL#:</strong>
            <ul>
                <li><i class="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:msg:ASK_OUR_COMMUNITY_LBL#</a></p>

Enable Mobile SmartAssistant

To enable the Knowledge Advanced version of mobile SmartAssistant, change the following code in the mobile ask.php .

This is the path.

/cp/customer/development/views/pages/mobile/ask.php

Remove the following existing code:

<div class="translucent">
            <strong>#rn:msg:TIPS_LBL#:</strong>
            <ul>
                <li><i class="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:msg:ASK_OUR_COMMUNITY_LBL#</a></p>

Remove the following existing code:

       <rn:widget path="input/SmartAssistantDialog" label_prompt="#rn:msg:OFFICIAL_SSS_MIGHT_L_IMMEDIATELY_MSG#"/>

Replace the removed code with the following modified code:

<rn:widget path="okcs/OkcsSmartAssistant" accesskeys_enabled="false" view_type="inline"/>

Replace the Standard Home Page Search View

In the standard home.php file, add the function to display the five most recent searches and to change the default view type to Table.

This is the path.

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

Replace the existing code with the following modified code.

<rn:meta title="#rn:msg:SHP_TITLE_HDG#" template="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/search">
                <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" no_of_suggestions="5" parent_selector="rn_SearchInput"/>
                    <rn:widget path="searchsource/SourceSearchButton" initial_focus="true" search_results_url="/app/search"/>
                </rn:container>
            </form>
        </div>
    </div>
</div>

<div class="rn_PageContent rn_Home">
    <div class="rn_PopularKB">
        <div class="rn_Container">
            <rn:widget path="okcs/AnswerList" type="popular" view_type="list" target="_self"/>
        </div>
    </div>

    <div class="rn_PopularKB rn_RecentKB">
        <div class="rn_Container">
            <rn:widget path="okcs/AnswerList" type="recent" view_type="list" target="_self"/>
        </div>
    </div>
</div>

Replace the Mobile Home Page Search

Add the function to display the five most recent searches and to change the default view type to Table to the mobile home.php file.

This is the path.

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

Remove the existing code entirely and replace it with the following code:

<rn:meta title="#rn:msg:SHP_TITLE_HDG#" template="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/search">
                <rn:container source_id="KFSearch">
                    <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" no_of_suggestions="5" parent_selector="rn_SearchInput"/>
                    <rn:widget path="searchsource/SourceSearchButton" initial_focus="true" search_results_url="/app/search"/>
                </rn:container>
            </form>
        </div>
    </div>
</div>

<div class="rn_PageContent rn_Home">
    <div class="rn_Container">
        <div class="rn_PopularKB">
           <rn:widget path="navigation/Accordion" toggle="rn_AccordTriggerPopular"/>
            <h2 id="rn_AccordTriggerPopular" class="rn_Expanded">#rn:msg:MOST_POPULAR_ANSWERS_LBL#<span class="rn_Expand"></span></h2>
            <div class="rn_Report">
                <rn:widget path="okcs/AnswerList" type="popular" show_headers="false" per_page="5" target="_self" view_type="list"/>
            </div>
        </div>
        <div class="rn_PopularKB">
           <rn:widget path="navigation/Accordion" toggle="rn_AccordTriggerRecent"/>
            <h2 id="rn_AccordTriggerRecent" class="rn_Expanded">#rn:msg:MOST_RECENT_ANSWERS_LBL#<span class="rn_Expand"></span></h2>
            <div class="rn_Report">
                <rn:widget path="okcs/AnswerList" type="recent" show_headers="false" per_page="5" target="_self" view_type="list"/>
            </div>
        </div>
    </div>
</div>

Modify the Overview Page

Add Knowledge Advanced notifications to the overview page.

This is the path.

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

Replace the existing code with the following modified code:

<rn:meta title="#rn:msg:ACCOUNT_OVERVIEW_LBL#" template="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">
    <h2><a class="rn_Questions" href="/app/account/questions/list#rn:session#">#rn:msg:QUESTIONS_HDG#</a></h2>
    <div class="rn_Questions">
        <rn:widget path="reports/Grid" report_id="196" per_page="4" 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_QUESTIONS_LBL#</a>
    </div>
    <h2><a class="rn_Profile" href="/app/account/profile#rn:session#">#rn:msg:SETTINGS_LBL#</a></h2>
    <div class="rn_Profile">
        <a href="/app/account/profile#rn:session#">#rn:msg:UPDATE_YOUR_ACCOUNT_SETTINGS_CMD#</a><br/>
        <rn:condition external_login_used="false">
            <rn:condition config_check="EU_CUST_PASSWD_ENABLED == true">
               <a href="/app/#rn:config:CP_CHANGE_PASSWORD_URL##rn:session#">#rn:msg:CHANGE_YOUR_PASSWORD_CMD#</a>
            </rn:condition>
        </rn:condition>
    </div>
    <h2><a class="rn_Notifs" href="/app/account/notif/list#rn:session#">#rn:msg:NOTIFICATIONS_HDG#</a></h2>
    <div class="rn_Notifs">
        <rn:widget path="okcs/OkcsAnswerNotificationManager" view_type="table" label_no_subscription="#rn:msg:label_no_subscription#" label_caption="<span class='rn_ScreenReaderOnly'>#rn:msg:ANSWER_NOTIFICATIONS_SLASH_SPAN_LBL#</span>"/>
        <a href="/app/account/notif/list#rn:session#">#rn:msg:SEE_ALL_NOTIFICATIONS_LBL#</a>
    </div>
</div>

Adding Recent Searches and Spell Check to Standard Search

Modify the search pages to include the function for displaying the Knowledge Advanced five most recent searches functionality and the spelling checker. If the file search.php is available, then remove the existing code entirely and include the modified code. If search.php is not available, then create a new file search.php and include the modified code.

The path is:

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

For the spelling check to work, you must enable the interactive search feature. Use the following procedure to enable interactive search.

  1. Sign in to Agent Desktop with administrator privileges.

  2. Go to Configuration,Service, Knowledge Base, and then Search Configuration.

  3. Under Spell Checking, set the Search Configuration Spell Checking setting to Interactive.

  4. Run content processing to update the search index for the application.

Add the following modified code.

<rn:meta title="#rn:msg:FIND_ANS_HDG#" template="mobile.php" clickstream="answer_list"/>
<rn:container source_id="OKCSSearch">
<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/search">
                    <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" no_of_suggestions="5" parent_selector="rn_SearchInput" display_tooltip="true"/>
                        <rn:widget path="searchsource/SourceSearchButton" initial_focus="true" search_results_url="/app/search"/>
                        <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 Recent Searches and Spell Check to Mobile Search

Modify the mobile search pages to include the function for displaying the five most recent searches and the spelling checker. If the file search.php is available, then remove the existing code entirely and include the following code. If search.php is not available, then create a new file search.php and include the following code.

For the spell check to work, you must enable the interactive search feature. Use the following procedure to enable interactive search.

  1. Sign in to Agent Desktop with administrator privileges.

  2. Go to Configuration, Service, Knowledge Base, and then Search Configuration.

  3. Under Spell Checking, set the Search Configuration Spell Checking setting to Interactive.

  4. Run content processing to update the search index for the application.

The path is:

cp/customer/development/views/pages/mobile/search.php

Use the following code:

<rn:meta title="#rn:msg:FIND_ANS_HDG#" template="standard.php" clickstream="answer_list"/>
<rn:container source_id="OKCSSearch">
    <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" no_of_suggestions="5" parent_selector="rn_SearchInput"/>
                        <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">
        <div class="rn_ResultList">
            <div id="rn_OkcsLeftContainer" class="rn_OkcsLeftContainer rn_ResultPadding">
                <rn:widget path="okcs/Facet"/>
            </div>
            <div id="rn_OkcsRightContainer" class="rn_OkcsRightContainer">
                <rn:widget path="okcs/SearchResult" hide_when_no_results="false"/>
                <div class="rn_FloatRight">
                    <rn:widget path="okcs/OkcsPagination"/>
                </div>
            </div>
        </div>
        <aside class="rn_SideRail" role="complementary"><rn:widget path="utils/ContactUs"/></aside>
    </div>
</rn:container>

Modifying the Standard Answer Page

You can modify the Customer Portal answer page to include answers from Knowledge Advanced. The answer page displays a list of answers that match the user-entered search criteria. Users can select an answer from the list to open the answer in the answer detail page.

If you have an existing answer page, do the following:
  1. Edit the file:

    cp/customer/development/pages/answers/answer_view.php

  2. Replace its content with the example code.

If you do not have an existing answer page, do the following:
  1. Create a new answer_view.php file.

  2. Paste the example code into the new file.

The following is an example of code to include Knowledge Advanced answers on the answer 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"/>
                </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>

Replace or Add the Mobile Answer Page

If the file answer_view.php is available, then remove the existing code entirely and replace it with the following changes .If answer_view.php is not available, then create a new file answer_view.php

This is the path.

/cp/customer/development/views/pages/mobile/answers/answer_view.php

Use the following modified code.

<div class="rn_Container">
    <rn:condition config_check="OKCS_ENABLED == true">
        <rn:meta title="#rn:php:\RightNow\Libraries\SEO::getDynamicTitle('answer', \RightNow\Utils\Url::getParameter('a_id'))#" template="mobile.php"  clickstream="answer_view"/>
        <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>
            <rn:widget path="okcs/DocumentRating"/>
        </section>
    </rn:condition>
</div>

Add Administrator View for Agent Desktop

Add the administrator view file answer.php for answers channeled through Agent Desktop. If the file answer.php is already available, then remove the existing code entirely and include the following changes. If answer.php is not available, then create a new file answer.php and include the following code.

The path is:

cp/customer/development/views/admin/answer.php

Use the following code.

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8"/>
        <style type='text/css'>
            .ok-highlight-title {background-color: #FF0;font-weight: bold;}
            .ok-highlight-sentence {background-color: #EBEFF5;}
            iframe {min-width: 100%; border-top-width: 0; border-left-width: 0; border-style: ridge; width: 100%; height: 100%;}
            .mainDiv {width: 100%;height: 100%;overflow: hidden;}
            .headerDiv {width: 100%;height: 5%;position: fixed;background-color: #40526b;top: 0px;min-height: 50px;color: white;font-size: 1em;line-height: 1.5em;font-weight: bold;padding: 10px 0 0px 15px;min-height: 50px;text-align: left;overflow: hidden;}
            .containerDiv {width: 100%;height: 90%;margin-top: 75px;overflow: hidden;position: fixed;}
            .childDiv {width: 100%;height: 100%;overflow: auto;}
            .iframeDiv {height: 95%;}
            .leftAnchor {padding: 0 10px;color: white;}
            .rightAnchor {padding-left: 10px;color: white; margin-right: 15px;}
        </style>
        <link type="text/css" rel="stylesheet" href="/euf/core/thirdParty/css/font-awesome.min.css"/>
    </head>
    <body style="margin: 0px;">
        <? if($error === null) : ?>
            <div class="mainDiv">
                <div class="headerDiv">
                    <? $CI = get_instance(); ?>
                    <? if(($type === 'PDF' && ($CI->agent->browser() === 'Internet Explorer')) || $type !== 'PDF'): ?>
                        <span style="margin-left:30%;text-align: center;"><?= $highlightMsg;?></span>
                        <span style="margin-right:5px;margin-top:5px;">
                            <? if($type === 'PDF' && ($CI->agent->browser() === 'Internet Explorer')): ?>
                                <i class="icon-info-sign rightAnchor" onclick="alert('Install dt-search plugin to view the highlighted version of the PDF')"></i>
                            <? endif; ?>
                        </span>
                        <span style="float:right;margin-right:5px;">
                        <a class="leftAnchor" href="javascript:void(0);" onclick="window.prompt('<?= $copyClipboardMsg?>', '<?= $url;?>')"><?= $copyLinkLable;?></a>|<a class="rightAnchor" href="javascript:void(0);" onclick="window.open('<?= $url;?>');"><?= $viewLabel;?></a>
                        </span>
                    <? elseif($type === 'PDF'): ?>
                        <span style="float:right;margin-right:5px;margin-top:5px;">
                            <a class="rightAnchor" href="javascript:void(0);" onclick="window.prompt('<?= $copyClipboardMsg?>', '<?= $url;?>')"><?= $copyLinkLable;?></a>
                        </span>
                    <? endif; ?>
                </div>

                <div class="containerDiv">
                    <div class="childDiv">
                    <? if($type !== null) : ?>
                        <div class="iframeDiv"><iframe src='<?= $file;?>'/></div>
                    <? elseif($html !== null): ?>
                        <div><frame><div><?= $html;?></div></frame></div>
                    <? endif; ?>
                    </div>
                </div>
            </div>
        <? else: ?>
            <?= $error;?>
        <? endif; ?>
    </body>
</html>

Add Administrator View for Customer Portal

To channel answers through Customer Portal, modify the file okcs_answer_full_preview.php.

This is the path.

/cp/customer/development/views /admin/ okcs_answer_full_preview.php

Replace the existing code with the following modified code.

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title><?=\RightNow\Utils\Config::getMessage(ANSWER_PRINT_PAGE_LBL);?></title>
    <style type='text/css'>
        .rn_ScreenReaderOnly{position:absolute; height:1px; left:-10000px; overflow:hidden; top:auto; width:1px;}
        .rn_Hidden{display:none;}
        .rn_AnswerInfo {color:#666;margin:6px 0 20px;}
        .rn_Info {width: 30%;display: inline-block;margin-top: 10px;}
        .rn_SchemaAttribute {margin-bottom: 5px;font-weight: bold;}
        .rn_SchemaAttributeValue {margin-bottom: 10px;}
        .rn_Indent {margin-left: 20px;}
        .rn_SectionTitle {border-top: 1px solid #DDD;clear: both;padding: 10px 0;text-align: right;}
        .rn_AnswerHeader section {display: inline-block;padding: 3px;width: 40%;word-wrap: break-word;}
        .rn_AnswerHeader h1 {font-size: 1.7em;margin: 15px 0;}
        .rn_AnswerView {margin: 0 10px;}
    </style>
    <link href="/euf/assets/themes/standard/site.css" rel="stylesheet" type="text/css" media="all" />
</head>

<body>
<div id="rn_Container">
    <div id="rn_Header"></div>
    <div id="rn_Navigation"></div>
    <div id="rn_Body">
        <div id="rn_MainColumn">
            <div class="rn_AnswerView">
                <div class="rn_AnswerDetail rn_AnswerHeader">
                    <h1 id="rn_Summary"><?=$data['title']?></h1>
                    <div class="rn_AnswerInfo">
                        <span id="docIdHeader">
                            <section>
                                <span class="rn_Info rn_Bold"><?= \RightNow\Utils\Config::getMessage(DOCUMENT_ID_LBL);?></span>
                                <span><?= $data['docID']?></span>
                            </section>
                        </span>
                        <span id="versionHeader">
                            <section>
                                <span class="rn_Info rn_Bold"><?= \RightNow\Utils\Config::getMessage(VERSION_LBL);?></span>
                                <span><?= $data['version']?></span>
                            </section>
                        </span>
                        <span id="statusHeader">
                            <section>
                                <span class="rn_Info rn_Bold"><?= \RightNow\Utils\Config::getMessage(STATUS_LBL);?></span>
                                <span><?= $data['published']?>
</span>
                            </section>
                        </span>
                        <span id="publishedDateHeader">
                            <section>
                                <span class="rn_Info rn_Bold"><?= \RightNow\Utils\Config::getMessage(PUBLISHED_DATE_LBL);?></span>
                                <span><?= $data['publishedDate']?></span>
                            </section>
                        </span>
                    </div>
                </div>
                <div class="rn_SectionTitle"></div>
                <div id="content">
                <? $previousDepth = 1; ?>
                <? $currentIndex = 1; ?>
                <? foreach ($data['data'] as $data): ?>
                    <? if ($data['type'] === 'META'): ?>
                        <div class="rn_SectionTitle"></div>
                    <? endif; ?>
                    <? foreach ($data['contentSchema'] as $schemaPath): ?>
                        <? $schemaXpath = str_replace('//', '', $schemaPath); ?>
                        <? $attribute = $data['content'][$schemaXpath]; ?>
                        <? if ($attribute['depth'] > 0) : ?>
                            <? $value = $attribute['value']; ?>
                            <? if($attribute['depth'] > $previousDepth ) : ?>
                                <div class="rn_Indent">
                            <? endif; ?>                            <? if($attribute['depth'] < $previousDepth) : ?>
                                <? $diff = $previousDepth - $attribute['depth']; ?>
                                <? for($i = $diff; $i > 0; $i--) : ?>
                                    </div>
                                <? endfor; ?>
                            <? endif; ?>
                            <? if($attribute['xPath'] !== '') : ?>
                                <?$className = ucwords(strtolower($attribute['xPath']));?>
                                <?$index = 0;?>
                                <? foreach(array('_', '/') as $delimiter) : ?>
                                    <? if(strpos($className, $delimiter)) : ?>
                                        <?$className = implode('_', array_map('ucfirst', explode($delimiter, $className)));?>
                                    <? endif; ?>
                                    <? $index++;?>
                                <? endforeach; ?>
                                <? $className = 'rn_AnswerField_' . $className; ?>
                            <? endif; ?>
                            <div class="<?= $className?>">
                                <div class='rn_SchemaAttribute'>
                                    <? if ($type === 'CHECKBOX') : ?>
                                        <? $checkboxID = $className . $index;
                                            $checked = $value === 'Y' ? 'checked' : '';
                                        ?>
                                        <label for="<?= $checkboxID ?>" class="rn_AttributeCheckboxLabel"><?= $attribute['name'] ?></label>
                                        <input id="<?= $checkboxID ?>" type="checkbox" disabled <?= $checked ?> class="rn_AttributeCheckbox"/>
                                    <? else: ?>
                                        <?= $attribute['name'] ?>
                                    <? endif; ?>
                                </div>
                                <? if($this->data['attrs']['type'] !== 'NODE') : ?>
                                    <div class='rn_SchemaAttributeValue'>
                                        <? if ($type === 'FILE') : ?>
                                            <a target='_blank' href="/ci/okcsFattach/get/<?=$attribute['encryptedPath'];?>"><?=$attribute['value'];?></a>
                                        <? elseif ($type !== 'CHECKBOX') : ?>
                                            <?= $value ?>
                                        <? endif; ?>
                                    </div>
                                <? endif; ?>
                            </div>
                                                        <? if (count($data['contentSchema']) === $currentIndex) : ?>
                                <? for($i = $attribute['depth']; $i > 1; $i--) : ?>
                                    </div>
                                <? endfor; ?>
                            <? endif; ?>
                            <? $previousDepth = $attribute['depth']; ?>
                        <? endif; ?>
                        <? $currentIndex++; ?>
                    <? endforeach; ?>
                <? endforeach; ?>
            </div>
        </div>
    </div>
</div>
</body>
</html>
 
       

Modify Chat Search Pop-Up

Add Knowledge Advanced enhancements to the file chat_landing.php for the chat report page and popup window.

The path is:

/cp/customer/development/views/pages/chat/chat_landing.php

Remove the following existing code.

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

Replace the code you removed with the following modified code.

<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>

Replace Notifications Manager

Replace the Right Now notification manager in the file list.php with the Knowledge Advanced notification manager.

The path is:

cp/customer/development/views/pages/account/notif/list.php

Remove the following existing code:

<rn:widget path="notifications/AnswerNotificationManager" />
<h2>#rn:msg:PRODUCTCATEGORY_ANSWER_NOTIFICATIONS_LBL#</h2>
<rn:widget path="notifications/ProdCatNotificationManager" report_page_url="/app/#rn:config:CP_PRODUCTS_DETAIL_URL#" />
<rn:condition is_social_user="true">
    <h2>#rn:msg:DISCUSSION_NOTIFICATIONS_LBL#</h2>
    <rn:container report_id="15104">
        <rn:widget path="reports/ResultInfo" static_filter="User=#rn:profile:socialUserID#"/>
        <rn:widget path="notifications/DiscussionSubscriptionManager" static_filter="User=#rn:profile:socialUserID#"/>
    </rn:container>
    <h2>#rn:msg:PRODUCT_DISCUSSION_NOTIFICATIONS_LBL#</h2>
    <rn:container report_id="15105">
        <rn:widget path="reports/ResultInfo" static_filter="User=#rn:profile:socialUserID#"/>
        <rn:widget path="notifications/DiscussionSubscriptionManager" static_filter="User=#rn:profile:socialUserID#" subscription_type="Product" label_no_notification="#rn:msg:CURRENTLY_DONT_ANY_DISC_NOTIF_MSG#"/>
    </rn:container>
</rn:condition>

Replace the removed code with the following modified code:

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

Modify the Profile Page

Because Knowledge Advanced does not search social content, the social widgets have been removed from the profile page. Retaining the social widgets in this page does not impact Knowledge Advanced.

Note: This modification is optional.

This is the path.

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

Replace the existing code with the following modified code:

<rn:meta title="#rn:msg:ACCOUNT_SETTINGS_LBL#" template="standard.php" login_required="true" force_https="true" />
<div class="rn_Hero">
    <div class="rn_Container">
        <h1>#rn:msg:ACCOUNT_SETTINGS_LBL#</h1>
    </div>
</div>
<div class="rn_PageContent rn_Profile rn_Container">
    <rn:condition flashdata_value_for="info">
        <div class="rn_MessageBox rn_InfoMessage">
            #rn:flashdata:info#
        </div>
    </rn:condition>
    <rn:condition url_parameter_check="msg != null">
        <div class="rn_MessageBox rn_InfoMessage">#rn:url_param_value:msg#</div>
    </rn:condition>
    <form id="rn_CreateAccount" onsubmit="return false;">
        <div id="rn_ErrorLocation">
</div>
        <h2>#rn:msg:ACCT_HDG#</h2>
        <rn:condition external_login_used="true">
        <rn:container read_only="true">
        </rn:condition>
        <fieldset>
            <legend>#rn:msg:ACCT_HDG#</legend>
            <rn:widget path="input/FormInput" name="Contact.Emails.PRIMARY.Address" required="true" validate_on_blur="true" initial_focus="true" label_input="#rn:msg:EMAIL_ADDR_LBL#"/>
            <rn:widget path="input/FormInput" name="Contact.Login" required="true" validate_on_blur="true" label_input="#rn:msg:USERNAME_LBL#" hint="#rn:msg:TH_PRIVATE_S_LOG_IN_SITE_JUST_WANT_MSG#"/>
        <rn:condition external_login_used="false">
            <rn:condition config_check="EU_CUST_PASSWD_ENABLED == true">
                <br>
                <a href="/app/#rn:config:CP_CHANGE_PASSWORD_URL##rn:session#">#rn:msg:CHANGE_YOUR_PASSWORD_CMD#</a>
            </rn:condition>
        </rn:condition>
        </fieldset>
        <h2>#rn:msg:CONTACT_INFO_LBL#</h2>
        <fieldset>
            <legend>#rn:msg:CONTACT_INFO_LBL#</legend>
        <rn:condition config_check="intl_nameorder == 1">
            <rn:widget path="input/FormInput" name="Contact.Name.Last" label_input="#rn:msg:LAST_NAME_LBL#" required="true"/>
            <rn:widget path="input/FormInput" name="Contact.Name.First" label_input="#rn:msg:FIRST_NAME_LBL#" required="true"/>
        <rn:condition_else/>
            <rn:widget path="input/FormInput" name="Contact.Name.First" label_input="#rn:msg:FIRST_NAME_LBL#" required="true"/>
            <rn:widget path="input/FormInput" name="Contact.Name.Last" label_input="#rn:msg:LAST_NAME_LBL#" required="true"/>
        </rn:condition>
        <rn:condition language_in="ja-JP,ko-KR,zh-CN,zh-HK,zh-TW">
            <rn:widget path="input/FormInput" name="Contact.Address.PostalCode" label_input="#rn:msg:POSTAL_CODE_LBL#" />
            <rn:widget path="input/FormInput" name="Contact.Address.Country" label_input="#rn:msg:COUNTRY_LBL#"/>
            <rn:widget path="input/FormInput" name="Contact.Address.StateOrProvince" label_input="#rn:msg:STATE_PROV_LBL#"/>
            <rn:widget path="input/FormInput" name="Contact.Address.City" label_input="#rn:msg:CITY_LBL#"/>
            <rn:widget path="input/FormInput" name="Contact.Address.Street" label_input="#rn:msg:STREET_LBL#"/>
        <rn:condition_else />
            <rn:widget path="input/FormInput" name="Contact.Address.Street" label_input="#rn:msg:STREET_LBL#"/>
            <rn:widget path="input/FormInput" name="Contact.Address.City" label_input="#rn:msg:CITY_LBL#"/>
            <rn:widget path="input/FormInput" name="Contact.Address.Country" label_input="#rn:msg:COUNTRY_LBL#"/>
            <rn:widget path="input/FormInput" name="Contact.Address.StateOrProvince" label_input="#rn:msg:STATE_PROV_LBL#"/>
            <rn:widget path="input/FormInput" name="Contact.Address.PostalCode" label_input="#rn:msg:POSTAL_CODE_LBL#" />
        </rn:condition>
            <rn:widget path="input/FormInput" name="Contact.Phones.HOME.Number" label_input="#rn:msg:HOME_PHONE_LBL#"/>
        </fieldset>
        <rn:condition external_login_used="true">
        </rn:container>
        </rn:condition>
        <rn:condition external_login_used="false" is_social_user="false" is_active_social_user="true">
            <rn:widget path="input/FormSubmit" label_button="#rn:msg:SAVE_CHANGE_CMD#" on_success_url="none" label_on_success_banner="#rn:msg:PROFILE_UPDATED_SUCCESSFULLY_LBL#" error_location="rn_ErrorLocation"/>
        </rn:condition>
    </form>
</div>

Modify the Mobile Profile Page

Because Knowledge Advanced does not search social content, the social widgets have been removed from the profile page. Retaining the social widgets in this page does not impact Knowledge Advanced.

Note: This modification is optional.

The path is:

cp/customer/development/views/pages/mobile/account/profile.php

Replace the existing code with the following modified code.

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

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

<div class="rn_PageContent rn_Profile rn_Container">
    <rn:condition flashdata_value_for="info">
        <div class="rn_MessageBox rn_InfoMessage">
            #rn:flashdata:info#
        </div>
    </rn:condition>

    <rn:condition url_parameter_check="msg != null">
        <div class="rn_MessageBox rn_InfoMessage">#rn:url_param_value:msg#</div>
    </rn:condition>

    <form id="rn_CreateAccount" onsubmit="return false;">
        <div id="rn_ErrorLocation"></div>
        <h2>#rn:msg:ACCT_HDG#</h2>

        <rn:condition external_login_used="true">
        <rn:container read_only="true">
        </rn:condition>

        <fieldset>
            <legend>#rn:msg:ACCT_HDG#</legend>
            <rn:widget path="input/FormInput" name="Contact.Emails.PRIMARY.Address" required="true" validate_on_blur="true" initial_focus="true" label_input="#rn:msg:EMAIL_ADDR_LBL#"/>
            <rn:widget path="input/FormInput" name="Contact.Login" required="true" validate_on_blur="true" label_input="#rn:msg:USERNAME_LBL#" hint="#rn:msg:TH_PRIVATE_S_LOG_IN_SITE_JUST_WANT_MSG#"/>
        <rn:condition external_login_used="false">
            <rn:condition config_check="EU_CUST_PASSWD_ENABLED == true">
                <a href="/app/#rn:config:CP_CHANGE_PASSWORD_URL##rn:session#">#rn:msg:CHANGE_YOUR_PASSWORD_CMD#</a>
            </rn:condition>
        </rn:condition>
        </fieldset>

        <h2>#rn:msg:CONTACT_INFO_LBL#</h2>
        <fieldset>
            <legend>#rn:msg:CONTACT_INFO_LBL#</legend>
        <rn:condition config_check="intl_nameorder == 1">
            <rn:widget path="input/FormInput" name="Contact.Name.Last" label_input="#rn:msg:LAST_NAME_LBL#" required="true"/>
            <rn:widget path="input/FormInput" name="Contact.Name.First" label_input="#rn:msg:FIRST_NAME_LBL#" required="true"/>
        <rn:condition_else/>
            <rn:widget path="input/FormInput" name="Contact.Name.First" label_input="#rn:msg:FIRST_NAME_LBL#" required="true"/>
            <rn:widget path="input/FormInput" name="Contact.Name.Last" label_input="#rn:msg:LAST_NAME_LBL#" required="true"/>
        </rn:condition>
        <rn:condition language_in="ja-JP,ko-KR,zh-CN,zh-HK,zh-TW">
            <rn:widget path="input/FormInput" name="Contact.Address.PostalCode" label_input="#rn:msg:POSTAL_CODE_LBL#" />
            <rn:widget path="input/FormInput" name="Contact.Address.Country" label_input="#rn:msg:COUNTRY_LBL#"/>
            <rn:widget path="input/FormInput" name="Contact.Address.StateOrProvince" label_input="#rn:msg:STATE_PROV_LBL#"/>
            <rn:widget path="input/FormInput" name="Contact.Address.City" label_input="#rn:msg:CITY_LBL#"/>
            <rn:widget path="input/FormInput" name="Contact.Address.Street" label_input="#rn:msg:STREET_LBL#"/>
        <rn:condition_else />
            <rn:widget path="input/FormInput" name="Contact.Address.Street" label_input="#rn:msg:STREET_LBL#"/>
            <rn:widget path="input/FormInput" name="Contact.Address.City" label_input="#rn:msg:CITY_LBL#"/>
            <rn:widget path="input/FormInput" name="Contact.Address.Country" label_input="#rn:msg:COUNTRY_LBL#"/>
            <rn:widget path="input/FormInput" name="Contact.Address.StateOrProvince" label_input="#rn:msg:STATE_PROV_LBL#"/>
            <rn:widget path="input/FormInput" name="Contact.Address.PostalCode" label_input="#rn:msg:POSTAL_CODE_LBL#" />
        </rn:condition>
            <rn:widget path="input/FormInput" name="Contact.Phones.HOME.Number" label_input="#rn:msg:HOME_PHONE_LBL#"/>
        </fieldset>

        <rn:condition external_login_used="true">
        </rn:container>
        </rn:condition>

        <rn:condition external_login_used="false" is_social_user="false" is_active_social_user="true">
            <rn:widget path="input/FormSubmit" label_button="#rn:msg:SAVE_CHANGE_CMD#" on_success_url="none" label_on_success_banner="#rn:msg:PROFILE_UPDATED_SUCCESSFULLY_LBL#" error_location="rn_ErrorLocation"/>
        </rn:condition>
    </form>
</div>

Suppress SmartAssistant Pre-Filters

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.

Place the following line of code at the end of the file hooks.php.

This is the path.

customer/development/config/hooks.php
$rnHooks['pre_retrieve_smart_assistant_answers'][] = array(  'class' => 'Sample', // Name of the custom model  'function' => 'retrieveSmartAssistantRequest',  'filepath' => ''  );

In the file Sample.php, place the following line of code at the end of the file.

This is the path.

customer/development/models/custom/Sample.php
<?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');
}
}

About Configuring Syndication Widget Attributes

When you enable the Knowledge Advanced syndication widget to make Knowledge Advanced available on your company’s web page, you can set the attributes for the widget to enable or change Knowledge Advanced features.

Use the following procedure to change the labels related to the widget, edit any of the following label attributes.

  • label_more_results

  • label_no_results

  • label_search_button

The following table lists and describes the fourteen syndication widget attributes and a description of each.

Table Syndication Widget Attributes

Attribute Description

Set the keyword for the search query

You can define the search term automatically so that the answers returned by the Oracle Knowledge Advanced syndication widget are related to that keyword. The default is blank. Type the search word in the field for the q attribute of the Knowledge Advanced syndication widget.

Filter answer list by product and/or category

To filter the answer list based on product or category, supply the product or category reference key as value of the attribute product_category. If both 'product' and 'category' will be used as filters, separate values by using a colon (:).

Filter answer list by content type

To filter the answer list based on content type, supply the content type reference key as value of the attribute content_type. To specify multiple values, separate the values by a colon (:)

Determine search results based on page information

The Knowledge Advanced syndication widget can “read” the content of the page and use context-sensitive information to determine what answers should be returned. It does this when you specify the HTML tags on the page that you want the widget to evaluate for context sensitivity. If you leave the field for this attribute blank, the widget does not use page content to determine what answers should be returned. When you specify the page tags, the content within those tags is passed to the server for evaluating answers that are relevant to the page content.

If you enter information in the context attribute’s field, the keyword for the search query defined in the q attribute is overridden. If the HTML tags that you define are not found on the page, the widget defaults to the empty string, and top answers are returned.

You can list any div ID, as well as title, document, and meta tags in the field for the context attribute. If you list a meta tag, only meta elements that are named description and keywords are evaluated. If you use a document tag, the entire contents of the page are evaluated.

Type comma-separated HTML tags in the context field. The content within those tags is used to determine search results.

Enable external document searching

To return external documents from a search, click the check box related to the attribute called ext_docs.

Enable or disable the recent answer list

To enable or disable the recent answer list, modify the attribute called enable_recent and click the check box.

Enable or disable the search excerpt

To enable or disable the search excerpt, modify the attribute called descriptionand click the check box.

Enable or disable the search box

To enable or disable the search box, modify the attribute called search_box and click the check box.

Hide initial answers

To hide the initial answers on page load, modify the attribute called hide_initial_answers and click the check box.

Edit the target window

The target attribute defines where linked documents and additional search results (the More Results link) should open. The default value is _self to open the linked document or the additional search results in the same window.

Type one of the following target values for the HTML anchor (<a>) tag in the field for the widget’s target attribute:

  • _blank—opens the link in a new window.

  • _self— opens the link in the current window.

  • _parent— opens the link in the parent frameset.

  • _top— opens the link in the full window.

Truncate answer descriptions

The default length of answer descriptions is 100 characters. You can edit that value by modifying the attribute truncate_size.

Edit the number of displayed answers

By default, ten answers are displayed when customers conduct a search by using the Knowledge Advanced syndication widget. You can edit the value by modifying the attribute number_answers.

Edit the div element

The default div element that defines where you want the Knowledge Advanced syndication widget to appear on the page is myDiv. If you change the div_id attribute, the code you add to the page also changes.

Edit the instance ID

If you have more than one Knowledge Advanced syndication widget on a page, you must have unique ID values for each of them. The default value is skw_0.

Replace the “0” in “skw_0” in the instance_id attribute with another value for each widget that you add to the page. Each instance of the widget must have a unique value.

Configuring the Knowledge Advanced Syndication Widget in a Web Page

To add Knowledge Advanced to your company’s web page, use the Knowledge Advanced syndication widget.

To add the Knowledge Advanced syndication widget:

  1. The path to the widget is similar to https://%3csite_name%3e/ci/tags/syndicated_widgets/standard/OkcsKnowledgeSyndication.

    The page displays a preview of the widget and the code to add to your page.

  2. To preview your changes, at the bottom left of the Configure Widget pane click Apply.

    Note: For specific information about the attributes, see How to Add Oracle Knowledge to Your Company’s Web Site.
  3. Open the source code for the web page that you want to add the widget to.

  4. To ensure the page renders correctly in Internet Explorer 7, add the following code to the top of the page before your first HTML tag: <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  5. On the right side of the widget page, click the top Select Text button to select the code in the first yellow box and press Ctr+c to copy the code.

  6. Paste the code into your page file just before the closing </body> tag. Even if you plan to use multiple syndicated widgets on the page, paste this code only once.

  7. Click the second Select Text button and copy the code that defines the widget.

  8. Paste the copied code just below the code you copied in step 7.

  9. Wherever you want that widget to appear, add the following line in the page code:

    <div_id="myDiv"></div>
  10. Save the page.

Update Widgets

Before the new version of widgets can appear in Customer Portal, you must update all widgets that are in ‘out of date’ status to the latest version.

Use the following procedure to update the widgets.

  1. Go to the Customer Portal administration page.

  2. Search for standard/okcs.

  3. Update the status of all widgets designated in yellow.

Change the Answer List to List View

The most popular and most recent widgets on the Home page are displayed in a tabular view. To change the AnswerList widgets MostPopular and MostRecent to a list view, make the following code changes.

This is the path.

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

Remove the following existing code:

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

Replace the existing code with the following modified code.

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

Remove the following existing code:

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

Replace the existing code with the following modified code:

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

Add Knowledge Advanced to Your Company’s Web Site

You can add an access to Knowledge Advanced from your company’s web site instead of accessing only from the Customer Portal pages. This access adds the search fields and popular and recent articles from the Support Home Customer Portal.

To add Knowledge Advanced to your company’s web site, in Customer Portal, go toWidgets, Syndicated Widgets, and then OkcsKnowledgeSyndication to open the OkcsKnowledgeSyndication page. This page has three sections:

  • The default configuration under the heading "Preview this configuration". The Search field returns search results from Knowledge Advanced. Beneath the Search field is a list of links to popular answers. The More Results link opens the Customer Portal Most Popular Answers page.

  • On the right side of the OkcsKnowledgeSyndication page are panels labelled "Copy script code to your page" with instructions on how to copy and where to paste the code on your web page.

  • Scroll down the page to the Configure Widget list of attributes that you can use to enable or change Knowledge Advanced features. Each attribute includes instructions on what the attribute does and how to use it. You can add a configuration to one or more attributes and then click the Apply button at the bottom of the page.

Optionally, under the Configure Widget heading is the URL to edit the CSS file of the widget.

Add the Recently Viewed Widget

This function allows you to add the Recently Viewed widget in Customer Portal. End users can view the links of their recently viewed answers and community discussions on the answers view and detail pages.

Add the Recently Viewed widget to answer view page

This is the path of the answer_view.php page.

cp/customer/development/views/pages/answer/answer_view.php

The following code adds the Recently Viewed Answers widget to the answer_view.php page.

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

Add the Recently Viewed widget to detail page

This is the path of the questions/detail.php page.

cp/customer/development/views/pages/social/questions/detail.php

Replace the following existing code with the corresponding modified code.

The following table lists the existing code block and the corresponding modified code to add the Recently Viewed widget.

Table Add the Recently Viewed widget

Existing Code Modified Code
<rn:widget path="discussion/RecentlyViewedContent"/>
<rn:widget path="okcs/OkcsRecentlyViewedContent"/>
Note:

Ensure that the CP_COOKIES_ENABLED configuration option is enabled.

Enabling Users to Display Answers for All Content Types

You can add the All option to enable users to see answers from all content types in the Content Type widget on the browse page. Product and category filters remain enabled, providing customers with the ability to view all content types filtered by the desired products and categories.

The following code adds All to the views/pages/browse.php page.

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

The display_all_label attribute allows you to specify a different display name for the All option.

The following code renames the All label.

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

Configuring Search Results Facets

You can configure how you want the facets to display on the search results page. You can use the Top_Facet_List attribute in the okcs/Facet widget to do the following tasks.
  • 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”/>

Configuring Searches to Pre-Filter by Product or Category

Customer Portal users can perform an advanced search to view only the articles associated with a product, category, or both product and category. When users enter a search term and select a product or category as the search filter, search results display articles relevant to the selected product and category.

You can use the filter_type parameter in the OkcsProductCategorySearchFilter widget to configure the product and category filters on the Home page.
Note:

The product and category filters are displayed only in a tree view on the Home page.

To configure search filtering on the Home page:
  1. Edit the file cp/customer/development/views/pages/home.php.

  2. Add the product filter as follows:
    <rn:widget path= "OkcsProductCategorySearchFilter" filter_type="products"/>
  3. Add the category filter as follows:
    <rn:widget path= "OkcsProductCategorySearchFilter" filter_type="categories"/>
The following is an example of code with both the product and category filters added to the home page:
<div class="rn_SearchControls">
<h1 class="rn_ScreenReaderOnly">#rn:msg:SEARCH_CMD#h1 class="rn_ScreenReaderOnly">#rn:msg:SEARCH_CMD#>
<form method="get" action="/app/results">
<rn:container source_id="OKCSSearch" document_id_reg_ex="^\w{1,10}\d{1,10}$">
	<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="searchsource/SourceSearchButton" initial_focus="true" search_results_url="/app/results"/>
	<rn:widget path="okcs/OkcsProductCategorySearchFilter" filter_type="products"/>
	<rn:widget path="okcs/OkcsProductCategorySearchFilter" filter_type="categories"/>
</rn:container>
</form>
</div>

Configuring a Product or Category Landing Page

You can configure the Customer Portal 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 OkcsVisualProductCategorySelector 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.

To configure a product or category landing page, do the following:

  1. Open the home.php file.

    cp/customer/development/views/pages/home.php
  2. Locate the code for the OkcsVisualProductCategorySelector widget, 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"/>

For more information on the OkcsVisualProductCategorySelector widget, see the Standard Widgets section in Oracle Service Cloud Online Help User Guide. See Documentation for Oracle Service Cloud Products (Answer ID 5168) to locate the relevant guide.

Configuring Article Attributes

The Customer Portal answer page and Ask a Question pages display attributes of open articles. The default article attributes shown are as follows:
  • Document ID

  • Version

  • Status

  • Display Date

You can use the custom_metadata parameter to configure the article attributes on either or both of these pages. Table 13 Article Attributes lists the article attributes.

To configure article attributes on the Answer page:
  1. Edit the file views/pages/answer/answer_view.php.

  2. Add the custom_metadata parameter 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"/>
To configure article attributes on the Ask a Question page:
  1. Edit the file views/pages/ask.php.

  2. Add the custom_metadata parameter 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"/>
You can remove the article attributes from the pages by specifying the custom_metadata parameter with no attributes, as follows:
<rn:widget path="Okcs/SmartAssistant" custom_metadata=" "/>

Table 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.

Disabling Search by Document ID

Customer Portal users can open an article by entering its document ID in the search field. The application will bypass the search results list and open the article in the article detail page.

The search by document ID feature is enabled by default. You can disable the feature by editing the results page.

To disable search by document ID:

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

  2. Remove the document_id_ref_ex parameter as follows:

    Existing code:

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

    Modified code:

    <m:container source_id="OKCSSearch"/>

Enabling Communities for Knowledge Advanced Users

Community Self Service adds an extra layer of information for end users. When they seek an answer to their questions, search displays community content in addition to your published answers. In addition, the Knowledge Advanced SmartAssistant widget displays community discussions as well as answers.

For more information about configuring Community Self Service with Oracle Service Cloud, see the Community Self Service section in Documentation for Oracle Service Cloud Products (Answer ID 5168).

    Adding the Community Discussions Widget to the Home Page

    You can modify the Home page to include Community Self Service widget in addition to the Knowledge Advanced answers widget.

    This is the path of the home.php page.

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

    The following code adds the Community Self Service discussions widget to the home.php page.

    <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/*#n:session#">#rn:msg:SHOW_MORE_COMMUNITY_DISCUSSIONS_LBL#</a>
    </span>
    </div>
    </div>

      Displaying Discussions on the Search Results Page

      You can modify the search results page to include recent community discussions in addition to the Knowledge Advanced answers.

      Users who enter a search term can view not only the answers related to their search but also any community discussions that include the search term.
      Note: The results page displays answers fetched by Knowledge Advanced search and community discussions returned by social search.

      This is the path of the results.php page.

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

      The following code adds the community discussions widget to the results.php page.

      <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>

        Enabling Users to Display Discussions in SmartAssistant

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

        You can configure the SmartAssistant widget to display both community discussions and answers using the KFAPI_SSS_ENABLED setting. The default value of the configuration setting is No, which does not display community discussions in the SmartAssistant widget.

        If you set the value of the setting to Yes, Knowledge Advanced users will be able to view community discussions as well as published answers in the SmartAssistant widget.

        Use the following procedure to enable the configuration setting.
        1. Go to Site Configuration, Configuration Settings.

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