Troubleshooting Themes

These frequently asked questions and answers help you troubleshoot and correct problems in theme development.

Click a question to view the answer.

How can I include OSGi headers in my theme? 

Specify the headers you want to use in your theme's liferay-plugin-package.properties file. Any headers placed in this file are included automatically in your MANIFEST and the OSGi bundle.

For example, you can add OSGi dependencies in your theme by importing the exported package with the Import-Package header:

Import-Package:com.liferay.docs.portlet

Why aren't my changes showing up after I redeploy my theme? 

By default CSS, JS, and theme template files are cached in the browser. During development, you can enable Devloper Mode to prevent your theme's files from caching.


Why is my theme not loading? It returns the default theme instead. 

If you receive the warning "No theme found for specified theme id...", you may be referencing an outdated theme ID in your Site. Verify that the theme ID in your theme's liferay-look-and-feel.xml matches the theme ID in the warning message: "mytheme_WAR_mytheme". If the theme IDs match, there may be pages using the outdated theme instead of the Site theme. You can verify this by checking the pages manually or searching the database for layouts with values for themeId -.


How can I prevent specific CSS rules from transforming for RTL Languages? 

You can prevent specific CSS rules from transforming (flipping) with the /* @noflip */ decoration. Place the decoration to the left of the CSS rule to apply it. For example, this rule gives a left margin of 20em to the body no matter if the selected language is LTR or RTL:


      /* @noflip */ body {
       margin-left: 20em;
      }
      

You can also use the .rtl CSS selector for rules that exclusively apply to RTL languages.

« Archiving Site ResourcesLayout Templates »
この記事は役に立ちましたか?
1人中0人がこの記事が役に立ったと言っています