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>