Vista combinada Visión Plana Vista de árbol
Discusiones [ Anterior | Siguiente ]
toggle
Brandt Solovij
Where to add additional CSS to a hook?
31 de enero de 2013 16:42
Respuesta

Brandt Solovij

Ranking: New Member

Mensajes: 14

Fecha de incorporación: 23 de marzo de 2012

Mensajes recientes

Hi all and thanks in advance - essentially my issue is this :


A colleague of mine has configured a portlet to allow a business / power use to select a "mode" of a specific portlet (the hook) . He accomplished this by way of the custom-jsp process via the SDK plugins route.

The hook compile and imports into my liferay (6.1 on remote Tomcat 7) dev environment. Within his custom-jsp is a main.css. He initially added some light styling and has turned it over to me to finalize all the branding. We are approaching the styling of the hook by simply extending nested css statements in the main.css file

the file is found : docroot -> custom_jsps -> html-> portlet-> <portlet type> -> css -> main.css

However on build + subsequent redeploy ( which produce no warnings or errors both ) - the styles are not adhering to elements and the style declarations are not found within the referenced "main.css" (s) found via View Source.

An example of the approach would be :


.result {
display: inline-block;
float: none;
width: 100%;
.custom-result {
color: red;
}
}

Markup related would of course be

<div class="result">
<span class="custom-result"> some result </span>
</div>


Are we missing a step or ? Suggestions / advice / slander all welcome emoticon
David H Nebinger
RE: Where to add additional CSS to a hook?
31 de enero de 2013 19:05
Respuesta

David H Nebinger

Community Moderator

Ranking: Liferay Legend

Mensajes: 8431

Fecha de incorporación: 1 de septiembre de 2006

Mensajes recientes

I'm assuming the hook applies to a Liferay OOTB portlet, because you cannot hook an external portlet.

I believe if you look at the ROOT/html/portlet/<portlet type>/css folder, you'll see your css files. However, you won't see any other files/directories in /ROOT/html/portlet/<portlet type>/ directory if it's not a Liferay portlet.
Brandt Solovij
RE: Where to add additional CSS to a hook?
1 de febrero de 2013 8:37
Respuesta

Brandt Solovij

Ranking: New Member

Mensajes: 14

Fecha de incorporación: 23 de marzo de 2012

Mensajes recientes

David H Nebinger:
I'm assuming the hook applies to a Liferay OOTB portlet, because you cannot hook an external portlet.

I believe if you look at the ROOT/html/portlet/<portlet type>/css folder, you'll see your css files. However, you won't see any other files/directories in /ROOT/html/portlet/<portlet type>/ directory if it's not a Liferay portlet.



Thanks David - I did find some success when i tried this, but i was unsure if it was the correct approach. If you're endorsing it, I'm good with it! Thank you! emoticon
David H Nebinger
RE: Where to add additional CSS to a hook?
1 de febrero de 2013 9:25
Respuesta

David H Nebinger

Community Moderator

Ranking: Liferay Legend

Mensajes: 8431

Fecha de incorporación: 1 de septiembre de 2006

Mensajes recientes

Brandt Solovij:
Thanks David - I did find some success when i tried this, but i was unsure if it was the correct approach. If you're endorsing it, I'm good with it! Thank you! emoticon


Wait, I didn't think I was endorsing anything...

What I said was, if you are trying to change a Liferay portlet, then this would work. But if you're trying to change your own portlet, this will not work.

Personally, though, I'd recommend using a theme. Applies CSS across the board, whether for an OOTB portlet or your own portlets.
Brandt Solovij
RE: Where to add additional CSS to a hook?
1 de febrero de 2013 11:12
Respuesta

Brandt Solovij

Ranking: New Member

Mensajes: 14

Fecha de incorporación: 23 de marzo de 2012

Mensajes recientes

Ok fair enough - I'll approach it from the theme level

-b
Brandt Solovij
RE: Where to add additional CSS to a hook?
1 de febrero de 2013 11:18
Respuesta

Brandt Solovij

Ranking: New Member

Mensajes: 14

Fecha de incorporación: 23 de marzo de 2012

Mensajes recientes

Yep - custom.css within the theme picked up and propagated the changes immediately. We were hoping to bundle the component CSS modifications with the hook project ( hooked to the OOTB portlet ) but it looks like that won't be the case. Thanks again for the suggestions and discussion!
Fernando Fernandez
RE: Where to add additional CSS to a hook?
1 de agosto de 2014 7:38
Respuesta

Fernando Fernandez

Ranking: Junior Member

Mensajes: 27

Fecha de incorporación: 22 de agosto de 2007

Mensajes recientes

I was also using custom.css to override some base css but I have this requirement to suport IE9.

Unfortunately, IE9 does not seem to interpret the CSS files coming from Liferay in the same order and so I think sometimes changing the original css witha hook is really necessary.