Portal Engine
Version 2.x > Portal Engine > How to manage languages with static webparts or breadcrumbs? View modes: 
User avatar
Member
Member
s.sabel@pc-soft.info - 5/31/2007 9:19:29 AM
   
How to manage languages with static webparts or breadcrumbs?
How to manage different languages for static webparts or for this example the breadcrumbs?


This is what i do:

Content before [Breadcrumbs]

<table border="0" width="100%" cellspacing="0" cellpadding="0" height="15">
<tr>
<td>
<img border="0" src="/app_themes/weda/images/15x15.gif" width="15" height="15"></td>
</tr>
</table>


<img border="0" src="/app_themes/weda/images/symbol_pfeil_kreis.gif" width="12" height="12"> Sie befinden sich hier: <font class="Brot">


then the [Breadcrumbs]


Content after [Breadcrumbs]
</font>
<table border="0" width="100%" cellspacing="0" cellpadding="0" height="33">
<tr>
<td>
<img border="0" src="/app_themes/weda/images/15x15.gif" width="15" height="15"></td>
</tr>
</table>


The "Sie befinden sich hier: " in the content before must change with switching to the different languages.

Is it possible with the standard webparts or must i programm an new webpart?

User avatar
Member
Member
kentico_petrpa - 6/5/2007 4:56:50 PM
   
RE:How to manage languages with static webparts or breadcrumbs?
The best way how to achieve your needs is to make two(resp. appropriate number) of identical webparts which will differ in the text of content after/before according the languages and you will put the code below in the Tab Code to each of them. This code will deny to show the webpart for the appropriate language. E.G. You should put the code below to the webpart which will have content after/before in german language.

<script runat="server">
protected override void OnLoad(EventArgs e)
{
if (CMS.CMSHelper.CMSContext.CurrentUser.PreferredCultureCode.ToLower() == "en-us")
{
this.Visible = false;
}

base.OnLoad(e);
}
</script>