WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Templates, Menus & Design => Topic started by: Yumi on September 26, 2009, 11:07:15 AM

Title: (Solved) Flags for Language switching
Post by: Yumi on September 26, 2009, 11:07:15 AM
I followed the help page on language switching. Using the generic template, I inserted
Code: [Select]
show_menu(1, 0, 1, true, "[a]<img src=" .WB_URL .
  "/media/flags/[menu_title].gif />[/a]", '', '', '', false, '', 0);
into the index.php file. And it worked straight out of the box.

However, the flags are shown above the header. How can I get them to display within the header area. Must be a little code for the .css file.

Michael
Title: Re: Flags for Language switching
Post by: kweitzel on September 26, 2009, 12:08:38 PM
The positioning is a mixture of where whinin the sourcecode of the template the menucall is positioned and css. The source positioning defines the container where the menu is shown. The CSS defines how it is shown.

cheers

Klaus
Title: Re: Flags for Language switching
Post by: Yumi on September 26, 2009, 01:11:26 PM
Thanks for the advice. I tried it an succeeded to some extend.

When I put that code into the header section like this:
Code: [Select]
div id="header">
<h1><a href="<?php echo WB_URL ?>"><?php page_title(&#39;&#39;, &#39;[WEBSITE_TITLE]&#39;); ?></a></h1>
<h2>This is our homepage</h2>
show_menu(1, 1, 1, true, "[a]<img src=" .WB_URL .
  "/media/flags/[menu_title].gif />[/a]", '', '', '', false, '', 0);
</div>
Then it displays at the right place, but not flags but like this:
"show_menu(1, 1, 1, true, "[a][/a]", '', '', '', false, '', 0); "

Michael

Title: Just to write down my solution
Post by: Yumi on October 02, 2009, 02:37:11 PM
I experimented with kweitzels advice  and some searching and here is my solution (bolt text is my addition):

Template generic, index.php

Code: [Select]
<div id="header">
<h1><a href="<?php echo WB_URL ?>"><?php page_title(&#39;&#39;, &#39;[WEBSITE_TITLE]&#39;); ?></a></h1>
<h2>Zusammen meistern wir jede Situation</h2>
[b]<h3><a href="http://www.ot-exit.com/en"><img src="/media/flags/English.gif" alt="English" /img></a></h3>[/b]
</div>

Template generic, screen.css

Code: [Select]
[b]#header h3{
position: relative; bottom: 65px; left: 700px;
}[/b]

This displays a image called English.gif in folder /media/flags within the top-right header area. To keep languages separate I have two installations of WebsiteBaker. German in / and one in /en . The line links to the English language site when the little flag image is clicked.
Looks really good and thanks for the help.

Michael