Home Advanced Request Offering

Hiding a request offering from showing under a service offering

Tina_SamsTina_Sams Customer Adept IT Monkey ✭✭
Hello,

We have a RO that has, at the bottom of the form, a link to another RO.  In order for users to have access to the linked RO "I can't find what I'm looking for", it has to be in a SO that they have access to.  However, I don't want it to show on the portal under the SO.  The only way that they can access that form should be through the link at the bottom of the original RO.

Does that make sense?  Is it easy-ish to do?

I had a look at this thread but I'm not sure it is what I am after and can't get it to work anyway! (my knowledge of js is somewhat limited :blush:  

Best Answer

  • Nick_FlintNick_Flint Customer Advanced IT Monkey ✭✭✭
    Answer ✓
    Each RO is contained in a div with a unique id, thankfully. So, adding something like the below code to your custom.js will remove the RO from the DOM. In essence, you're just hiding the RO. It could still be accessed by anyone who has the link to it.  I recommend using a script loader and wrapping this in a mutation observer.

    You'll also have to find the ID of the RO. One way to find the ID is to use the developer tools and the element selector in Chrome: 

    $('div[id="f1966455-f5e3-d8e2-11a2-b7bb12509407"]').remove();
    
    I only tested this on the home page that we use. The other home pages may use a different structure.

Answers

  • Chris_Chekaluk1Chris_Chekaluk1 Customer Advanced IT Monkey ✭✭✭
    Have you tried setting the appropriate RO to 'Draft' status (rather than 'Published')?  I would expect that to remove the RO from the SO in the catalog, but am not sure if that would prevent the link from working as well...
  • Tina_SamsTina_Sams Customer Adept IT Monkey ✭✭
    Thanks for the suggestion Chris but alas, it doesn't work :(  as you said, it hides it from the SO but also makes it unavailable from the link.
  • Chris_Chekaluk1Chris_Chekaluk1 Customer Advanced IT Monkey ✭✭✭
    sadly, that's what I expected would happen...
  • Nick_FlintNick_Flint Customer Advanced IT Monkey ✭✭✭
    Answer ✓
    Each RO is contained in a div with a unique id, thankfully. So, adding something like the below code to your custom.js will remove the RO from the DOM. In essence, you're just hiding the RO. It could still be accessed by anyone who has the link to it.  I recommend using a script loader and wrapping this in a mutation observer.

    You'll also have to find the ID of the RO. One way to find the ID is to use the developer tools and the element selector in Chrome: 

    $('div[id="f1966455-f5e3-d8e2-11a2-b7bb12509407"]').remove();
    
    I only tested this on the home page that we use. The other home pages may use a different structure.
  • Tina_SamsTina_Sams Customer Adept IT Monkey ✭✭
    Thank you Nick, all sorted now :smile:
Sign In or Register to comment.