Forum OpenACS Development: Re: Idea to allow storing icons etc in themes

Collapse
Posted by Dave Bauer on
Don, I agree :) I am glad I mentioned this, using CSS makes alot more sense if it works.
Collapse
Posted by Emmanuelle Raffenne on
I don't know either for mime-type icons. I guess Don is right.

Here's an example of a style that displays an icon (from my site CSS):

.spanish {
background: url(/acs-lang/resources/es.gif);
background-repeat: no-repeat;
padding-left: 1.3em;
border: none;
}

Collapse
Posted by Don Baccus on
You just use that in a div, then? i.e <div class="spanish"></div>?
Collapse
Posted by Emmanuelle Raffenne on
Actually I use it in an <a href="@url@" class="spanish"> but yes, would be the same for a DIV I guess.
Collapse
Posted by Michael Cordova on
I think it's better using css instead of message keys, for several reasons. One point not mentioned yet is that we could define similar mime-type icons in one line, using the same configuration, for instance:
.mime-type-doc, .mime-type-docx, .mime-type-txt {
  background: url(/acs-lang/resources/images/mime-types/doc.png);
}

I recommend using a self-explanatory class name, for instance: mime-type-blablabla. Sample:

...download a <a href="../blabla/file.zip" class="mime-type-zip">zip version</a> of this folder...

You could also define a css style using "css attribute selectors", in order to put a spanish flag in every explicit spanish link. Something like that:

a[lang=spanish] {
  background: url(/acs-lang/resources/es.gif);
}
if you had something like <a href="@url@" lang="spanish">

Anyway, there is one question I have found: How could we mix 2 icons (i.ex. for a spanish zip file)?