Reputation: 2475
We are liferay 6.1.2. Have got 3 portlets on 3 different pages. We have our own set of JS files and CSS files which are self sufficient for the page to work. I see that there are lots of files loaded from /html/js and /html/css. How can we avoid loading these files. I am pretty sure that none of the rules from these CSS files are used in our page.
Upvotes: 0
Views: 256
Reputation: 48067
Liferay's pages bring a lot of functionality with them - e.g. the theme might provide libraries, other components on the page (like the dockbar) might use that functionality.
In the case of Liferay's core themes, they provide the AlloyUI library and your portlets can just assume that this library is available. If you don't need it, make sure there's no other portlet on the page that needs it as well (e.g. Dockbar, Chat, Notification portlet)
On the CSS side, Liferay loads quite a bit of CSS from the theme - bootstrap CSS among it all. Eliminate it and then try to get your layout back... It's typically all minified and combined into a single file anyway.
You can configure the files that get loaded for anonymous users and for logged in users in portal-ext.properties. Search for "barebone" and "everything" in the linked document. Also make sure that you haven't disabled the CSS- and JS-minifier. Disabling them is recommended during development. In production they should be enabled.
Upvotes: 1