Navigating Multiple Service Portals

A common question I get asked is how to link between two portals. Simply linking to the URL will not work due to Angular.js handling the routing.

The easiest solution for this is to use target=”_self attribute on all hyperlinks:
If you would like to redirect from within a widget client controller, you can use: $window.location.href: 
HTML:
Controller:

 

15 comments

  1. Hey Nathan,

    So in my situation where I’d like to use an Icon Link widget to reference another portal, which of the above would I use? In the widget I have the ability to set the “Link Type” to URL which then gives me an HREF/URL text field- Do it here?

    Also, pretty simple question for this- How do I know what the URL is of the different portals? In your example above (Link), would “/portal2” be equal to the URL suffix you identify for that portal? As in Title = Technical Service Portal and URL Suffix = technical_needs.

    There’s also another area in the code for “Link”, which I assume is where you put the portal URL. How do you know what that is?

    Any help is appreciated!
    -Marques

    1. Marques, the Icon Link widgets does not currently support linking between portals but it would be pretty simple to update it to support this. I would customize the sp_instance_link form and add a field called “Target” and then update the widget to always include the target if specified.

      Yes, the url between the portals is the url suffix.

      “Link” inside the scripted items is a object that takes the following properties: title, type, href and can also have an “items” array for sub menu items.

      1. Are you creating a new field via the dictionary for the target? How would I go about updating the widget to utilize this field?

  2. Nice one..great for multiple purpose portals.

    I suggest that you make a tutorial about using the modal widget.

    Looking forward to it.

  3. Hey Nathan,
    similar question like Marques, how to do this from Menu item, where possibilities are URL or page? Or some hack for scripted list?
    Thank you,
    Lukas

    1. Similar to what I just responded to Marques, it’s not currently supported but would be pretty simple to fix. Customize the Menu Item form and add a field called “Target” and then update the widget / ng-template to always include the target if specified.

  4. Where’s the documentation on how one just navigates through “pages” within a single portal, without having to hard code “sys_ids/ID” in the ng-href? I noticed in the out of the box “breadcrumb” widget there’s a {{portal.homepage_dv}} but I have no idea where this is being set or called from?

    1. The “portal.homepage_dv” is a reference to the “portal” object which automatically exists on scope within the controller and is a representation of the current Portal you are on. You should not have to link using any sys_id or id. The majority of widgets including the Header Menu and Icon Link widgets have a “type” field where you can select what you are linking too… and if you select Page, it will give you a reference field to select which page.

  5. Great Stuff as always Nathan.

    Just a quick question, Is it possible to let end users add widgets in the portal? Like what they do in the homepage? and let them drag the widget to their desired position ?

    Thanks

    Broderick

    1. Not out of box, but this is something we have been working towards. We have a working proof of concept, but evaluating the demand to see if this is something we should finish and productize. If you’re interested we could set up a quick call to discuss.

  6. Hi Nathan,

    I am new to this angular js and now we are implementing Service portal in Helsinki. Where we have a requirement that user will have a menu Knowledge and if he clicks it should take to knowledge home page.

    Is it possible in service-portal ? can we call a home page?

    It would be great if you help us?

    Thanks
    Indu

    1. Indu,

      I’m guessing you are referring to a KB homepage where the user can select which KB to view… this functionality does not exist in Service Portal out-of-box. The standard implementation is a single KB tied to a portal. You could certainly develop the widgets to do this and would not be that difficult… but would require custom development. I suppose the alternative would be to just to link to the platform KB, but that would look terrible and defeat the whole purpose for using Service Portal in the first place.

  7. What if i just want to navigate to another page?
    AND
    What if i want to pass a bit of data on the new page?

    For instance, on a list of incidents, i have a view button for each ticket, which calls a method in the controller “view.” This method takes a parameter of the incident data object. I would like the button to open another page with more information about the incident.

    How can i do this and add a “Back” button or at least add breadcrumbs?

  8. Hello Nathan ,We have a similar requirement where if the User without roles try to login by clicking login for “XXX.service-now.com/SAP” is redirecting to SAP(as expected and SAP is the URL suffix of the service portal). but if the user with roles perform the same action its redirecting to nav page , I checked the Login properties ,created “glide.entry.first.page.script” and checked Header information of the portal as its redirecting to modalLogin Where can I find “modalLogin” and is there a better way to redirect both users with roles and without roles to SAP if they tried login ?.

    and if the user tries to login to serviceNow will the changes effect? if user with role tries to login XXX.service-now.com then he should redirect to navpage ( as expected ) but if tried to login from XXX.service-now.com/SAP then should redirect to portal

    Can you please suggest , thanks in advance

Leave a Reply

Your email address will not be published. Required fields are marked *