0
votes

I'm relatively new to CSS and very new to Liferay. I have a custom theme I'm trying to build. Just for testing, I was trying to change the title text color for portlets on the page. In my custom.css, I have

.portlet-title {
   float: none;
   font-weight: bold;
   min-width: 50%;
   padding: 5px;
   text-shadow: 1px 1px #FFF;
   color: #800000;
}

I'm assuming this is the correct class, because adding the color in the firefox inspector under this class changes the color. However, when I deploy the theme, it reverts back to

.portlet-title {
      float: none;
      font-weight: bold;
      min-width: 50%;
      padding: 5px;
      text-shadow: 1px 1px #FFF;
}

if I ftp to the folder for the theme, the changes I made are still in the custom.css. For some reason, when the theme renders in Liferay, it reverts back to the css from before I made the changes. I've tried everything I know to try including clearing the browser cache. Any thoughts?

3
Pl make sure that u are making the changes in the _diff folder.Danish

3 Answers

1
votes

It sounds like you're updating the files on the webserver directly ("ftp the folder for the theme") instead of changing it properly, e.g. in development environment, building a new theme.

Liferay minifies the CSS (and javascript), concatenating all CSS files into one and eliminating the whitespace. There's also SASS processing. All this is cached, so the odds are that Liferay will not detect your changes without redeploying a new theme.

Use the "raw" development version of your theme, make your changes there (in the _diffs folder) and build an updated theme plugin. Deploy that to Liferay, and the changes will be picked up.

1
votes

Things that could be the cause + remedies for each:

  1. Assure developer properties are in use and fast.load.css and and fast.load.js properties are in place in your portal-ext.properties: E.g. - In {tomcat}/bin/setenv.sh : -Dexternal-properties=portal-developer.properties as mentioned, and In portal-ext.properties set: theme.css.fast.load=false and javascript.fast.load=false.

  2. Be sure you are building from your IDE / Liferay SDK, based off of changes you made to the _diffs folder and deploying those changes to your Liferay node(s). Hot deploy can be accomplished by pushing your theme.war file to the Liferay /deploy directory. Be sure to deploy the changes to all nodes of your cluster, if more than on application server is in use behind a load balancer.

  3. You may need to stop Liferay, then clean the /temp and /work folders of your application server. This further assures that some pre-cached files are not being presented to the client.

  4. CDN enabled? Is there a Varnish (or some other) cache mechanism in front of your application layer? - Are you using the Liferay CDN feature (Liferay Portal Settings main screen) to cache .js, .css, images, and other files to alleviate that strain off of Liferay? Disable the CDN feature or review your method of caching to be sure your latest files are being 'seen' as the new version to be cached. Some set up a www tier in front of Liferay and copy their theme (and other) files to that www tier to be delivered by it. If that is your architecture, you will need to assure a copy of your new theme files are also copied to the www tier.

  5. Clean the cache of any browser you are testing with, or use "Private browsing" or "Incognito" windows to assure you aren't loading anything from the browser cache.

0
votes

Add the below property to your JAVA_OPTS and check?

JAVA_OPTS="-Dexternal-properties=portal-developer.properties"