WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: Boudi on March 27, 2008, 09:15:35 PM

Title: Multilanguage possible on templates with show_menu2 #SOLVED#
Post by: Boudi 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 (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  :-)



Title: Re: Multilanguage possible on templates with show_menu2 ?
Post by: doc 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
Title: Multilanguage possible on templates with show_menu2 ?
Post by: Boudi on March 30, 2008, 02:56:19 PM
Thank you for the link :)

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?

[gelöscht durch Administrator]
Title: Re: Multilanguage possible on templates with show_menu2 ?
Post by: doc on March 30, 2008, 03: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
Title: Re: Multilanguage possible on templates with show_menu2 ?
Post by: Boudi on March 30, 2008, 11: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 (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: [Select]
<?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(&#39;DEFAULT_CHARSET&#39;)) { echo DEFAULT_CHARSET; } else { echo &#39;utf-8&#39;; }?>" />
<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]", &#39;&#39;, &#39;&#39;, &#39;&#39;, false, &#39;&#39;, 0); ?>

            </div>
            <!--end top_menu_links-->
            <div class="search_box">
                <?php if(SHOW_SEARCH == true) { ?>
                <form name="search" action="<?php echo WB_URL.&#39;/search/index&#39;.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 == &#39;enabled&#39; AND VISIBILITY != &#39;private&#39; AND $admin->get_session(&#39;USER_ID&#39;) == &#39;&#39;) {
                    
?>

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

                    <form name="logout" action="<?php echo LOGOUT_URL?>" method="post" class="login_table">
                    <h1><?php echo $TEXT[&#39;LOGGED_IN&#39;]; ?></h1>
                    <?php echo $TEXT[&#39;WELCOME_BACK&#39;]; ?>, <?php echo $admin->get_display_name(); ?>
                    <br>
                    <input type="submit" name="submit" value="<?php echo $MENU[&#39;LOGOUT&#39;]; ?>" />
                    <br>
                    <a href="<?php echo PREFERENCES_URL?>"><?php echo $MENU[&#39;PREFERENCES&#39;]; ?></a>
                    <a href="<?php echo ADMIN_URL?>/"><?php echo $TEXT[&#39;ADMINISTRATION&#39;]; ?></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?
Title: Re: Multilanguage possible on templates with show_menu2 ?
Post by: kweitzel on March 31, 2008, 07: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
Title: Re: Multilanguage possible on templates with show_menu2 ?
Post by: Boudi on April 01, 2008, 02: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: [Select]
<?php show_menu(101true"[a]<img src=" .WB_URL .  "/media/flags/[menu_title].gif border=0 />[/a]", &#39;&#39;, &#39;&#39;, &#39;&#39;, false, &#39;&#39;, 0); ?>
Code: [Select]
<?php show_menu2(001SM2_ROOT+2false"\n</li>"falsefalsefalse, &#39;<ul id="header_menu" class="menu">&#39;); ?><br />
Title: Re: Multilanguage possible on templates with show_menu2 ?
Post by: ruebenwurzel on April 01, 2008, 03: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
Title: Re: Multilanguage possible on templates with show_menu2 ?
Post by: Boudi on April 01, 2008, 04:33:50 PM
Hello Matthias,

So you mean that I can merge the flag-choise menu and allcss2 menu together in 1 show_menu2 ?  :?
Title: Re: Multilanguage possible on templates with show_menu2 ?
Post by: ruebenwurzel on April 01, 2008, 05: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
Title: Re: Multilanguage possible on templates with show_menu2 ?
Post by: doc on April 01, 2008, 05: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
Title: Re: Multilanguage possible on templates with show_menu2 ?
Post by: Boudi on April 01, 2008, 09: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.  :oops:

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: [Select]
<?php show_menu2(0SM2_ROOTSM2_STARTtrue"[a]<img src=" .WB_URL .  "/media/flags/[menu_title].gif border=0 />[/a]", &#39;&#39;, &#39;&#39;, &#39;&#39;, false, &#39;&#39;, 0); ?>
But I'm totally stucked on the menu. Or I see the whole menu (with containers) or I see nothing  :cry:

Code: [Select]
<?php show_menu2(0SM2_ROOTSM2_ALLSM2_ALLfalse"\n</li>"falsefalsefalse, &#39;<ul id="header_menu" class="menu">&#39;); ?>
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?  :oops:

Title: Re: Multilanguage possible on templates with show_menu2 ?
Post by: Boudi on April 02, 2008, 03:50:14 PM
Finally....I did it :)

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

flag code:

Code: [Select]
<?php show_menu2(0SM2_ROOTSM2_STARTtrue"[a]<img src=" .WB_URL .  "/media/flags/[menu_title].gif border=0 />[/a]", &#39;&#39;, &#39;&#39;, &#39;&#39;, false, &#39;&#39;, 0); ?>
menu code:

Code: [Select]
<?php show_menu2(0SM2_ROOT+1SM2_ALLSM2_ALL|SM2_CURRTREEfalse"\n</li>"falsefalsefalse, &#39;<ul id="header_menu" class="menu">&#39;); ?>
Title: Re: Multilanguage possible on templates with show_menu2 #SOLVED#
Post by: babsy on June 09, 2008, 02: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>