Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Liferay not produce condensed HTML code?

I found that Liferay transfers my JSP code in a somehow "condensed" way -- putting most of the text into a few very long lines.

This makes it uncomfortable to debug javascript.

Is it possible to turn off this feature temporary?

like image 715
Dims Avatar asked Dec 29 '11 14:12

Dims


4 Answers

For others looking at this post, if you simply want to do this on an adhoc basis you can add these params to the URL:

/web/guest/page?js_fast_load=0&css_fast_load=0&strip=0

Note this is for JS, CSS and HTML

like image 130
htmlr Avatar answered Nov 16 '22 16:11

htmlr


HTML Minification is on regardless you're in developer mode or not since HTML stripping can itself produce problems you want to see in developer mode.

You can add strip=0 parameter to the URL to prevent the served HTML page being stripped.

In order to turn HTML-Stripping completely off change in your system.properties:

com.liferay.filters.strip.StripFilter=false

But as @BalusC said you should use a tool which does the formatting when debugging. So you're not bothered by the stripping.

like image 21
Fabian Barney Avatar answered Nov 16 '22 18:11

Fabian Barney


There are two ways to do it. Copy the following in portal-ext.properties and restart the server

javascript.fast.load=false

or If you dont want to restart and its just for temporary purpose add js_fast_load parameter to url and set its value to false.

For example if you are in a page http://localhost:8080/web/guest/home in which your portlet or the javascript is present. Use this url instead http://localhost:8080/web/guest/home?js_fast_load=0

like image 6
Sandeep Nair Avatar answered Nov 16 '22 16:11

Sandeep Nair


Liferay has a file named portal-developer.properties as template in WEB-INF/classes. You can either reference this or just copy/paste the content into your portal-ext.properties.

This has several options to minify html, js, css and others. You'll kill your loading time - i.e. you really only want these options at development time, but then it really helps.

By default all files are also combined into a single one (for js, another for css etc.) - with the development options you'll get a separate request for every file on every page request.

like image 1
Olaf Kock Avatar answered Nov 16 '22 17:11

Olaf Kock