Fórumok

Minimal theme

Diogo Salazar, módosítva 9 év-val korábban

Minimal theme

Junior Member Bejegyzések: 51 Csatlakozás dátuma: 2013.08.28. Legújabb bejegyzések
Hi there!

I am trying to create a minimal Liferay theme and for that I'd like to remove as many JS/CSS libraries/files as possible.
I know that Liferay themes rely on AUI, but I was wondering if it is required to provide the most basic functionalities.

What files are a must for any theme in order to be able to access the Liferay JS API and to be able to add portlets to a page?

I have created a theme that doesn't include any libraries or css files:

<#include init />

	
		<meta charset="utf-8">
		<title>${the_title} - ${company_name}</title>
		<meta name="description" content="Simple test page">
        <meta name="keywords" content="test page html5">
		<meta content="initial-scale=1.0, width=device-width" name="viewport">
		
		<!--[if lt IE 9]>
            <script src="$javascript_folder/html5shiv.min.js"></script>
        <![endif]-->
	
	
		&lt;#include "${full_templates_path}/navigation.ftl" /&gt;
		&lt;#include "${full_templates_path}/footer.ftl" /&gt;
	


I am pretty sure that the dockbar and the drag and drop features are AUI based. I thought of adding portlets programmatically to a page.
Is there a way to simplify those and just have direct links to the control panel instead of a full blown dockbar?

Thanks in advance.
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: Minimal theme

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
No.

Liferay heavily uses all of it's JS and CSS for all of the OOTB portlets. You're really not going to be able to thin out much there at all.

That said, many sites pull in some other JS library cuz they don't want to learn or use AUI; if you are in a similar position, the best thing you can do is drop the other JS library and just bite the bullet and learn/use AUI.
Diogo Salazar, módosítva 9 év-val korábban

RE: Minimal theme

Junior Member Bejegyzések: 51 Csatlakozás dátuma: 2013.08.28. Legújabb bejegyzések
Thanks for the reply.

I do know how to use AUI, having used it for other sites in the past.

The site I am going to create will display only pieces of WebContent and custom portlets, AUI won't be used as it is either just text or custom development.
I wanted to trim it down to that extreme because the current implementation adds a lot of presentational classes to the HTML markup.

There is a lot of debate on using semantic HTML, but truth is: Liferay is not 100% semantic.
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: Minimal theme

Liferay Legend Bejegyzések: 14919 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
The problem is that Liferay's portlets and overall frame still use AUI extensively. You can't forget the control panel, etc., as they all use AUI too. I don't think you could gut AUI much and not affect the control panel...
Diogo Salazar, módosítva 9 év-val korábban

RE: Minimal theme

Junior Member Bejegyzések: 51 Csatlakozás dátuma: 2013.08.28. Legújabb bejegyzések
Thanks again.
I have been doing some testing on my own and without an extensive amount of hours, getting the CMS to work without AUI would not be possible.
Do you know if there is a way to make it less "verbose"?

The minimal theme initiative was to make use of Liferay as a CMS for an HTML5 semantic website.

I am not too familiar with Compass/SASS but I am pretty sure it would possible to create @extend rules so that non-semantic class names could be replaced by semantic ones. Hooks would have to be created in order to modify the behavior for the many portlet JS scripts that rely on class names.
thumbnail
Olaf Kock, módosítva 9 év-val korábban

RE: Minimal theme

Liferay Legend Bejegyzések: 6403 Csatlakozás dátuma: 2008.09.23. Legújabb bejegyzések
Does the minifier count as "less verbose"? You have 1 request for JS and 1 request for CSS, even cacheable. All files are combined into one, then minified into a single line.
Diogo Salazar, módosítva 9 év-val korábban

RE: Minimal theme

Junior Member Bejegyzések: 51 Csatlakozás dátuma: 2013.08.28. Legújabb bejegyzések
Hi Olaf,

Thanks for the response. It was nice meeting you at Boston at the Symposium.

I was actually looking for a way to have a theme and not load any LR dependencies, but that would break some other parts of the portal.

The minimal theme one can have inherit from is the _unstyled theme.
thumbnail
Olaf Kock, módosítva 9 év-val korábban

RE: Minimal theme

Liferay Legend Bejegyzések: 6403 Csatlakozás dátuma: 2008.09.23. Legújabb bejegyzések
Hi Diogo,

sounds legit: _unstyled is the way to go. It's definitely possible to "reimplement" a minimal theme, however this will be a lot of work, based on try&error. Also, I'm not sure what this would gain - especially if OP is thinking of building a modern website. The default themes & markup contain quite a bit of invisible functionailty. E.g. try to use Liferay with a screenreader: This works well, the UI is pretty accessible.

IMHO the tradeoff of using the default theme with this kind of functionality vs. the (hypothetical) few saved milliseconds load time is worth it. Note the hypothetical here: It's a lot of work to find out if a custom theme is feasible, and even more time to measure if this actually provides any benefit. If nothing else, nobody will be able to maintain it without *a lot* of analysis.

For these reasons something in me actually rejects thinking further about this problem, considering it as academical/hypothetical, not practical.