Would like to be able to switch my flags based on the a.active css property.
So far css hasn't brought me near to where i want to be (since the image is nested inside the link, which is nested within the language div).

So there is probably some fiddling with code involved.

Basically i would like to be able to use one image as language-icon (that's easy, we allready do that). When this language icon gets used (someone clicks it) the image gets replaced with one with a higher opacity (so that the visitor can see what language is active).

See attached jpg for an idea.

Anyone?

CommentFileSizeAuthor
flags_2.jpg1.47 KBbr4t
flags.jpg1.33 KBbr4t

Comments

br4t’s picture

Surely this can't be that hard?

jose reyero’s picture

Status: Active » Fixed

You need to handle this in the theme.

This is from my site's template.php, as you can see it uses different images when active/inactive.

/**
 * Language icons
 */
function phptemplate_i18n_language_icon($lang, $active = FALSE) {
  $src = base_path().path_to_theme().'/flags/'.$lang.($active ? '_bw' : '').'.png';
  $languages = i18n_supported_languages();
  $width = 16; $height = 12;
  $attribs = array('class' => 'i18n-icon', 'width' => $width, 'height' => $height, 'alt' => $languages[$lang]);
  return "<img src=\"$src\" ".drupal_attributes($attribs)." /> ";
}

See http://www.reyero.net

br4t’s picture

thanks.
i fixed this another way.
But i'm still keen on getting this working, i might implement it at a later time!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.