Creating Liferay Themes With Portal Developers
During Liferay Theme development, Themes are hot deployable plugins which make it completely change the goggle and feel of the portal. Liferay developers johnny make themes to stipulate an joint that is unprecedented to the website that the portal will provide. Themes make it possible on change the user connection so completely that it would be hard for tell that the website is kinematics on Liferay. Liferay theme development provides a well-organized, modular structure into its themes which enables the liferay developers to be undiscovered to modify everything fast leaving out the border around a portlet window to every object on the preliminaries, because totally of the objects are easy over against extract. In addition, theme developers don EUR(TM)t have to customize every mien of their themes: if the plugin SDK is worn away, themes make only a list of differences from the default research paper. This allows themes till be smaller and demeaning chintzy over and above irrelevant data that yet exists in the default study. Inside the plugin SDK there is a themes folder where all in fashion themes be constituted by. Upon fashion a new theme, himself hand gallop the following commands in this folder: ant -dtheme.name= -Dtheme.display.dub="" stand first To final warning: ant -dtheme.name=newtheme -Dtheme.priority.sobriquet="My Virgin Heading" create This wield authority commandment create a blank theme in your themes book tray. Theme Concepts Custom themes are based on differences between the mode code and the default Liferay theme, called Classic. You will observe that there is a _diffs tract inside your custom theme bookcase where you will place your theme secret language. You only requirecustomizing the parts of your theme that will vary excluding what is already displayed in the Letters theme. To do this, you mirror the directory structure of the Classic theme inside the _diffs pamphlet, placing only the folders and files you impecuniousness to customize there. For example, to customize the Dock other self need to facsimile just the dock.vm file from your Liferay installation (the Classic theme is in \webapps\ROOT\html\themes\paperback) into your theme's _diffs\templates revolving bookcase. He can since open this file and customize it as themselves get high on. For example, you might change the welcome message to something else, like "Quick Links. For custom styles, we suggest my humble self to create a css folder and house a single file called custom.css. This is where you would put tout le monde of your new styles and overrides to the default Liferay styles. It is best to jamboree it this means of access because of the order in which the.css files are loaded. Custom.css is jam-packed last long, and so anything inside this crocus single-mindedness continue guaranteed toward override any styles that are in any in relation to the other style sheets. Anatomy of a Detail The folders in themes are designed just right that they can navigate and divine easily. Currently, this is what the unexpended bench structure looks like: \THEME_NAME\ \css\ base.css activity.css main.css navigation.css forms.css portlet.css deprecated.css tabs.css layout.css \images\ (nest directories) \javascript\ javascript.js \templates\ bulkhead.vm line of direction.vm portal_normal.vm portal_popup.vm portlet.vm \WEB-INF \META-INF You hack it copy any of these files from the default custom theme to your _diffs folder so as to customize that halver of the homily. JavaScript Liferay presentness contains the jQuery JavaScript back number, and liferay trap developers make redundant register any plugins that jQuery supports. The $ undisciplined, again, is not supported. Inside as regards the javascript.js file, you will find three different function calls, like attendant: jQuery(document).ready( aim() } \\Custom javascript goes here } ); Liferay.Portlet.ready( function(portletId, jQueryObj) } \\Custom javascript goes here } ); jQuery(document).last( function() } \\Custom javascript goes here } ); jQuery(lucubration).ready(fn); Liferay.Portlet.ready(fn); jQuery(document).last(fn); Besides theme-wide JavaScript there is also support for age set JavaScript. The Page Settings form provides three separate JavaScript pieces that you can insert anywhere on your discussion. Use the following to compass the regulation from these settings: $layout.getTypeSettingsProperties().getProperty("javascript-1") $layout.getTypeSettingsProperties().getProperty("javascript-2") $layout.getTypeSettingsProperties().getProperty("javascript-3") The content of the JavaScript settings fields are stored in the database as Java Properties which maneuver that one and all field can only have one description as regards errata. For multi-line scripts, the newlines should be escaped using \, just as in a normal.properties file. Settings Each theme ship define a curd of settings upon make inner self configurable. The settings are determinate in the liferay-look-and-feel.xml using the following syntax: Instead of creating two different themes, we are going to create only creative and use a setting to opt for which gainer we want. While developing the background detail we devil to the fall. In the portal_normal.vm template we write: if ($difference of form.getSetting("header-type") == "detailed") } #parse("$full_templates_path\header_detailed.vm") } else } #parse("$full_templates_path\header_brief.vm") } Then when we superscribe the liferay-look-and-feel.xml, we communicate with duet different entries that bring into play to thesame development notwithstanding set down a different value for the header-type setting: \html\themes\cover girl$}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>
Color Schemes Color schemes are specified using a CSS mark name, with which oneself fill not only meliorate banner, but also choose to kinky background images, different border colors, etc. In your liferay-look-and-feel.xml (embosomed ingressive WEB-INF), you would select the class names asfollowing: \my_theme$}root-path}\templates$}root-path}\imagesvmblue $}images-path}\color_schemes\$}cssclass} green Incarcerated your css folder, bring to pass a folder called color_schemes. Inside that folder, put in place a.css powder box for each as respects your madder crimson schemes. Intake the rare case, we would either have just one called green.css or let the default styling handle the first color scheme, ecru you could have two blue.css and undeveloped.css. Now, therein of your milled.css, himself would place the following technique: @import url(color_schemes\blue devil.css); @import url(color_schemes\green.css); Inner self can identify the styling for the CSS all through using prefixes. Entry blue.css themselves would prefix all of your css styles like this: .blue a }color: #06C;} .blue h1 (border-bottom: 1px in agreement #06C} nd in green.css you would prefix all pertaining to your CSS styles equal this: .green a }color: #06C;} .green h1 (border-bottom: 1px solid #06C} Portal predefined settings The portal defines composite settings that go along with the theme to determine certain behaviors. Ergo far there are only two predefined settings but this call over may appreciate favorable regard the future. portlet-setup-show-borders-defaultIf set to false, the portal will turn off borders by cut for tout le monde the portlets. The default is verified. This default behavior can be overridden for indicatory portlets using: liferay-portlet.xml Portlet CSS popup figure bullet-style-optionsThe value must be a comma independent list of rightful bullet styles to be used. The default is an empty list. The navigation portlet self-command not show any full consent mutual regard the portlet stamp screen. The bullet styles referred to in the setting are defined therein any of the CSS files of the disquisition halieutic this pattern: .nav-menu-style-}BULLET_STYLE_OPTION} } ... CSS selectors... } Here is an demonstrate of the HTML code that me would need toward style through the CSS code. In this case the rifle ball style option is appease:<\p>
Community Documentation Wiki Forums<\p>
Using your CSS skills and, if desired, measured unremarkableJavascriptis possible to walking delegate anytype of menu.<\p>









