General Community > WebsiteBaker Website Showcase

wb website in 6 languages (also japanese)

<< < (3/4) > >>

carfreak:
Sandra,

i am struggling for days now and i cant get the second menu switching with the language.

can you share your tamplate with us.
or can you give us an code example of the settings what you used wit show_menu2

i am also intrested in the page structure you used to setup de multilang site.

greetings Carfreak

sandra:
Hello carfreak,

These are the links in the flags:

--- Code: ---<map name="Map" id="Map">
      <area shape="rect" coords="178,128,209,148" href="<?php echo WB_URL; ?>/pages/en.php?lang=EN" alt="english" />
      <area shape="rect" coords="211,128,242,148" href="<?php echo WB_URL; ?>/pages/de.php?lang=DE" alt="german" />
      <area shape="rect" coords="243,128,274,148" href="<?php echo WB_URL; ?>/pages/nl.php?lang=NL" alt="dutch" />
      <area shape="rect" coords="274,128,306,148" href="<?php echo WB_URL; ?>/pages/es.php?lang=ES" alt="spanish" />
      <area shape="rect" coords="308,129,338,148" href="<?php echo WB_URL; ?>/pages/fr.php?lang=FR" alt="french" />
      <area shape="rect" coords="338,129,368,148" href="<?php echo WB_URL; ?>/pages/ja.php?lang=JA" alt="japanese" />
    </map>
--- End code ---

code for horizontal menu:

--- Code: ---      <?php 
    //sand multilingual
                
    // default language , the defaultlanguage is considered the language of the first page
    //$defaultlanguage = &#39;/nl&#39;;
    $result = $database->query("SELECT language FROM ".TABLE_PREFIX."pages WHERE page_id = 1 LIMIT 0,1");
    if($result->numRows() > 0) {
      $language = $result->fetchRow();
      $defaultlanguage = $language[&#39;language&#39;];
      $defaultlanguage = &#39;/&#39;.$defaultlanguage ;
     }
     
    // Get language page link
    $parse_wb_url = parse_url(WB_URL);
    $set = $parse_wb_url[&#39;path&#39;];
    $actual = $_SERVER[&#39;REQUEST_URI&#39;];
    $pageslen = strlen(PAGES_DIRECTORY);
    $language_link = substr(str_replace($set, &#39;&#39;, $actual), $pageslen, 3);
    
    //if the visitor enters the site, no pages directory is visible in url; set language_link to defaultlanguage
    $p = substr(str_replace($set, &#39;&#39;, $actual), 1, 5);
    if ($p!=&#39;pages&#39;){$language_link=$defaultlanguage ;}
    

    // Get language page id
    $result = $database->query("SELECT page_id FROM ".TABLE_PREFIX."pages WHERE link = &#39;$language_link&#39; LIMIT 0,1");
    if($result->numRows() > 0) {
      $page = $result->fetchRow();
      $parent = $page[&#39;page_id&#39;];
      
        show_menu2(0, $parent, SM2_ALL, SM2_ALL, false, "\n</li>", false, false, false, &#39;<ul id="header_menu" class="menu">&#39;);
    } else {
      // Can&#39;t figure out the root ID, so just use normal menu
      //show_menu(2);
      //show_menu2(0, 17, SM2_ALL, SM2_ALL, false, "\n</li>", false, false, false, &#39;<ul id="header_menu" class="menu">&#39;);
      //show_menu2(0, SM2_CURR+1, SM2_CURR+1); 
            //SAND for news read more
      $parent = 17; //english

      show_menu2(0, $parent, SM2_ALL, SM2_ALL, false, "\n</li>", false, false, false, &#39;<ul id="header_menu" class="menu">&#39;);
    }
    ?>

--- End code ---

code for vertical menu:

--- Code: --- <?php if(SHOW_MENU) {    ?>
    <div id="sideColumn"> <br />
      <br />
      <?php //SAND
    show_menu2(0, SM2_ROOT+2, SM2_CURR+1);   ?>
--- End code ---

I attached an image with part of the page structure.

I hope this will help you.






[gelöscht durch Administrator]

carfreak:
Hi Sandra,

first of all thanks for de code and site structure.

i do have a question,

how did you setup the initial language pages (wysiwyg,menulink ???)

English and so on.

greetings

Carfreak

carfreak:
Hi Sandra,

would you be so kind to share de template files ?
So i can take a look at the total setup of the template and menu settings.

geetings

Carfreak.

sandra:
Hallo,

For the language page, like english.php, I made a WYSWYG page. And in the code view of the page I've put the following javascript code to direct the page to the first page of the website for that language:

<script name="javascript" type="text/javascript">
window.location = 'http://85.92.129.70/~trekwerk/pages/en/trekwerk.php'
</script>

Sandra

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version