I'm trying to get the entire URL of the current page in FTL file. (Jive 7)
I tried using JiveResourceResolver.getPageURL() but getting it blank.
Please suggest a way.
Thanks Matt, it worked.
The problem i'm facing is with the content URL such as of document : https://community.aurea.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.
Hmm. not on my dev pc right now, but isn't it document.getContainer() ?
document.getContainer() not working to give community name 'Developer' from https://community.aurea.com/docs/DOC-120002. Please suggest some other method.
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 :)
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
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
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?
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.
that sounds good, but I could not find how to do this in ftl file. Is it shown in any existing ftl I can check for reference?
It will be great if you could please help with it - How do we call from ftl, parse JSON in it and get the name.
Image you sent:
We do it using standard jQuery ajax calls, and processing the JSON response.
Could you please provide with an example in ftl or any ftl having such call, for reference.
How can we use request.getRequestURL() in .soy template ?
I don't think you can.
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
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!
Retrieving data ...