0

We have an issue with the theme we created for Liferay and to me it seems like we are doing something wrong, because it seems like a very stupid problem. We use Maven builds for all our plugins and therefore have a build artifact containing a version number. When we deploy the theme, it looks like Liferay creates an ID for the theme based on the theme name specified in the look and feel XML of the theme and the name of the .war file. It looks something like xxxx_WAR_yyyy, which is very confusing to me. When we deploy a new version of the theme, Liferay will create a different ID for it and thus all pages using the "old" theme, will not be updated to the new version.

There has to be some way to specify a unique ID for a theme that will never change, no matter what file the theme has been deployed as. The file name should not have any meaning for Liferay, in my opinion. Is there some way to do this? Obviously we could just always deploy the file with a fixed file name, but somehow it seems to me like we are doing something wrong, missing a configuration setting or something. Is there a way of forcing a unique ID on a theme?

Till Helge
  • 9,253
  • 2
  • 40
  • 56
  • inside look and feel tag "" in liferay look and feel.xml – Laxman Rana Nov 12 '13 at 05:53
  • @LuckyBoy Yes, but the theme id specified here will only be the `xxxx` part in `xxxx_WAR_yyyy`, so I don't have full control over the theme ID. There is a part that is generated from the name of the .war file. – Till Helge Nov 12 '13 at 08:58

2 Answers2

0

In your pom.xml of theme project, give this

<artifactId>your-theme</artifactId>
<name>${project.artifactId}</name>

This should create a same name artifact when you deploy any version of your theme.

Felix Christy
  • 2,179
  • 1
  • 19
  • 32
  • As I mentioned in my question, I'm aware of that being a possible solution. But I just don't like the idea that the name of the deployed file has any impact on the ID, which is actually stored in the database with every page and decides on how pages are displayed. I would like to have a solution, where I can specify 100% of the theme ID myself. – Till Helge Nov 12 '13 at 08:57
0

According to the first paragraph of the question as a solution i think , if at first you'll disable the older version theme(not only do it from admin section but also remove that specific theme directory from webapps) , then deploy the newer version of theme. Next enable the newer version theme for all public pages from liferay admin section .Then if you check , in all pages newer version of the theme been applied . If you wish , can also try in this way . Hope this'll be helpful .

  • I don't think this will work, because we have different theme settings for different pages, so changing the theme for public pages probably will not affect all of the subpages. – Till Helge Nov 13 '13 at 10:05
  • Ok , then you can enable that theme for only required pages(i.e. sub pages).In liferay admin section there is option to select separate themes for different pages. – user2098064 Nov 13 '13 at 11:52