Remove Alloy UI from Liferay
Asked Answered
D

2

6

Liferay CMS comes with Alloy UI to do several javascript functions (draggable, sortable etc.) The thing is we also use several jQuery plugins that use jQuery UI. Alloy UI also loads slow and has big overhead causing the webpage to lag massively, so we'd like to remove it and do thing with jQuery UI.

Liferay loads Alloy UI files by default in the DOM, is there anything we need to remove (declarations etc.) in the server/portlet files?

Danndanna answered 5/12, 2012 at 12:0 Comment(0)
D
4

The short answer is I wouldn't bother trying! This is because Alloy UI is so integral to the Liferay UI, without it you'd have a lot of work to do to replace with jQuery replacements.

Alloy UI does a lot more than just draggable portlets, and sorting. It also controls popups, AJAX calls, and loads of other stuff that I haven't come across yet.

HOWEVER if you really want to put yourself through it then I'd suggest you first of all create a Custom Theme and remove any references to Alloy UI from the theme, and load jQuery instead.

Then you'll also need to create a hook or hooks (and possibly use EXT plugins) to replace all of the JSP files that reference Alloy UI, with copies that use jQuery to do the same functionality.

OR another way would be to for the Liferay source code on GitHub and create your own version from the source removing Alloy UI.

BUT I still strongly suggest you don't bother wasting your time. Love it or hate it, Alloy UI is bake dried into Liferay. If you follow either of my suggestions you're effectively stopping yourself from upgrading Liferay in the future.

A better suggestion would be to suggest ways of improving Alloy UI to Liferay, or contribute to the Alloy UI repository on GitHub and help the community.

~~ EDIT ~~

To disable Alloy UI for just non-authenticated users, then perhaps a HOOK that modifed the files in portal-web\docroot\html\common\themes\ would do the trick. In particular look at top_js.jspf. If you put checks in there to say only load Alloy UI if you're signed in then it might be the answer your after.

Dexamethasone answered 6/12, 2012 at 8:39 Comment(2)
Thanks for the insight. From what I saw myself Alloy UI is indeed hardcoded into Liferay, but I would like to ask if it is possible to disable it for the site's visitors only. I don't mind it being in the actual Liferay CMS, but I do not want the overhead if I am not going to use it for the frontend user.Danndanna
I get where you're coming from now. I've edited my answer with a further suggestion using Hooks to modify the JSP / JSPF files that load the JavaScript used by Liferay.Dexamethasone
P
0

It should be done by using the barebone/everything.js configuration, see: http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/javascri-3

The default logic is coded in com.liferay.portal.events.ServicePreAction in such a way that unauthenticated users get the list of barebone JavaScript files whereas authenticated users get both the list of barebone JavaScript files and the list of everything JavaScript files.

i think, that's what you want to do. No hook or something else needed.

Perquisite answered 12/2, 2013 at 12:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.