Padding Padding
Janet
Systems
 Register  Login 
Telephone  01628 566 178
Website Design, Hosting and Software Services
  Search 
Padding
corner Padding corner
Padding Padding
corner Padding corner
 DotNetNuke Articles

Using two controls to determine how information is to be displayed, with localisation of the options available.

In a recent module application I had one control within which the display options were configured, a second control was then used to present the information based on the selected style. In the selection control a dropdownlist was used to present the different display styles.

When we are only handling a single fixed language localisation this is a simple matter of looking for the different strings and responding accordingly.

In the Selection control I had a dropdownlist ddlDisplayStyle which was populated using:

ddlDisplayStyle.Items.Add("Listing")
ddlDisplayStyle.Items.Add("Review")
ddlDisplayStyle.Items.Add("Grid")
ddlDisplayStyle.Items.Add("Directory")
ddlDisplayStyle.SelectedValue = Settings("StyleID")

In the presentation control a select was used to handle the different display styles:

StyleID = Settings("StyleID")
Select Case StyleID
  Case "Listing"
    viewAs_Listing()
  Case "Review"
    viewAs_Review()
  Case "Grid"
    viewAs_Grid()
  Case "Directory"
    viewAs_Directory()
  Case Else
End Select

Our requirement is to provide localisation for the different styles. To do this we need to source the words used from the localisation file associated with the control. However, simply replacing the existing content with the localisation value will produce a failure on the select in the presentation control. We therefore need to add both a text and value parameter to each of our dropdownlist rows. This is illustrated in the listing below.

ddlDisplayStyle.Items.Add(New ListItem(Services.Localization.Localization.GetString("Listing", LocalResourceFile), "Listing"))
ddlDisplayStyle.Items.Add(New ListItem(Services.Localization.Localization.GetString("Review", LocalResourceFile), "Review"))
ddlDisplayStyle.Items.Add(New ListItem(Services.Localization.Localization.GetString("Grid", LocalResourceFile), "Grid"))
ddlDisplayStyle.Items.Add(New ListItem(Services.Localization.Localization.GetString("Directory", LocalResourceFile), "Directory"))

Using the listing above the user sees their localised text in the dropdownlist, but the two controls use our values of Listing, Grid, Review and Directory fo determining the presentation style.

NAT November 2005


This article viewed: 473 times Back

Copyright © 2004-2007 Janet Systems Ltd.

 Print   

For DotNetNuke modules and skins take a look at:

Snowcovered

DotNetNuke Website design and hosting from £15.00 per month. More...

Looking for a website design company in the Thames Valley, call us on 01628 566178

DotNetNuke Modules
DotNetNuke Modules availalble from Janet Systems

DotNetNuke Skins
DotNetNukeSkins.gif

from Janet Systems

Padding
Copyright 2002-2008 Janet Systems Ltd.   Terms Of Use  Privacy Statement Saturday, May 17, 2008