简体   繁体   中英

Unable to access web content's request object when linked to asset publisher

On adding a web content in an asset publisher, we are getting empty request object but if we add the same web content in web content display then we are able to see the request object.

Here is what I tried:

  1. Create a web content and try to print $request object.
  2. Add this web content into an asset publisher. We observe request object to be empty("{}").
  3. Add the same content in web content display to validate.

My requirement is: I need the themeDisplay object which is available inside request object of "web content".

Any idea whether this is expected behavior? Whether this is any possible workaround to achieve my requirement?

Thanks in advance!

Which Liferay you are using ? If you are using 6.2 then why don't use ADT? It contains ${themeDisplay} (FTL), $themeDisplay (VM) objects, or given below code (LR 6.1) also work. If you are using 6.1 then $request.theme-display will workout.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM