RE: Use theme configuration in a Layout

Axel LEFEVRE, modified 5 Years ago. Junior Member Posts: 25 Join Date: 2/18/20 Recent Posts
Hi, I would like to know if it is possible to use theme configuration in a Freemarker Layout? I followed all the steps of this doc (https://portal.liferay.dev/docs/7-2/frameworks/-/knowledge_base/f/making-configurable-theme-settings), but I cannot recover the configuration in my Layout. Is this normal? It is only possible to use the configuration outside of Layouts, as in portal-normal.ftl? Thanks for your help
Lee Jordan, modified 5 Years ago. Expert Posts: 449 Join Date: 5/26/15 Recent Posts
You could in the theme portal_normal throw a 0px height div into the HTML like div id="theme-settings" and attach all kinds of classes to it then use jQuery hasclass() in the layout to see if the page contains certain theme settings.

That should work for ADT (widget templates) and web content templates and fragments too.