Advait Trivedi 12 Years Ago Hi Erik, Thanks for this. themeDisplay is indeed very used in JS. Do we always have to use themeDisplay inside AUI.ready() function ? or is accessible directly on any Liferay page with AUI.ready() ? Please sign in to reply. Reply as... Cancel Erik Andersson Advait Trivedi 12 Years Ago Hi Advait, the themeDisplay object is put on the global context object (in general the window object) so yes it can be accessed outside the AUI sandbox, i.e. outside the AUI.ready() function. Please sign in to reply. Reply as... Cancel
Erik Andersson Advait Trivedi 12 Years Ago Hi Advait, the themeDisplay object is put on the global context object (in general the window object) so yes it can be accessed outside the AUI sandbox, i.e. outside the AUI.ready() function. Please sign in to reply. Reply as... Cancel
Adrian Rodriguez Monedero 12 Years Ago This shorter version should also work. shouldn't it?var isPrivateLayout = themeDisplay.isPrivateLayout() == 'true'; Please sign in to reply. Reply as... Cancel
Tanweer Ahmed Ansari 12 Years Ago Thanx Erik for the info. Please sign in to reply. Reply as... Cancel
Erik Andersson 12 Years Ago Adrian, yes of course that works and is better than using the conditional operator in this case. Thanks. Please sign in to reply. Reply as... Cancel
Kyrre Myrbostad 12 Years Ago Hi, this looks very promising. However my themeDisplay object is always empty, is there some setting in portal-ext.properties to enable it? Please sign in to reply. Reply as... Cancel Erik Andersson Kyrre Myrbostad 12 Years Ago Hi Kyrre, no you should not have to enable anything in portal-ext.properties for this. What version of Liferay are you running? Do you get any empty themeDisplay object both inside and outside the the AUI.ready() function? Also, are you sure that your themeDisplay object is empty? If you log it to the console with console.log(themeDisplay) the output will look like "Object {}". Thus it appears to be empty, but if you click on "Object {}" you can browse down the object. Please sign in to reply. Reply as... Cancel
Erik Andersson Kyrre Myrbostad 12 Years Ago Hi Kyrre, no you should not have to enable anything in portal-ext.properties for this. What version of Liferay are you running? Do you get any empty themeDisplay object both inside and outside the the AUI.ready() function? Also, are you sure that your themeDisplay object is empty? If you log it to the console with console.log(themeDisplay) the output will look like "Object {}". Thus it appears to be empty, but if you click on "Object {}" you can browse down the object. Please sign in to reply. Reply as... Cancel