1

I was wondering if it's possible to edit Liferay Portal's HTML code, add a couple of <br> to have more space between portlets. Or even add some Javascript to it? Is this possible? If so, how?

Thanks

5
  • Sure, you can use greasemonkey for Firefox, or you install scripts to Chrome very easily. Obviously this only affects your computer and doesn't change the actual data on the server. Commented Apr 12, 2013 at 15:32
  • @ChristianVarga then there's no point in changing it if I can't change the actual HTML onthe server Commented Apr 12, 2013 at 15:33
  • 1
    Liferay is open source, you can change everything if you want. Commented Apr 12, 2013 at 15:40
  • To get more space between portlets, you do not want to edit the HTML but the CSS. Commented Apr 12, 2013 at 15:46
  • 3
    @Jocelyn I know it's open source, I guess my question is how to do it Commented Apr 12, 2013 at 15:49

2 Answers 2

3

You can create your own theme, extending another theme (e.g. classic, _styled, etc.) and adding the 'diff' files, aka the ones you want to extend. In that case, you could extend a default css files, adding a rule like:

#content .portlet-layout .portlet-column-content {margin: 10px;}

Another quicker but less flexible approach is to use the

'Insert custom CSS that will be loaded after the theme.'

feature. This can be found at: Manage Pages > Look & Feel > CSS

Sign up to request clarification or add additional context in comments.

1 Comment

See Creating Liferay Themes for how to create a theme and Anatomy of a Theme for its structure. You could then put your change in _diffs/css/custom.css. For the second solution, you just insert your css rules in the text area under: 'Insert custom CSS that will be loaded after the theme.'
2

The Theme answer has already been given - if you just want to change the appearance (e.g. linebreaks) this is the way to go instead of your original question to change HTML output.

If you literally need to change the HTML code - e.g. add something to or remove something from the page, you should read about Hooks, particularly those that can override jsps. This is exactly what they've been built for.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.