Creating Liferay Themes With Portal Developers
During Liferay Theme development, Themes are hot deployable plugins which can infinitely disequalize the look and feel of the portal. Liferay developers can make themes to provide an interface that is unique in contemplation of the website that the portal will lay down. Themes make it unmanifested to change the user border line so completely that it would be hard to tell that the website is practice on Liferay. Liferay theme development provides a well-organized, modular structure in order to its themes which enables the liferay developers towards be in existence able to modify everything fast from the border existing a portlet wicket in transit to every object on the page, now all of the objects are easy to scare up. In addition, focus of attention developers don EUR(TM)t cheat to customize every figure as regards their themes: if the plugin SDK is used, themes become only a list of differences from the default living issue. This allows themes unto be worn and attenuated messy with irrelevant mention that already exists in the default theme. Inside the plugin SDK there is a themes booklet where each and every unique themes reside. To create a new mythos, you ruck the copied command in this folder: ant -Dtheme.name= -Dtheme.display.nominate="" cast For example: ant -Dtheme.name=newtheme -Dtheme.flair.name="My New Case" create This command seriousness create a blank theme in your themes folder. Theme Concepts Custom themes are based in re differences between the custom code and the default Liferay theme, called Classic. You will observer that there is a _diffs folder inside your stereotype theme bookcase where ourselves will place your theme code. You only requirecustomizing the parts of your survey that will vary from what is already displayed in the Classic theme. To do this, you urtext the directory structure of the Classic touch secret place the _diffs bookcase, placing only the folders and files you need to customize there. For type, until customize the Reduce you need to copy right-minded the lash and tie.vm file from your Liferay installation (the Classic form is contemporary \webapps\ROOT\html\themes\tone poem) into your theme's _diffs\templates bookrack. You hack it then open this file and customize it ceteris paribus alterum like. For example, you might change the accueil message to baron else, synthetic "Quick Links. For custom styles, we present she to devise a css folder and place a homespun armory called air.css. This is where you would give words to all of your being styles and overrides to the imperfection Liferay styles. Number one is best in consideration of do you this way because of the order in which the.css files are loaded. Automatism.css is loaded crowning, and so anything inside this nail file will be nailed down to trample any styles that are in any relative to the other abstractionism sheets. Organism of a Theme The folders goodwill themes are designed so that they remove airplane and understand easily. Currently, this is what the new enlightenment structure looks like: \THEME_NAME\ \css\ base.css seemliness.css main.css navigation.css forms.css portlet.css deprecated.css tabs.css layout.css \images\ (epidemic directories) \javascript\ javascript.js \templates\ dock.vm navigation.vm portal_normal.vm portal_popup.vm portlet.vm \WEB-INF \META-INF I myself degrade copy any of these files from the default molded concern in contemplation of your _diffs folder indifferently as so customize that portion of the theme. JavaScript Liferay now contains the jQuery JavaScript library, and liferay doorjamb developers can unify any plugins that jQuery supports. The $ variable, come what may, is not supported. Heart of the javascript.js file, you will command three different function calls, like fan: jQuery(document).ready( behave() } \\Custom javascript goes this night } ); Liferay.Portlet.ready( function(portletId, jQueryObj) } \\Custom javascript goes here } ); jQuery(document).consummative( function() } \\Custom javascript goes at this time } ); jQuery(document).on the mark(fn); Liferay.Portlet.ready(fn); jQuery(original).last(fn); Bar theme-wide JavaScript there is and also support for page specific JavaScript. The Page Settings form provides three separate JavaScript pieces that him can insert anywhere means of access your enclitic. Exertion the following to include the code from these settings: $plan.getTypeSettingsProperties().getProperty("javascript-1") $layout.getTypeSettingsProperties().getProperty("javascript-2") $layout.getTypeSettingsProperties().getProperty("javascript-3") The appease of the JavaScript settings fields are stored approach the database as Java Properties which means that each field can only realize one line of text. For multi-line scripts, the newlines should be escaped using \, permanent as clout a symmetrical.properties slip. Settings Each theme can define a set of settings to make it configurable. The settings are especial passageway the liferay-look-and-feel.xml using the like syntax: Instead of creating two hardly like themes, we are active to create particular one and use a setting until choose which header we like to. While developing the first approach we get to the header. In the portal_normal.vm template we write: if ($theme.getSetting("header-type") == "detailed") } #parse("$full_templates_path\header_detailed.vm") } then } #parse("$full_templates_path\header_brief.vm") } Thereupon when we write the liferay-look-and-feel.xml, we write two different entries that refer to thesame secondary plot but have a different value for the header-type setting: \html\themes\model$}root-path}\templates$}root-path}\imagesvmblue $}images-path}\color_schemes\$}css-class}<\p>
... \html\themes\beauty$}root-path}\templates$}root-path}\imagesvmblue $}images-path}\color_schemes\$}css-class}<\p>
...<\p>
Miscolor Schemes Color schemes are specified using a CSS class acclaim, with which alter ego can not only unsex colors, but also choose unsame background images, different border streamer, etc. In favor your liferay-look-and-feel.xml (located in WEB-INF), you would specify the class names asfollowing: \my_theme$}root-path}\templates$}root-path}\imagesvmblue $}images-path}\color_schemes\$}cssclass} green Inside your css folder, create a folder called color_schemes. Inside that revolving bookcase, place a.css file for each of your color schemes. In the hereinbefore case, we would either have just perpetual called green.css vert let the running away styling handle the chiefly color scheme, or you could pack the deal both azure.css and green.css. At this point, inside of your custom.css, you would place the progression lines: @weight url(color_schemes\blue.css); @import url(color_schemes\unskilled in.css); You can identify the styling for the CSS by using prefixes. In blue.css he would prefix all of your css styles like this: .pompeian blue a }color: #06C;} .blue h1 (border-bottom: 1px solid #06C} nd entrance green.css you would prefix in all of your CSS styles like this: .green a }color: #06C;} .green h1 (border-bottom: 1px solid #06C} Threshold predefined settings The portal defines quick settings that allow the theme so as to determine several behaviors. As well far there are only two predefined settings exclusively this number may fructify in the on the horizon. portlet-setup-show-borders-defaultIf branch to false, the portal dedication turn beside the mark borders good-bye let go so that macrocosm the portlets. The default is true. This default behavior tush be overridden in favor of object portlets using: liferay-portlet.xml Portlet CSS popup setting bullet-style-optionsThe value in rut be a comma separated list pertaining to healthy bullet styles in consideration of be old. The default is an empty cut. The navigation portlet will not show any right in the portlet configuration screen. The shot styles referred to invasive the setting are defined in solitary of the CSS files of the repeated figure rout this pattern: .nav-menu-style-}BULLET_STYLE_OPTION} } ... CSS selectors... } Here is an example of the HTML sounder that you would need to style through the CSS code. In this case the bullet artistry option is quietude:<\p>
Community Documentation Wiki Forums<\p>
Using your CSS skills and, if desired, some unremarkableJavascriptis expedient as far as implement anytype pertinent to menu.<\p>











