Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 04:22:46 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155555 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Multilanguage possible on templates with show_menu2 #SOLVED#  (Read 1883 times)
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« on: March 27, 2008, 09:15:35 PM »

Hi there,

With ease I managed to set up the multilanguage website with the standard 'round' template.
( http://projects.websitebaker.org/websitebaker2/wiki/Docs-EN-Multilingual-Website )

Now i want to use the multilanguage setup into templates with the show_menu2 (eg: ALLCSS 2 template)

The problem that I'm facing is that in step 3 of the above link you have to replace the <?php page_menu(); ?>
 with another script in order to let the multilanguage script to work.

This piece of code is nowhere to find in another templates. I searched the forum but I could not find any answer to this question:

How can I create a multilanguage website with a template with the show_menu2 in it? (eg ALLCSS 2)

Hope for an answer  smiley



« Last Edit: April 02, 2008, 02:51:06 PM by knert » Logged

...:: Bake the Unbakable ::...
doc
Guest
« Reply #1 on: March 27, 2008, 09:25:38 PM »

Hello,

well the docu you are referring to is outdated, maybe you give it a try with the last docu available which can be found at:
http://help.websitebaker.org/pages/en/advanced-docu/designer-guide/multilingual-websites.php

Regards Christian
Logged
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #2 on: March 30, 2008, 01:56:19 PM »

Thank you for the link Smiley

For the last 2 days I have only one problem left: When integrating the flags into the website, the menu itself turns into images too! (see attachment)

Undoubtedly this is an error from me. But I didn't found how to solve this.

Is anyone familiar with this problem and knows a solution?
« Last Edit: March 30, 2008, 02:07:35 PM by knert » Logged

...:: Bake the Unbakable ::...
doc
Guest
« Reply #3 on: March 30, 2008, 02:27:40 PM »

Hello,

you have to use two menu calls in your template, one for the flags, one for the menus. If you have followed the example on the help site, the flags are created from the container pages only (e.g. DE, EN, XX). In other words, for flags do only show the root level. The pages menu starts one level below the root.

Regards Christian
Logged
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #4 on: March 30, 2008, 10:07:38 PM »

Hello Doc,

ThnQ for your answer. Again I did all the steps as mentioned in the helppage but I am still stucked. For 100% sure I have the first 2 steps correct. I think the problem is the show_menu function.

I tried it on the Micromedia_new template but no luck. (http://addons.websitebaker.org/pages/lorem-ipsum.php?template=micromedia_new)

Here's the (undoubtedly) wrong index.php with the edited show_menu codes:

Code:
<?php

/*

 WebsiteBaker Project <http://www.websitebaker.org/>
 Copyright (C) 2004-2006, Ryan Djurovich

 WebsiteBaker is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 WebsiteBaker is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with websitebaker; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><?php echo WEBSITE_TITLE?> - <?php echo PAGE_TITLE?></title>
<meta http-equiv="Content-Type" content="text/html; charset=<?php if(defined('DEFAULT_CHARSET')) { echo DEFAULT_CHARSET; } else { echo 'utf-8'; }?>" />
<meta name="description" content="<?php page_description(); ?>" />
<meta name="keywords" content="<?php page_keywords(); ?>" />
<link href="<?php echo TEMPLATE_DIR?>/screen.css" rel="stylesheet" type="text/css" media="screen" />
<link href="<?php echo TEMPLATE_DIR?>/print.css" rel="stylesheet" type="text/css" media="print" />
</head>
<body>

<div class="main">

    <div class="banner">
        <div class="site_name"><?php echo WEBSITE_TITLE?></div>
        <div class="utility"><a href="#">Utility Link</a> | <a href="#">Utility Link</a> | <a href="#">Utility Link</a></div>
        <div class="top_menu">
            <img alt="" src="<?php echo TEMPLATE_DIR?>/images/gblnav_left.gif" height="32" width="4" class="top_menu_left"> <img alt="glbnav_right.gif" src="<?php echo TEMPLATE_DIR?>/images/glbnav_right.gif" height="32" width="4" class="top_menu_right">
            <div class="top_menu_links"><?php show_menu2(101true"[a]<img src=" .WB_URL .  "/media/flags/[menu_title].gif />[/a]"''''''false''0); ?>

            </div>
            <!--end top_menu_links-->
            <div class="search_box">
                <?php if(SHOW_SEARCH == true) { ?>
                <form name="search" action="<?php echo WB_URL.'/search/index'.PAGE_EXTENSION?>" method="post">
                <input name="string" type="text" class="search_string" size="15" />
                <input type="submit" name="submit" value="Search" class="search_submit" />
                </form>
                <?php ?>
            </div>
        </div>
        <!-- end top_menu -->
    </div>
    <!-- end banner -->

    <div class="box">
        <img alt="" src="<?php echo TEMPLATE_DIR?>/images/tl_curve_white.gif" height="6" width="6" class="corner_left"> <img alt="" src="<?php echo TEMPLATE_DIR?>/images/tr_curve_white.gif" height="6" width="6" class="corner_right">
        <div class="breadcrumb">
            <?php show_breadcrumbs(); ?>
        </div>
        <div class="page_name">
            <h2><?php echo PAGE_TITLE?></h2>
        </div>
            <div class="menu">
                            <?php show_menu2(11); ?>
                <div class="login_box">
                <?php
                
if(FRONTEND_LOGIN == 'enabled' AND VISIBILITY != 'private' AND $admin->get_session('USER_ID') == '') {
                    
?>

                    <form name="login" action="<?php echo LOGIN_URL?>" method="post" class="login_table">
                    <h1><?php echo $TEXT['LOGIN']; ?></h1>
                    <?php echo $TEXT['USERNAME']; ?>:
                    <input type="text" name="username" style="text-transform: lowercase;" /><br>
                    <?php echo $TEXT['PASSWORD']; ?>:
                    <input type="password" name="password" /><br>
                    <input type="submit" name="submit" value="<?php echo $TEXT['LOGIN']; ?>" style="margin-top: 3px; text-transform: uppercase;" /><br>
                    <a href="<?php echo FORGOT_URL?>"><?php echo $TEXT['FORGOT_DETAILS']; ?></a>
                    <?php if(is_numeric(FRONTEND_SIGNUP)) { ?>
                    <a href="<?php echo SIGNUP_URL?>"><?php echo $TEXT['SIGNUP']; ?></a>
                    <?php ?>
                    </form>
                    <?php
                
} elseif(FRONTEND_LOGIN == 'enabled' AND is_numeric($admin->get_session('USER_ID'))) {
                    
?>

                    <form name="logout" action="<?php echo LOGOUT_URL?>" method="post" class="login_table">
                    <h1><?php echo $TEXT['LOGGED_IN']; ?></h1>
                    <?php echo $TEXT['WELCOME_BACK']; ?>, <?php echo $admin->get_display_name(); ?>
                    <br>
                    <input type="submit" name="submit" value="<?php echo $MENU['LOGOUT']; ?>" />
                    <br>
                    <a href="<?php echo PREFERENCES_URL?>"><?php echo $MENU['PREFERENCES']; ?></a>
                    <a href="<?php echo ADMIN_URL?>/"><?php echo $TEXT['ADMINISTRATION']; ?></a>
                    </form>
                    <?php
                
}
                
?>

            </div>
        </div>
        <div class="content">
            <?php page_content(); ?>
        </div>
        <!--end content -->
        <div class="footer">
            <?php page_footer(); ?>
            <div class="powered_by">
                Powered by <a href="http://www.websitebaker.org" target="_blank">websitebaker</a>
            </div> 
        </div>
    </div>
    <!--end box-->

</div>
</body>
</html>

My question is: Here I did something wrong, but can you see what I did wrong exactly?
Logged

...:: Bake the Unbakable ::...
kweitzel
Forum administrator
*****
Offline Offline

Posts: 6977


WWW
« Reply #5 on: March 31, 2008, 06:04:41 PM »

Have a look again at your menucode ... and compare it to to the demo of show_menu2: http://code.jellycan.com/sm2test/

Have a special look at the section "First Level" and "Second Level".

cheers

Klaus
Logged

WebsiteBaker Org e.V. - for WebsiteBaker

Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #6 on: April 01, 2008, 01:21:16 PM »

Hello Kweitzel,

ThnQ. I checked the examples!

After a few hours of trying all the steps I am a few steps closer now.

My basic template will be ALLCSS2. I managed it to let the flags do his job.

The ONLY issue that I cannot solve is that I cannot hide the container pages without hiding the childpages too.

So my question is: How can I hide the containers but show the menu that's underneath the containers.

These are my 2 show_menu's:

Code:
<?php show_menu(101true"[a]<img src=" .WB_URL .  "/media/flags/[menu_title].gif border=0 />[/a]"''''''false''0); ?>
Code:
<?php show_menu2(001SM2_ROOT+2false"\n</li>"falsefalsefalse'<ul id="header_menu" class="menu">'); ?><br />

Logged

...:: Bake the Unbakable ::...
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7973



WWW
« Reply #7 on: April 01, 2008, 02:21:14 PM »

Hello,

i saw you mixes show_menu with show_menu2. I would recommand to only use show_menu2. This way the menu only needs to be created one time and not twice and i think with the right parameters it also solves your question.

Matthias
Logged
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #8 on: April 01, 2008, 03:33:50 PM »

Hello Matthias,

So you mean that I can merge the flag-choise menu and allcss2 menu together in 1 show_menu2 ?  huh
Logged

...:: Bake the Unbakable ::...
ruebenwurzel
WebsiteBaker Org e.V.

Offline Offline

Posts: 7973



WWW
« Reply #9 on: April 01, 2008, 04:04:16 PM »

Hello,

no, you cannot do this with one menu call. But you can call show_menu2 multiple times. One for only show the flages and one for the menu itself and even a third or fourth call for spezial menu wich could be the same pages in every languages.

Using show_menu2 for all needed menus means, the whole menu tree is created only once and is displayed in different ways only with the setting off different parameters.

Matthias
Logged
doc
Guest
« Reply #10 on: April 01, 2008, 04:06:47 PM »

Hello knert,

please have a look at http://help.websitebaker.org/pages/en/advanced-docu/designer-guide/multiple-menus.php which explains the differences between calling the menu function twice (which is what you are after) and to have two differnt menus.

Regards Christian
Logged
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #11 on: April 01, 2008, 08:02:35 PM »

Hello Matthias and Christian,

Thank you for taking the time to help me out. I really appreciate it.

I read your tips en suggestion links. This made more things clear to me which i tried to use on the code. But may be the ALLCSS2 template is kinda rough for multilanguage, I don't know.  embarassed

But now I'm lost. After several days of reading, trying, logical thinking etcetera I'm stucked.

I use the ALLCSS2 template. The flag menu does work well now (at least, this code gives me a proper result):

Code:
<?php show_menu2(0SM2_ROOTSM2_STARTtrue"[a]<img src=" .WB_URL .  "/media/flags/[menu_title].gif border=0 />[/a]"''''''false''0); ?>

But I'm totally stucked on the menu. Or I see the whole menu (with containers) or I see nothing  cry

Code:
<?php show_menu2(0SM2_ROOTSM2_ALLSM2_ALLfalse"\n</li>"falsefalsefalse'<ul id="header_menu" class="menu">'); ?>

As far I can think logically after all those testing and reading I did the best I can but it didn't help me out.

Can you please explain to me what I messed up on this code?  embarassed

Logged

...:: Bake the Unbakable ::...
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #12 on: April 02, 2008, 02:50:14 PM »

Finally....I did it Smiley

I solved the multilanguage ALLCSS2 pulldownmenu which is compatible with Firefox too Smiley
With help from Matthias & Christian, thnQ.

flag code:

Code:
<?php show_menu2(0SM2_ROOTSM2_STARTtrue"[a]<img src=" .WB_URL .  "/media/flags/[menu_title].gif border=0 />[/a]"''''''false''0); ?>

menu code:

Code:
<?php show_menu2(0SM2_ROOT+1SM2_ALLSM2_ALL|SM2_CURRTREEfalse"\n</li>"falsefalsefalse'<ul id="header_menu" class="menu">'); ?>
Logged

...:: Bake the Unbakable ::...
babsy

Offline Offline

Posts: 322


« Reply #13 on: June 09, 2008, 01:32:35 PM »

hi.... Could i see a link to this page you made (because i think i have almost the same problem)
im making a page with the flags and with a drop down menu (generic template) - the flags works fine and the dropdown menu - UNTIL i try to hide the DK/UK top pages!! then it goes wrong, either i can get the drop down to work with the UK/DK as main pages - or i can hide the UK/DK pages, but then the drop down won´t work...
so im a bit lost here.... here is my code in the menu (its from generic template):

<div id="navigation">
        <?php if(SHOW_MENU2) { /* Only shown menu if we need to */ ?>    
        <?php pmenu(1,0,-1,false,'<li[locator][class]>[a][menu_title][/a]','</li>','<ul id="menu">','</ul>','',' class="sel"'); ?>
        <?php } ?>
<!--<ul>
<li class="selected"><a href="#">First page</a></li>
<li><a href="#">Second</a></li>
<li><a href="#">Third</a></li>
<li><a href="#">Fourth</a></li>
<li><a href="#">Fifth</a></li>
<li><a href="#">And the last one</a></li>
</ul>-->
</div>

« Last Edit: June 10, 2008, 09:27:33 AM by babsy » Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!