- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2017 03:23 AM
Hi SNC,
I have a requirement where I want to add additional widgets to the Form page (id=form) but, they should only be present if I am accessing this Form page through my XXXXX Portal, since this is a page used in many other Portals.
Any ideas on how to set a restriction like this for the additional widgets to be exhibited only on the XXXX Portal?
Thanks in advance.
Fábio Gonçalves
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2017 04:29 AM
Yup. Thanks!
& Just to let you know that in the above suggestion we used validation in client side only.
In Order to validate in server side + client side + HTML - you can use below example :
Server script:
(function() {
data.portal_visible = false;
var portalGr = $sp.getPortalRecord();
if(portalGr.url_suffix == 'sp') {
data.portal_visible = true;
}
})();
Please let me know if you are looking for anything else.
If your query is Resolved, would you mind marking my answer as correct and close the thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2017 03:43 AM
Hi Fabio,
You mean, your custom widget should work for only "XXXX Portal" ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2017 03:49 AM
Yes, exactely.
For instance, if I access this Form page via Portal1 the widget should be present but, if I access this Form page via Portal2, the widget should not appear.
Thanks,
Fábio Gonçalves
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2017 03:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2017 04:00 AM
This also works :
c.selected_portal = $location.$$path.replace('/','');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2017 04:00 AM
And simply replace '/sp' in the HTML Template by the id of my Portal?