Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2005
    Posts
    343
    Plugin Contributions
    0

    Default Non-selected language header link

    I created a group of icons in the header to replace the text links in the header navigation, like 'login', 'contact us', etc. I want one of these icons to be for switching to the other language. I have it almost working (maybe?) -- it switches correctly from language 1 -> 2, but not the other way around. Here's what I have:

    Code:
    <?php echo '<div class="' . strtolower(HEADER_TITLE_LANGUAGE) . '"><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '"></a></div>';?>
    I know, I canibalized this code incorrectly but not sure what i'm missing. Any advice to get it fully functioning? I saw the threads on creating a language_header.php to put all of the language flags in the header. I only have two languages and want it to display JUST the one that is currently not selected.

    Thanks in advance! Running 1.3.0.1 if it matters...

  2. #2
    Join Date
    Aug 2005
    Posts
    343
    Plugin Contributions
    0

    Default Re: Non-selected language header link

    Ok, I figured it out myself (maybe).

    Code:
    if ($_SESSION['languages_id'] == 1) {$key = 'da';}
    	      else {$key = 'en';}
    	      echo '<div class="' . strtolower(HEADER_TITLE_LANGUAGE) . '"><a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('language', 'currency')) . 'language=' . $key, $request_type) . '"></a></div>';?>
    It seemingly works now but I just guessed without knowing how this actually works. Can someone verify I'm not messing anything up with this?

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •