You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Fe...@t-systems.com on 2009/01/08 08:34:11 UTC

Skinning Trinidad - dynamic path in stylesheet files?

Hi Guys,

 

i'm using an own css file (defined in the trinidad-skins.xml) for many
of my components. My faces application pages are available on different
paths, e.g. the news page is on /appname/pages/news/news.jsf and the
login page is on /appname/pages/security/login/login.jsf. In my
style.css file I want to use the background-image attribute: 

 

For example: 

       background-image:url('successicon.png'); 

 

The problem is that the path of the successicon.png can't be defined
absolutely because /appname/ often changes (my application has many
modules). So I can't use
background-image:url('/someappname/icons/successicon.png');. Using a
relative path doesn't work for me because the current destination is
always different (see news and login page) - so something like
background-image:url('../../successicon.png'); doesn't work. I don't
want to use the <tr:image> tag or something like this because I want to
have different images on different styles.

 

Do you know a way how to solve this problem?

 

Thank you and best regards

 

Felix 


Re: Skinning Trinidad - dynamic path in stylesheet files?

Posted by Andrew Robinson <an...@gmail.com>.
On Mon, Jan 12, 2009 at 12:26 AM, <Fe...@t-systems.com> wrote:

>  Hi *,
>
>
>
> I tried to use @IMPORT url("/module-desktop.css"); in my css file loaded by
> the trinidad-skins configuration but that doesn't seem to work. In the
> generated CSS file there are no @IMPORT statements and the content of the
> CSS file which should be imported is not there, too.  The module-desktop.css
> is located in /module-name/module-desktop.css – I copied it to the WEB-INF
> folder but that didn't help, too.
>
>
>
> Doesn't the Trinidad skinning support @IMPORT statements or am I doing
> something wrong?
>

No it doesn't

>
>
> Regards,
>
>
>
> Felix
>
>
>  ------------------------------
>
> *From:* Becker, Felix
> *Sent:* Thursday, January 08, 2009 8:57 AM
> *To:* users@myfaces.apache.org
> *Subject:* RE: Skinning Trinidad - dynamic path in stylesheet files?
>
>
>
> Oh, i just saw that trinidad automatically rewrites the url when using an
> absolute path like /icons/foo.png – cool.
>
>
>
> That solved my problem
>
>
>
> Felix
>
>
>  ------------------------------
>
> *From:* Becker, Felix
> *Sent:* Thursday, January 08, 2009 8:34 AM
> *To:* users@myfaces.apache.org
> *Subject:* Skinning Trinidad - dynamic path in stylesheet files?
>
>
>
> Hi Guys,
>
>
>
> i'm using an own css file (defined in the trinidad-skins.xml) for many of
> my components. My faces application pages are available on different paths,
> e.g. the news page is on /appname/pages/news/news.jsf and the login page is
> on /appname/pages/security/login/login.jsf. In my style.css file I want to
> use the background-image attribute:
>
>
>
> For example:
>
>        background-image:url('successicon.png');
>
>
>
> The problem is that the path of the successicon.png can't be defined
> absolutely because /appname/ often changes (my application has many
> modules). So I can't use
> background-image:url('/someappname/icons/successicon.png');. Using a
> relative path doesn't work for me because the current destination is always
> different (see news and login page) – so something like
>  background-image:url('../../successicon.png'); doesn't work. I don't want
> to use the <tr:image> tag or something like this because I want to have
> different images on different styles.
>
>
>
> Do you know a way how to solve this problem?
>
>
>
> Thank you and best regards
>
>
>
> Felix
>

RE: Skinning Trinidad - dynamic path in stylesheet files?

Posted by Fe...@t-systems.com.
Hi *,

 

I tried to use @IMPORT url("/module-desktop.css"); in my css file loaded
by the trinidad-skins configuration but that doesn't seem to work. In
the generated CSS file there are no @IMPORT statements and the content
of the CSS file which should be imported is not there, too.  The
module-desktop.css is located in /module-name/module-desktop.css - I
copied it to the WEB-INF folder but that didn't help, too.

 

Doesn't the Trinidad skinning support @IMPORT statements or am I doing
something wrong?

 

Regards,

 

Felix

 

________________________________

From: Becker, Felix 
Sent: Thursday, January 08, 2009 8:57 AM
To: users@myfaces.apache.org
Subject: RE: Skinning Trinidad - dynamic path in stylesheet files?

 

Oh, i just saw that trinidad automatically rewrites the url when using
an absolute path like /icons/foo.png - cool.

 

That solved my problem

 

Felix

 

________________________________

From: Becker, Felix 
Sent: Thursday, January 08, 2009 8:34 AM
To: users@myfaces.apache.org
Subject: Skinning Trinidad - dynamic path in stylesheet files?

 

Hi Guys,

 

i'm using an own css file (defined in the trinidad-skins.xml) for many
of my components. My faces application pages are available on different
paths, e.g. the news page is on /appname/pages/news/news.jsf and the
login page is on /appname/pages/security/login/login.jsf. In my
style.css file I want to use the background-image attribute: 

 

For example: 

       background-image:url('successicon.png'); 

 

The problem is that the path of the successicon.png can't be defined
absolutely because /appname/ often changes (my application has many
modules). So I can't use
background-image:url('/someappname/icons/successicon.png');. Using a
relative path doesn't work for me because the current destination is
always different (see news and login page) - so something like
background-image:url('../../successicon.png'); doesn't work. I don't
want to use the <tr:image> tag or something like this because I want to
have different images on different styles.

 

Do you know a way how to solve this problem?

 

Thank you and best regards

 

Felix 


RE: Skinning Trinidad - dynamic path in stylesheet files?

Posted by Fe...@t-systems.com.
Oh, i just saw that trinidad automatically rewrites the url when using
an absolute path like /icons/foo.png - cool.

 

That solved my problem

 

Felix

 

________________________________

From: Becker, Felix 
Sent: Thursday, January 08, 2009 8:34 AM
To: users@myfaces.apache.org
Subject: Skinning Trinidad - dynamic path in stylesheet files?

 

Hi Guys,

 

i'm using an own css file (defined in the trinidad-skins.xml) for many
of my components. My faces application pages are available on different
paths, e.g. the news page is on /appname/pages/news/news.jsf and the
login page is on /appname/pages/security/login/login.jsf. In my
style.css file I want to use the background-image attribute: 

 

For example: 

       background-image:url('successicon.png'); 

 

The problem is that the path of the successicon.png can't be defined
absolutely because /appname/ often changes (my application has many
modules). So I can't use
background-image:url('/someappname/icons/successicon.png');. Using a
relative path doesn't work for me because the current destination is
always different (see news and login page) - so something like
background-image:url('../../successicon.png'); doesn't work. I don't
want to use the <tr:image> tag or something like this because I want to
have different images on different styles.

 

Do you know a way how to solve this problem?

 

Thank you and best regards

 

Felix