-
Re: get current page URL
mcollinge Jan 30, 2015 6:28 AM (in response to surabhimishra)Try request.getRequestURL()
-
Re: get current page URL
surabhimishra Jan 30, 2015 9:58 AM (in response to mcollinge)Thanks Matt, it worked.
The problem i'm facing is with the content URL such as of document : https://community.jivesoftware.com/docs/DOC-120002
I want to get the community name to which the document/content belongs from the URL but the URL does not contain the community name.
I thought with JiveResourceResolver.getPageURL()/request.getRequestURL() would get the community name of the content with it.
Please suggest any method to be used in FTL with which we can get it from content URL.
Thanks
-
Re: get current page URL
mcollinge Jan 30, 2015 10:25 AM (in response to surabhimishra)Hmm. not on my dev pc right now, but isn't it document.getContainer() ?
-
Re: get current page URL
surabhimishra Jan 30, 2015 11:51 PM (in response to mcollinge)Hey Matt,
document.getContainer() not working to give community name 'Developer' from https://community.jivesoftware.com/docs/DOC-120002. Please suggest some other method.
Thanks.
-
Re: get current page URL
mcollinge Jan 31, 2015 10:30 AM (in response to surabhimishra)You have to do a bit more than that.. Check out the Java action that it's using and it'll show you all the methods you can call.. Also look in other ftl's to see what they do. Best way to teach you how to do this stuff :)
-
Re: get current page URL
surabhimishra Feb 2, 2015 3:16 AM (in response to mcollinge)Hi Matt,
In unauth.ftl I replaced <@s.text name="login.err.notAuthToViewCnt.info"/> with certain html text to modify the unauthorized error.
I could not find '@s.url action' for this. Is 'login' the action class for it? If yes, how can I find the method that should work for getting content's community name
Thanks
-
Re: get current page URL
mcollinge Feb 2, 2015 5:29 AM (in response to surabhimishra)Ah yes, LoginAction.java doesn't have any idea what piece of content it's talking about.. the user has been redirected to that page & it loses any notion of the content that's in error
-
Re: get current page URL
surabhimishra Feb 2, 2015 5:47 AM (in response to mcollinge)Ok, please suggest if any other way we can get the community name for the unauthorized content
Can it be done:
1. If we can change the url syntax to include community name parameter.
2. With a rest API call passing document id, from unauth.ftl. Can we have api call from ftl?
or any other?
Thanks
-
Re: get current page URL
mcollinge Feb 2, 2015 5:59 AM (in response to surabhimishra)Yeah, you could possibly look at the URL and use the REST API to find the container/parent (which is what you asked on that other thread you started). We do something similar for our 404 pages, where we'll search for content on our site with a similar title.
-
-
Re: get current page URL
mcollinge Feb 2, 2015 6:27 AM (in response to surabhimishra)We do it using standard jQuery ajax calls, and processing the JSON response.
-
Re: get current page URL
surabhimishra Feb 2, 2015 6:44 AM (in response to mcollinge)Could you please provide with an example in ftl or any ftl having such call, for reference.
Thanks
-
-
-
-
-
-
-
-
-
-
-
Re: get current page URL
puja_kumari Nov 20, 2019 4:34 AM (in response to mcollinge)Hi Matt,
How can we use request.getRequestURL() in .soy template ?
-
Re: get current page URL
mcollinge Nov 20, 2019 4:47 AM (in response to puja_kumari)I don't think you can.
-
Re: get current page URL
puja_kumari Nov 20, 2019 9:55 AM (in response to mcollinge)So, Is there a way to get current page url in soy template? I don't want to use it via js code inside soy template.
The only option I see is to build url using the contextObject.id based on it's type.
But this will increase the lines of code. I wanted to have a simple way like we had in ftl
-
-
-
-
Re: get current page URL
urvashi Mar 11, 2015 6:04 AM (in response to surabhimishra)Hi Matt Collinge,
Yes, even I am too curious to know about this? If, you can help with it !!
I too want to know how the REST Calls work in Jive 6.0 ftl files!
Thanks in advance!
Urvashi