Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Brandt Solovij
Where to add additional CSS to a hook?
31. Januar 2013 16:42
Antwort

Brandt Solovij

Rang: New Member

Nachrichten: 14

Eintrittsdatum: 23. März 2012

Neue Beiträge

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. Januar 2013 19:05
Antwort

David H Nebinger

Rang: Liferay Legend

Nachrichten: 5739

Eintrittsdatum: 1. September 2006

Neue Beiträge

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. Februar 2013 08:37
Antwort

Brandt Solovij

Rang: New Member

Nachrichten: 14

Eintrittsdatum: 23. März 2012

Neue Beiträge

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. Februar 2013 09:25
Antwort

David H Nebinger

Rang: Liferay Legend

Nachrichten: 5739

Eintrittsdatum: 1. September 2006

Neue Beiträge

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. Februar 2013 11:12
Antwort

Brandt Solovij

Rang: New Member

Nachrichten: 14

Eintrittsdatum: 23. März 2012

Neue Beiträge

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

-b
Brandt Solovij
RE: Where to add additional CSS to a hook?
1. Februar 2013 11:18
Antwort

Brandt Solovij

Rang: New Member

Nachrichten: 14

Eintrittsdatum: 23. März 2012

Neue Beiträge

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!