Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Get themeDisplay object from rest module
Hello! Could you help me please
I have a problem with getting themeDisplay object from rest liferay module.
Any ideas?
Thank you!
I have a problem with getting themeDisplay object from rest liferay module.
@GET
@Path("/evening")
@Produces("text/plain")
public String helloevening() {
// Here I need to get themeDisplay object
return "Good evening!";
}
I need it to get analyticsScripts from the Configuration -> site settings -> Advanced -> Analytics section. Get them all and return them as a response of rest call.Any ideas?
Thank you!
Hi,
Can you pls let us know the reason for themeDisplay Object in Rest ? , Also if your looking for User or Request related objects you can check out the below link it might help you
https://liferay.dev/blogs/-/blogs/rest-custom-context-providers
Can you pls let us know the reason for themeDisplay Object in Rest ? , Also if your looking for User or Request related objects you can check out the below link it might help you
https://liferay.dev/blogs/-/blogs/rest-custom-context-providers
the reason is following
User click on a button on the website and I want to get some script from Configuration -> site settings -> Advanced -> Analytics section and paste it in the header section of HTML
User click on a button on the website and I want to get some script from Configuration -> site settings -> Advanced -> Analytics section and paste it in the header section of HTML
Nikita Laitinen:
I have a problem with getting themeDisplay object from rest liferay module.
...
I need it to get analyticsScripts from the Configuration -> site settings -> Advanced -> Analytics section. Get them all and return them as a response of rest call.
There's your actual question: You need the configuration values, not the ThemeDisplay.
I'd check the module that holds this configuration, see what's exported and what API is available.
You can either load the same configuration if everything is exported (e.g. by referencing it with the name it's registered) or access the API to query for the values you need.
ThemeDisplay is a concept for pages served by Liferay - and a REST call is not for a page, has no theme, etc - thus the subject clearly points to a XY-Problem that you shouldn't persue any longer.
Good ideas!
I noticed that these scripts are loaded in html -> common -> themes - > top_js.jsp. The start point is layout object and I thought I can use ThemeDisplay to get layout and then achieve scripts like it is described in that file
I noticed that these scripts are loaded in html -> common -> themes - > top_js.jsp. The start point is layout object and I thought I can use ThemeDisplay to get layout and then achieve scripts like it is described in that file
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™