This is an improvement that fixes this ticket: http://issues.liferay.com/browse/LPS-2282
The backstory on this fix is that maintaining the theme's portal_normal.vm has become an issue because there are a lot of times that a user has overwritten portal_normal.vm, and many of our custom themes overwrite it as well.
However, there is a certain ordering that needs to happen in the head and footer portions of a given page.
This fix removes the responsibility of maintaining that order from the theme and instead offsets it to the $top_head_include $bottom_include.
This fix also makes it a convention that a themes main.css is included by the portal and not on theme level. A user can still add links to other files and if they wish they can either empty main.css or use it to import other CSS files.
$top_head_include is really a reference for top_head.jsp and $bottom_include is a reference for bottom.jsp, both of which exist in the portal.
top_head.jsp includes information in the head of the document this way:
- Portal CSS - this is Portal needed CSS that is required
- Porlet CSS links - these are the files that portlets include by defining them in liferay-portlet.xml
- JSR286 Markup Fragments - this can be any information that a developer wishes to be included in the head of the document
- Liferay fragments - in a portlet or taglib in Liferay, a developer can include information they wish to be included in the head of the document
- Custom CSS
- Theme CSS - this is the main.css file located in a theme's css directory.
- Page specific CSS - this is CSS added by the user inside of Manage Pages.
- Portlet specific CSS - this is CSS that is added by customizing a portlet using the Look & Feel Editor
bottom.jsp includes information in the footer of the page this way:
- Liferay fragments - in a portlet or taglib in Liferay, a developer can include information they wish to be included at the bottom of the document
- Google Analytics - A user can decide to have Google Analytics automatically included and this is where the file is placed
The pattern here is that there is an heirarchy of customization.
Portal needed stuff is included first
Then portlet developer stuff is included
Then theme developer stuff is included
Then end-user stuff is included