Jump to content

Flashmaster82

Members
  • Posts

    182
  • Joined

  • Last visited

Everything posted by Flashmaster82

  1. [...] // output the option tag echo "<option$selected value='$url' style='background-image:url({$language->language_icon->url});'> $language->title </option>"; [...] That code made it blank..
  2. Gary Austin But " flydev did show a working example before? Im i doing something wrong here?. Or can i do this by manually code the path to the images? Sorry but im a total beginner at PHP and processwire. /Thanks
  3. Tried with that code and now the file name isnt displaying though. hmm im i doing something wrong with something else?
  4. Thanks for the fast reply, this maybe my last post/reply that i can do for today ? anyways. $language->language_icon->first()->url this made the drop down blank $language->language_icon->url this outputted the attached file below. You mentioned something about file/path? Don´t know how or where i should change that. /thanks
  5. Hi and thank you very much for taking your time to help me. I haven´t been able to reply due to "you have reach the maximun amount of post for today".. Im a very beginner at PHP so thanks for being patient. I have attached the language settings so you can understand better. This is the code that i have at the moment <select onchange='window.location=$(this).val();'> <?php foreach ($languages as $language) { $selected = ''; // if this page isn't viewable (active) for the language, skip it if ( !$page->viewable( $language ) ) continue; // if language is current user's language, make it selected if ( $user->language->id == $language->id )$selected = " selected=selected"; // determine the "local" URL for this language $url = $page->localUrl( $language ); // output the option tag echo "<option$selected value='$url'> $language->language_icon $language->title </option>"; } ?> </select> I tried to implement your code but with no luck. Please help.. :)
  6. I have installed and setup the Multi language URL module. The problem is that i dont know how to display/output and image next to the language in the dropdown menu. Right now i have created a field name language_icon under the language template. I need to output the flag next to the Country name (title). The code below only display (se.svg Sweden). Please help! echo "<option$selected value='$url'> $language->language_icon $language->title </option>";
  7. echo "<option$selected value='$url'> $language->language_icon $language->title </option>";
×
×
  • Create New...