How to get the page name from URL? GlideTransaction URL always returning "/view_content.do"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2016 03:28 AM
Hello Everyone,
I have two sites in my system & I want to block all the pages of first site to the user of second site. And if user tries to access first site then system should redirect the user to home page of the second site.
Now I am able to block all the pages of first site but because of this system is always redirecting the user to home page of the second site. What I mean is, if user tries to access pages of the second site, then also system is redirecting the user to the home page of the second site.
So to avoid this I am trying get the pages from the URL & if URL contains page of the second site then system should stop the redirection & it should move to that particular page.
I am trying to implement this using "GlideTransaction". Here is code snippet
var transactionExt = GlideTransaction.get();
gs.log("Transaction URL: "+transactionExt.URL);
gs.log("Transaction URL String: "+transactionExt.URLString);
But "transactionExt.URL" is always returning "/view_content.do"[Transaction URL: /view_content.do] & because of this system is not able to find out the correct page & it is redirecting to home page.
From below discussion, I found out that there should be one record in the "Content Type" table but I am not clear on this.Do I need to create new record in 'content_type' table for every page?? And we have configured SAML 2.0 in our instance.So please guide me on this & if there is any other solution then please let me know.
Thanks
Abhinandan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2016 11:56 AM
Hi Abhinandan,
You can just use ${current_page.getURLSuffix()} to grab the URL Suffix from a page in the CMS. You can also grab the URL with front-end JS by using decodeURIComponent(document.URL).
Thank you,