Customer Portal

Get Involved. Join the Conversation.

Topic

    Qing Liu
    Show/hide page content based on SLA
    Topic posted August 10, 2010 by Qing LiuGold Medal: 3,500+ Points, last edited October 29, 2011 
    6247 Views, 37 Comments
    Title:
    Show/hide page content based on SLA
    Content:

    Hi All,


    The manual of Nov 2009 indicates we can hide page content with an SLA condition. Cool, but I test rn condition tag; it does not seem to work for me.


     Here is my test code:


    <rn:condition sla="internal_US" >


    <p>The content is only showing to Agents who have internal US SLA</p> </rn:condition>.


    As I read from community (https://cloudcustomerconnect.oracle.com/posts/26403dc734), the rn:condition SLA will only check SLA options, like  <rn:condition sla="selfservice">, <rn:condition sla="incident"> etc. It will not check SLA ID.


    If that is true, how we can show/hide contents on end users page based on SLA ID?  In my case, internal_US(17), internal_UK(18) both get different SLA ID.


    Is it some simply way to do like


    <rn:condition sla_id="17">,


    Show to US people


    </rn:condition>


    <rn:condition sla_id="18">,


    Show to UK people


    </rn:condition>


    I also look at SlaDiv widget, I found out that it also only reads SLA options


    Thanks you,  I am looking forward to your reply

    Comment

    • Qing Liu

      Hello All,

      @Jim, i think you can check the SLA instance and SLA.id as well. By comparing these two parameters, you should able to do know what content the end users can view. Plus you may need to modify my code in controller, using if condition instead of switch case. I will attach a report to you which i am using to get all SLA variables in my company SLA setup.

      Or you can set up access level tie SLA to achieve that. I prefer this way.

      http://crm.rightnow.com/app/answers/detail/a_id/1838/kw/access%20level/related/1

      In my case, i have two types of customers in US region. US customers A can view US content A only, US customers B has to view content A and B, and EMEA region content as well. I used the combination access level with SLA making it work.

      --------------------------

      Your second question, you can build your own controller to call the check SLA model. So, in your template( it is a view)

      if (( $this->load->view('slaCheck')=='US')

      {

      //THen show this

      }

      elseif ..

      {

      }

      I have not do it by myself, since i need to focus on something else.

      Currently, i use another solution. I built many SLA check widget, and use the view of SLA widget to hold different widgets.

      <rn:meta controller_path="custom/SLAAnnouncement"  compatibility_set="November '09"/>

      <?if($this->data['display']=='EMEA'):?> <!--EMEA-->
          <rn:widget path="custom/AnnouncementTextEMEA"/>

      <?elseif($this->data['display']=='US'):?>

          <rn:widget path="custom/AnnouncementTextUS"/>

      <?elseif($this->data['display']=='USINC'):?> <!-- US plus EMEA-->

          <rn:widget path="custom/AnnouncementTextUS"/>

      <?elseif($this->data['display']=='AU'):?> <!-- AU uses EMEA-->

          <rn:widget path="custom/AnnouncementTextEMEA"/>

      <?elseif($this->data['display']=='TTB'):?>
              <rn:widget path="custom/AnnouncementTextTTB"/>

      <?endif;?>

      I guess you can do that same for navigation tab, like

      like

      <?if($this->data['display']=='EMEA'):?> <!--EMEA-->

      <div id="rn_NavigationBar">
                  <ul>
                      <li><rn:widget path="navigation/NavigationTab2" label_tab="#rn:msg:SUPPORT_HOME_TAB_HDG#" link="/app/home" pages="home, "/></li>
                      <li><rn:widget path="navigation/NavigationTab2" label_tab="#rn:msg:ANSWERS_HDG#" link="/app/answers/list" pages="answers/list, answers/detail"/></li>
                      <li><rn:widget path="navigation/NavigationTab2" label_tab="#rn:msg:COMMUNITY_LBL#" link="javascript:void(0);" external="true"/></li>
                      <li><rn:widget path="navigation/NavigationTab2" label_tab="#rn:msg:ASK_QUESTION_HDG#" link="/app/ask" pages="ask, ask_confirm"/></li>
                      <li><rn:widget path="navigation/NavigationTab2" label_tab="#rn:msg:YOUR_ACCOUNT_LBL#" link="/app/account/overview" pages="utils/account_assistance, account/overview, account/profile, account/notif, account/change_password, account/questions/list, account/questions/detail, account/notif/list, utils/login_form, utils/create_account, utils/submit/password_changed, utils/submit/profile_updated"
                      subpages="#rn:msg:ACCOUNT_OVERVIEW_LBL# > /app/account/overview, #rn:msg:SUPPORT_HISTORY_LBL# > /app/account/questions/list, #rn:msg:ACCOUNT_SETTINGS_LBL# > /app/account/profile, #rn:msg:NOTIFICATIONS_LBL# > /app/account/notif/list"/></li>
                  </ul>
              </div>

      something like that

    • Qing Liu

      For example, my answer/list page looks like:

      <rn:widget path="custom/SLAAnswerListWidget>

      And in the custom widget view.php:

      <rn:meta controller_path="custom/SLAAnswerListWidget"  compatibility_set="November '09"/>

      <?if($this->data['display']=='EMEA'):?> <!--EMEA-->
      <div id="cs_AnswerPageTitle">
          <div id="cs_PageTitle"> <h1> Search results</h1> </div>
          <div id="cs_Paginator">
          <rn:widget path="custom/Paginator" report_id="141055"/>
          </div>
      </div>
      <div id="cs_ResultInfo">
          <div id="cs_searchPageInfo"><rn:widget path="custom/ResultInfo2" report_id="141055" per_page="15" add_params_to_url="p,c"/> </div>
          <div id="cs_filterResult"><rn:widget path="custom/DisplaySearchFilters" report_id="141055"> </div>
      </div>

      <div class="rn_AnswerList">
          <div id="cs_AnswerList">
          <rn:widget path="custom/Multiline2" report_id="141055" per_page="15"/>
          </div>
      </div>

      <?elseif($this->data['display']=='US'):?>
      <div id="cs_AnswerPageTitle">
          <div id="cs_PageTitle"> <h1> Search results</h1> </div>
          <div id="cs_Paginator">
          <rn:widget path="custom/Paginator" report_id="141057"/>
          </div>
      </div>
      <div id="cs_ResultInfo">
          <div id="cs_searchPageInfo"><rn:widget path="custom/ResultInfo2" report_id="141057" per_page="15" add_params_to_url="p,c"/> </div>
          <div id="cs_filterResult"><rn:widget path="custom/DisplaySearchFilters" report_id="141057"> </div>
      </div>

      <div class="rn_AnswerList">
          <div id="cs_AnswerList">
          <rn:widget path="custom/Multiline2" report_id="141057" per_page="15"/>
          </div>
      </div>

      <?elseif($this->data['display']=='USINC'):?> <!-- US plus EMEA-->
      <div id="cs_AnswerPageTitle">
          <div id="cs_PageTitle"> <h1> Search results</h1> </div>
          <div id="cs_Paginator">
          <rn:widget path="custom/Paginator" report_id="141056"/>
          </div>
      </div>

      I do not know whether it is a good solution. But it works for me.

    • jrinke

      Qing:

      This is excellent!  I didn't think of embedding just the nav bar div in the widget and then including the widget in the standard template.  Great idea!  Now the only trick is to make sure I know all of the SLAs a customer has.  I will try your suggestions above.

      Thanks,

      Jim

    • jrinke

      Qing:

      re: I will attach a report to you which i am using to get all SLA variables in my company SLA setup.

      Would you mind too much resending the report?  I inadvertantly deleted it before I got a chance to look at it.

      Thanks,

      Jim

    • Qing Liu

      can u email to me pls ? qing.liu@tomtom.com

    • jamie23aks

      Say I know this is a really old thread, but I'm trying to do the same thing on a nov '10 site. I am not at all a web dev. I've tried and failed at creating this custom widget. Would anyone be willing to walk me through it?

       

      thanks

      james

       

    • jrinke

      I can help you with it but not for a week or so.  Sorry, I'm totally absorbed in a major project right now.  If you want to schedule something in a week, please send me an e-mail.  jerinke@tmw.com

       

    • Maria

      Please,

      How can I do it in the new version November 2012?

      I need show a specific TAB if SLA = "EMEA"   (for example)

       

      Thanks a lot

    • jrinke

      Maria:

      I don't have November 2012.  Unless they have changed something that prevents it from working, it should work the same way.  Did you try it?  Did you get some kind of error message or something?

    • Maria


      Hi Jrinke,



      The new framework 3.0 works very different.



      Look: https://cloudcustomerconnect.oracle.com/posts/7f316c0aec



       



      Regards,



      María

    • ksmithSerSol

      Hi Maria,

      We're also on Nov '12 and we control visibilty of content based on SLAs this way:

       

      1. Attached is an sla_check model file.

      2. In the template, the model is called in the header with this code:

      <?php $this->load->model('custom/Sla_check'); // load custom model for checking user's SLA ?>

      3. When there is content that needs to be visible to only a certain SLA, the content is surrounded by the following code:

       <?php /*visible with sla_set if ( $this->Sla_check->visible('6') ) : */?>             

      <?php /*visible with sla_id*/ if ( $this->Sla_check->visible('20') ) : ?>

      CONTENT


      <?php endif; ?>

      4. The numbers are referencing the sla_set (not the ID), and the only way I could figure out how to find the SLA set number was to run a report.

       

      I didn't actually write this code so I may not be of much help if you have any questions, but it works pretty well for us.

       

      ~Kelli

    • Maria

      Thanks  ksmithSerSol for the fast answer.

      Please, can you explain me the procedure, because I'm very confused.?

       

       1. Copy the file sla_check.php  to models/custom folder

       2.  In the template: what template? Can you help me to understand? :) I need create a custom widget?

       3.  I want show a Tab  in Home page if the SLA="Gold"

      Thanks a lot, really

       

    • ksmithSerSol

      Hi Maria,

      We have most of our navigation set up in the standard.php template - development\views\templates, but the code can be placed on any page.  We have it on a few other pages as well (answers page, for example).  So, you'll just need to add that code to whatever page has the navigation tabs and replace the SLA set numbers with your own.  You don't need a widget for it - just the model should work.

      Hope that makes sense!

       

      ~Kelli

    • Maria

      Excelent. I'll try....

      Can I Add code like  <?php $this->load->model('custom/Sla_check'); // load custom model for checking user's SLA ?>  in standard template?

      Thanks Kelli

    • Maria

      Hi Kelli...

      I have a Fatal Error 
      Fatal error: Class 'Model' not found in /cgi-bin/imcloud.cfg/scripts/cp/customer/development/models/custom/sla_check.php on line 7

      In attached file I show the files.

      Do you know what?

      Thanks a lot